Public report of muni-works/vcad, published 16 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 16 November 2026, 23:45 UTC · Survey ID cd_23c0115e9f8a48d8b31655ce481c6bac
muni-works/vcad
Measured 16 November 2026, 23:41 UTC, at code version 1b4e563
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 734,735 lines of product code in 118 projects, tests not counted · Estimated rebuild effort: about 5.6 person-years · Weakest lens: Accessibility, 44.4
Findings by how serious they are
239 critical5383 serious237 minor
16 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 23:41 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
83of 83 dimensions measured by tools.
5814of 5859 findings point to an exact file and line, so you can open each one in the code. The other 45 concern the repository as a whole, such as missing documentation.
83dimensions across 8 lenses, read from 734,735 lines of product code in 118 projects.
muni-works/vcad is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because it has controls that only work with a mouse. It scores 51.2 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Accessibility, at 44.4, is the weakest lens and counts most in the score. The best first step for the work it takes is replacing the two exposed passwords or keys and switching the old ones off, worth about 2.4 points. Making the controls keyboard-usable would lift Accessibility itself, worth about 4.8 points. Raising Accessibility to 65 would lift the score to about 56.5.
Seventy-four known security holes in the packages the code depends on can be used by attackers. Sixty-eight pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and twenty-five controls can't be used without a mouse. Making the controls work with a keyboard, updating the vulnerable packages and pinning each tool to an exact version would close these risks. Limiting each secret to its own step would fix the ten secrets exposed to more of the pipeline than needed, and the three passwords or keys in the code's history and the two passwords or keys in the code need replacing, with the old ones switched off. The 25 form fields without a label need a label.
The product code is 734,735 lines, about €810,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Accessibility rose from 44.4 to 65, the lowest score rated Strong, the score would rise from 51.2 to about 56.5.
Code composition: what the lines of code are
Product code 86%Tests 14%
Rebuild cost: about €810,000 · Estimate
Cost to rebuild
€270,000 to €1,400,000, for 4,485 to 14,228 hours of work, about 5.6 person-years for 3 to 11 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 51. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 734,735 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
Raises the score by about 2.4 points · Low effort · Secret Scanning
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 4.8 points · Medium effort · Keyboard semantics
3
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €810,000 to build again, about 5.6 person-years of work. Its weakest lens is Accessibility, at 44.4 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 2.4 points for low effort, because it clears the 2 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 476,373 lines over the last 90 days, which is about 1,931,957 lines a year. At that pace, the extra work comes to an estimated 282.9 to 1697.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1363 modules, with 2186 dependencies between them. 11 loops run through 25 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1323 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
packages.engine.src uses packages.docs.src.lib.vcad, so a change to packages.docs.src.lib.vcad can break packages.engine.src, while a change to packages.engine.src can't break packages.docs.src.lib.vcad.
Position
Below the diagonal: packages.engine.src uses a module listed above it, which is the healthy direction.
packages.engine.src uses packages.ir.src.generated, so a change to packages.ir.src.generated can break packages.engine.src, while a change to packages.engine.src can't break packages.ir.src.generated.
Position
Below the diagonal: packages.engine.src uses a module listed above it, which is the healthy direction.
vcad_kernel_cam uses vcad_kernel_cam.tool, so a change to vcad_kernel_cam.tool can break vcad_kernel_cam, while a change to vcad_kernel_cam can't break vcad_kernel_cam.tool.
Position
Below the diagonal: vcad_kernel_cam uses a module listed above it, which is the healthy direction.
vcad_kernel_dfm.issue uses vcad_kernel_cost, so a change to vcad_kernel_cost can break vcad_kernel_dfm.issue, while a change to vcad_kernel_dfm.issue can't break vcad_kernel_cost.
Position
Below the diagonal: vcad_kernel_dfm.issue uses a module listed above it, which is the healthy direction.
vcad_kernel_drafting.dimension.render uses vcad_kernel_drafting.types, so a change to vcad_kernel_drafting.types can break vcad_kernel_drafting.dimension.render, while a change to vcad_kernel_drafting.dimension.render can't break vcad_kernel_drafting.types.
Position
Below the diagonal: vcad_kernel_drafting.dimension.render uses a module listed above it, which is the healthy direction.
vcad_kernel_geom uses vcad_kernel_math, so a change to vcad_kernel_math can break vcad_kernel_geom, while a change to vcad_kernel_geom can't break vcad_kernel_math.
Position
Below the diagonal: vcad_kernel_geom uses a module listed above it, which is the healthy direction.
packages.app.src.components uses packages.core.src.types, so a change to packages.core.src.types can break packages.app.src.components, while a change to packages.app.src.components can't break packages.core.src.types.
Position
Below the diagonal: packages.app.src.components uses a module listed above it, which is the healthy direction.
packages.app.src.components uses packages.docs.src.lib.vcad, so a change to packages.docs.src.lib.vcad can break packages.app.src.components, while a change to packages.app.src.components can't break packages.docs.src.lib.vcad.
Position
Below the diagonal: packages.app.src.components uses a module listed above it, which is the healthy direction.
packages.app.src.components uses packages.ir.src.generated, so a change to packages.ir.src.generated can break packages.app.src.components, while a change to packages.app.src.components can't break packages.ir.src.generated.
Position
Below the diagonal: packages.app.src.components uses a module listed above it, which is the healthy direction.
packages.app.src.components uses packages.engine.src, so a change to packages.engine.src can break packages.app.src.components, while a change to packages.app.src.components can't break packages.engine.src.
Position
Below the diagonal: packages.app.src.components uses a module listed above it, which is the healthy direction.
packages.app.src.lib uses packages.docs.src.lib.vcad, so a change to packages.docs.src.lib.vcad can break packages.app.src.lib, while a change to packages.app.src.lib can't break packages.docs.src.lib.vcad.
Position
Below the diagonal: packages.app.src.lib uses a module listed above it, which is the healthy direction.
packages.app.src.lib uses packages.ir.src.generated, so a change to packages.ir.src.generated can break packages.app.src.lib, while a change to packages.app.src.lib can't break packages.ir.src.generated.
Position
Below the diagonal: packages.app.src.lib uses a module listed above it, which is the healthy direction.
packages.app.src.lib uses packages.engine.src, so a change to packages.engine.src can break packages.app.src.lib, while a change to packages.app.src.lib can't break packages.engine.src.
Position
Below the diagonal: packages.app.src.lib uses a module listed above it, which is the healthy direction.
packages.mcp.src uses packages.ir.src.generated, so a change to packages.ir.src.generated can break packages.mcp.src, while a change to packages.mcp.src can't break packages.ir.src.generated.
Position
Below the diagonal: packages.mcp.src uses a module listed above it, which is the healthy direction.
packages.mcp.src uses packages.engine.src, so a change to packages.engine.src can break packages.mcp.src, while a change to packages.mcp.src can't break packages.engine.src.
Position
Below the diagonal: packages.mcp.src uses a module listed above it, which is the healthy direction.
packages.mcp.src.tools uses packages.core.src.types, so a change to packages.core.src.types can break packages.mcp.src.tools, while a change to packages.mcp.src.tools can't break packages.core.src.types.
Position
Below the diagonal: packages.mcp.src.tools uses a module listed above it, which is the healthy direction.
packages.mcp.src.tools uses packages.docs.src.lib.vcad, so a change to packages.docs.src.lib.vcad can break packages.mcp.src.tools, while a change to packages.mcp.src.tools can't break packages.docs.src.lib.vcad.
Position
Below the diagonal: packages.mcp.src.tools uses a module listed above it, which is the healthy direction.
packages.mcp.src.tools uses packages.ir.src.generated, so a change to packages.ir.src.generated can break packages.mcp.src.tools, while a change to packages.mcp.src.tools can't break packages.ir.src.generated.
Position
Below the diagonal: packages.mcp.src.tools uses a module listed above it, which is the healthy direction.
34 pairs of types, where a type in packages.mcp.src.tools uses a type in packages.engine.src. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
packages.mcp.src.tools uses packages.engine.src, so a change to packages.engine.src can break packages.mcp.src.tools, while a change to packages.mcp.src.tools can't break packages.engine.src.
Position
Below the diagonal: packages.mcp.src.tools uses a module listed above it, which is the healthy direction.
vcad_kernel_primitives uses vcad_kernel_topo, so a change to vcad_kernel_topo can break vcad_kernel_primitives, while a change to vcad_kernel_primitives can't break vcad_kernel_topo.
Position
Below the diagonal: vcad_kernel_primitives uses a module listed above it, which is the healthy direction.
vcad_kernel_primitives uses vcad_kernel_geom, so a change to vcad_kernel_geom can break vcad_kernel_primitives, while a change to vcad_kernel_primitives can't break vcad_kernel_geom.
Position
Below the diagonal: vcad_kernel_primitives uses a module listed above it, which is the healthy direction.
vcad_app.document_api uses vcad_crdt.types, so a change to vcad_crdt.types can break vcad_app.document_api, while a change to vcad_app.document_api can't break vcad_crdt.types.
Position
Below the diagonal: vcad_app.document_api uses a module listed above it, which is the healthy direction.
vcad_app.document_api uses vcad_ir, so a change to vcad_ir can break vcad_app.document_api, while a change to vcad_app.document_api can't break vcad_ir.
Position
Below the diagonal: vcad_app.document_api uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.drc uses vcad_ir.ecad, so a change to vcad_ir.ecad can break vcad_ecad_pcb.drc, while a change to vcad_ecad_pcb.drc can't break vcad_ir.ecad.
Position
Below the diagonal: vcad_ecad_pcb.drc uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate uses vcad_kernel_topo, so a change to vcad_kernel_topo can break vcad_kernel_tessellate, while a change to vcad_kernel_tessellate can't break vcad_kernel_topo.
Position
Below the diagonal: vcad_kernel_tessellate uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate uses vcad_kernel_geom, so a change to vcad_kernel_geom can break vcad_kernel_tessellate, while a change to vcad_kernel_tessellate can't break vcad_kernel_geom.
Position
Below the diagonal: vcad_kernel_tessellate uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate uses vcad_kernel_primitives, so a change to vcad_kernel_primitives can break vcad_kernel_tessellate, while a change to vcad_kernel_tessellate can't break vcad_kernel_primitives.
Position
Below the diagonal: vcad_kernel_tessellate uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.session uses vcad_ir.ecad, so a change to vcad_ir.ecad can break vcad_ecad_pcb.session, while a change to vcad_ecad_pcb.session can't break vcad_ir.ecad.
Position
Below the diagonal: vcad_ecad_pcb.session uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.session uses vcad_ir, so a change to vcad_ir can break vcad_ecad_pcb.session, while a change to vcad_ecad_pcb.session can't break vcad_ir.
Position
Below the diagonal: vcad_ecad_pcb.session uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.session uses vcad_ecad_pcb.drc, so a change to vcad_ecad_pcb.drc can break vcad_ecad_pcb.session, while a change to vcad_ecad_pcb.session can't break vcad_ecad_pcb.drc.
Position
Below the diagonal: vcad_ecad_pcb.session uses a module listed above it, which is the healthy direction.
vcad_kernel_booleans.api uses vcad_kernel_geom, so a change to vcad_kernel_geom can break vcad_kernel_booleans.api, while a change to vcad_kernel_booleans.api can't break vcad_kernel_geom.
Position
Below the diagonal: vcad_kernel_booleans.api uses a module listed above it, which is the healthy direction.
vcad_kernel_booleans.api uses vcad_kernel_primitives, so a change to vcad_kernel_primitives can break vcad_kernel_booleans.api, while a change to vcad_kernel_booleans.api can't break vcad_kernel_primitives.
Position
Below the diagonal: vcad_kernel_booleans.api uses a module listed above it, which is the healthy direction.
vcad_kernel_booleans.api uses vcad_kernel_tessellate, so a change to vcad_kernel_tessellate can break vcad_kernel_booleans.api, while a change to vcad_kernel_booleans.api can't break vcad_kernel_tessellate.
Position
Below the diagonal: vcad_kernel_booleans.api uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate.frozen uses vcad_kernel_topo, so a change to vcad_kernel_topo can break vcad_kernel_tessellate.frozen, while a change to vcad_kernel_tessellate.frozen can't break vcad_kernel_topo.
Position
Below the diagonal: vcad_kernel_tessellate.frozen uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate.frozen uses vcad_kernel_geom, so a change to vcad_kernel_geom can break vcad_kernel_tessellate.frozen, while a change to vcad_kernel_tessellate.frozen can't break vcad_kernel_geom.
Position
Below the diagonal: vcad_kernel_tessellate.frozen uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate.frozen uses vcad_kernel_primitives, so a change to vcad_kernel_primitives can break vcad_kernel_tessellate.frozen, while a change to vcad_kernel_tessellate.frozen can't break vcad_kernel_primitives.
Position
Below the diagonal: vcad_kernel_tessellate.frozen uses a module listed above it, which is the healthy direction.
vcad_kernel_tessellate.frozen uses vcad_kernel_tessellate, so a change to vcad_kernel_tessellate can break vcad_kernel_tessellate.frozen, while a change to vcad_kernel_tessellate.frozen can't break vcad_kernel_tessellate.
Position
Below the diagonal: vcad_kernel_tessellate.frozen uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.router.auto uses vcad_ir.ecad, so a change to vcad_ir.ecad can break vcad_ecad_pcb.router.auto, while a change to vcad_ecad_pcb.router.auto can't break vcad_ir.ecad.
Position
Below the diagonal: vcad_ecad_pcb.router.auto uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.router.auto uses vcad_ir, so a change to vcad_ir can break vcad_ecad_pcb.router.auto, while a change to vcad_ecad_pcb.router.auto can't break vcad_ir.
Position
Below the diagonal: vcad_ecad_pcb.router.auto uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.router.auto uses vcad_ecad_pcb.session, so a change to vcad_ecad_pcb.session can break vcad_ecad_pcb.router.auto, while a change to vcad_ecad_pcb.router.auto can't break vcad_ecad_pcb.session.
Position
Below the diagonal: vcad_ecad_pcb.router.auto uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.router.maze uses vcad_ir.ecad, so a change to vcad_ir.ecad can break vcad_ecad_pcb.router.maze, while a change to vcad_ecad_pcb.router.maze can't break vcad_ir.ecad.
Position
Below the diagonal: vcad_ecad_pcb.router.maze uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.router.maze uses vcad_ir, so a change to vcad_ir can break vcad_ecad_pcb.router.maze, while a change to vcad_ecad_pcb.router.maze can't break vcad_ir.
Position
Below the diagonal: vcad_ecad_pcb.router.maze uses a module listed above it, which is the healthy direction.
vcad_ecad_pcb.router.maze uses vcad_ecad_pcb.session, so a change to vcad_ecad_pcb.session can break vcad_ecad_pcb.router.maze, while a change to vcad_ecad_pcb.router.maze can't break vcad_ecad_pcb.session.
Position
Below the diagonal: vcad_ecad_pcb.router.maze uses a module listed above it, which is the healthy direction.
vcad_kernel uses vcad_kernel_primitives, so a change to vcad_kernel_primitives can break vcad_kernel, while a change to vcad_kernel can't break vcad_kernel_primitives.
Position
Below the diagonal: vcad_kernel uses a module listed above it, which is the healthy direction.
vcad_kernel uses vcad_kernel_tessellate, so a change to vcad_kernel_tessellate can break vcad_kernel, while a change to vcad_kernel can't break vcad_kernel_tessellate.
Position
Below the diagonal: vcad_kernel uses a module listed above it, which is the healthy direction.
vcad_kernel uses vcad_kernel_booleans.api, so a change to vcad_kernel_booleans.api can break vcad_kernel, while a change to vcad_kernel can't break vcad_kernel_booleans.api.
Position
Below the diagonal: vcad_kernel uses a module listed above it, which is the healthy direction.
vcad_eval.cavity_extract uses vcad_kernel_topo, so a change to vcad_kernel_topo can break vcad_eval.cavity_extract, while a change to vcad_eval.cavity_extract can't break vcad_kernel_topo.
Position
Below the diagonal: vcad_eval.cavity_extract uses a module listed above it, which is the healthy direction.
vcad_eval.cavity_extract uses vcad_ir, so a change to vcad_ir can break vcad_eval.cavity_extract, while a change to vcad_eval.cavity_extract can't break vcad_ir.
Position
Below the diagonal: vcad_eval.cavity_extract uses a module listed above it, which is the healthy direction.
vcad_eval.cavity_extract uses vcad_kernel_primitives, so a change to vcad_kernel_primitives can break vcad_eval.cavity_extract, while a change to vcad_eval.cavity_extract can't break vcad_kernel_primitives.
Position
Below the diagonal: vcad_eval.cavity_extract uses a module listed above it, which is the healthy direction.
vcad_eval.cavity_extract uses vcad_eval, so a change to vcad_eval can break vcad_eval.cavity_extract, while a change to vcad_eval.cavity_extract can't break vcad_eval.
Position
Below the diagonal: vcad_eval.cavity_extract uses a module listed above it, which is the healthy direction.
vcad_kernel_wasm uses vcad_crdt.types, so a change to vcad_crdt.types can break vcad_kernel_wasm, while a change to vcad_kernel_wasm can't break vcad_crdt.types.
Position
Below the diagonal: vcad_kernel_wasm uses a module listed above it, which is the healthy direction.
vcad_kernel_wasm uses vcad_receipt, so a change to vcad_receipt can break vcad_kernel_wasm, while a change to vcad_kernel_wasm can't break vcad_receipt.
Position
Below the diagonal: vcad_kernel_wasm uses a module listed above it, which is the healthy direction.
vcad_kernel_wasm uses vcad_kernel_drafting.dimension.render, so a change to vcad_kernel_drafting.dimension.render can break vcad_kernel_wasm, while a change to vcad_kernel_wasm can't break vcad_kernel_drafting.dimension.render.
Position
Below the diagonal: vcad_kernel_wasm uses a module listed above it, which is the healthy direction.
vcad_render uses vcad_kernel_tessellate, so a change to vcad_kernel_tessellate can break vcad_render, while a change to vcad_render can't break vcad_kernel_tessellate.
Position
Below the diagonal: vcad_render uses a module listed above it, which is the healthy direction.
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:2025 — Software Supply Chain Failures
132
High / Critical
A05:2025 — Injection
102
High / Critical
A07:2025 — Authentication Failures
6
High / Critical
Roadmap
Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1; Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
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 — 239
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 — 5383
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 237
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 83 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 83 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, 5814 of 5859 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 or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,742 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 452 test source file(s) (.rs, .swift) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and did not finish re-running within its tier budget — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in mecheval/harness/ (50 tests); vitest via `npm ci --ignore-scripts` in packages/app/ (76 tests); vitest via `npm ci --ignore-scripts` in packages/core/ (140 tests); vitest via `npm ci --ignore-scripts` in packages/engine/ (133 tests); vitest via `npm ci --ignore-scripts` in packages/ir/ (36 tests); vitest via `npm ci --ignore-scripts` in packages/mcp/ (1212 tests); vitest via `npm ci --ignore-scripts` in packages/training/ (66 tests); vitest via `npm ci --ignore-scripts` in packages/wasmosis/ (24 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (4 contributor(s) across 3290 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 3 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A filesystem error ended D28's config-credential walk (FileNotFoundException: Could not find file 'packages/core/src/CHANGELOG.json'.); configs after that point were not read for credential bindings.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `apple/VcadApp/Sources/VcadApp/AgentCore.swift`, `apple/VcadApp/Sources/VcadApp/AgentInstall.swift`, `apple/VcadApp/Sources/VcadApp/AgentViewerHTML.swift`, `apple/VcadApp/Sources/VcadApp/CNC.swift`, `apple/VcadApp/Sources/VcadApp/CNCCommands.swift`, … (+31 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 157 further occurrence(s) are not listed individually; the score already reflects all 197.
AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in packages/engine/src/index.ts, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The dev server exited, and its output does not match a cause we recognise. (rule: unrecognised-exit). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "vcad-kernel-wasm:dev: npm error command failed / vcad-kernel-wasm:dev: npm error command sh -c cargo watch -C ../.. -w crates -s 'VCAD_WASM_DEV=1 node packages/kernel-wasm/scripts/build.mjs' / vcad-kernel-wasm:dev: ERROR: command finished with error: command (<repo>/packages/kernel-wasm) /usr/local/bin/npm run dev exited (1) / vcad-kernel-wasm#dev: command (<repo>/packages/kernel-wasm) /usr/local/bin/npm run dev exited (1) / Tasks: 0 successful, 5 total / Cached: 0 cached, 5 total / Time: 626ms / Failed: vcad-kernel-wasm#dev / ERROR run failed: command exited (1)" No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "vcad-kernel-wasm:dev: npm error command failed / vcad-kernel-wasm:dev: npm error command sh -c cargo watch -C ../.. -w crates -s 'VCAD_WASM_DEV=1 node packages/kernel-wasm/scripts/build.mjs' / vcad-kernel-wasm:dev: ERROR: command finished with error: command (<repo>/packages/kernel-wasm) /usr/local/bin/npm run dev exited (1) / vcad-kernel-wasm#dev: command (<repo>/packages/kernel-wasm) /usr/local/bin/npm run dev exited (1) / Tasks: 0 successful, 5 total / Cached: 0 cached, 5 total / Time: 626ms / Failed: vcad-kernel-wasm#dev / ERROR run failed: command exited (1)" No runtime evidence was gathered.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P2 Observability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 27 further occurrence(s) are not listed individually; the score already reflects all 67.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 466 further occurrence(s) are not listed individually; the score already reflects all 506.
R11 Import Boundaries — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 373 further occurrence(s) are not listed individually; the score already reflects all 413.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 404 further occurrence(s) are not listed individually; the score already reflects all 444.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 55 further occurrence(s) are not listed individually; the score already reflects all 95.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 209 further occurrence(s) are not listed individually; the score already reflects all 249.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 60 further occurrence(s) are not listed individually; the score already reflects all 100.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 68 further occurrence(s) are not listed individually; the score already reflects all 108.
X17 Uncapped recursion over a caller-supplied document — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 10 further occurrence(s) are not listed individually; the score already reflects all 50.
X19 Unrestored process-global state — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X25 Inert configuration knob — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 17 further occurrence(s) are not listed individually; the score already reflects all 57.
X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 99 further occurrence(s) are not listed individually; the score already reflects all 139.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 611 further occurrence(s) are not listed individually; the score already reflects all 651.
X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 2 further occurrence(s) are not listed individually; the score already reflects all 42.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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 REDACTED, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
808 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SchematicCanvas.SchematicCanvas at 213. A further 55 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 vcad_ir::stroke_font::glyph_data at 55 — they are counted neither in the figure above nor in this dimension's score. 21 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: crates/vcad-ir/src/stroke_font.rs (vcad_ir::stroke_font::glyph_data at 55), crates/vcad-kernel-sheet/src/font.rs (vcad_kernel_sheet::font::glyph at 44), crates/vcad-eval/src/validate.rs (vcad_eval::validate::csg_op_name at 43), mecheval/graders/src/check.rs (CheckSpec::kind at 30), packages/engine/src/dependency-graph.ts (dependency-graph.getChildNodeIds at 27), and 16 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.
+ 464 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with SchematicCanvas.SchematicCanvas (cyclomatic 213), ViewportContent.ViewportContent (cyclomatic 199), document-store.useDocumentStore (cyclomatic 181). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 7 together lifts Cyclomatic Complexity from 3.1 to about 4.2/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
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.
+ 661 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 170 bodies over 60 down to 60 or less in Cognitive Complexity — start with vcad_kernel_booleans::classify::face_sample_point (cognitive 359), vcad_kernel_booleans::pipeline::brep_boolean (cognitive 298), vcad_kernel_booleans::pipeline::apply_splits_to_solid (cognitive 251). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 170 together lifts Cognitive Complexity from 2.0 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.4 / 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 387 FunctionTooLong finding(s) in God Classes — start with REDACTED (33), split.rs (11), auto.rs (8). — One of this dimension's main actionable groups (387 warning-level).
Resolve the 176 FileTooLong finding(s) in God Classes — start with REDACTED (12), ecad.ts (2), main.rs (2). — One of this dimension's main actionable groups (176 warning-level).
Resolve the 46 MethodTooLong finding(s) in God Classes — start with flow.rs (3), convert.rs (2), feature.rs (2). — One of this dimension's main actionable groups (46 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
1377 duplicated block group(s) detected. 6.1 % of the production lines (44,994 of 734,735) are in a reported copy. A further 528 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 7 of the 1905 are in trees this repository does not ship — vendored, example/demo, project-template, 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. Measured on part of this repository only: .ts (16% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 379 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 120 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with Editor.swift (19), REDACTED (10), split.rs (4). — One of this dimension's main actionable groups (120 warning-level).
Resolve the 116 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with REDACTED (15), Editor.swift (13), split.rs (5). — One of this dimension's main actionable groups (116 warning-level).
Resolve the 114 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with Editor.swift (24), REDACTED (9), Shell.swift (6). — One of this dimension's main actionable groups (114 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.7 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
116 production modules (Cargo+npm+SwiftPM), 0 dependency cycle(s), 5 unstable depended-on module(s). Read from the build's own module declarations; 27 module(s) off the main sequence, with abstractness counted on 108 of the 116 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: @vcad/ir · ×12
Unstable project vcad-atoms
Unstable project vcad-kernel-features
Unstable project vcad-kernel-fillet
Unstable project vcad-kernel-shell
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 1 Unstable project vcad-atoms finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project vcad-kernel-features finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with style.rs, su3.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 2 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
23 skipped (21 with a documented reason), 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1742 tests. Measured on the JavaScript/TypeScript suite only — at least 452 test source file(s) (.rs, .swift) went unread, so its test quality is unmeasured and is not in these counts.
Skipped test: preserves B-rep for exact mounting plate example structure · ×2packages/engine/src/__tests__/evaluate.test.ts:319
Resolve the 2 Skipped test finding(s) in Test Quality — start with evaluate.test.ts (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
1 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Outdated: sparkle
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 666 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 8 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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: apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift (72×83=5976); crates/vcad-eval/src/evaluate.rs (42×100=4200); packages/mcp/src/tools/ecad.ts (25×161=4025) Repeated repair below the complexity floor: crates/vcad-ffi/src/export.rs (11 of 12 changes were fixes); crates/vcad-app/src/agent.rs (9 of 16 changes were fixes); packages/mcp/src/tools/document-solids.ts (4 of 5 changes were fixes)
Resolve the 96 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (7), evaluate.rs (2), main.rs (2). — One of this dimension's main actionable groups (96 warning-level).
Resolve the 7 Repeated repair finding(s) in Churn × Complexity Hotspots — start with export.rs, agent.rs, document-solids.ts. — One of this dimension's main actionable groups (7 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.
6 deducted task-comment markers across 734735 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 6 TodoComment finding(s) in Explicit Debt — start with REDACTED (2), analyze.rs, revolve.rs. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 2 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
2 naming inconsistencies among 24 declarations measured against a convention their peers follow.
`baseURL` spells `URL` where 22 names in the project spell it `Url` · ×2packages/training/src/annotate.ts:108
What to do
Resolve the 2 `baseURL` spells `URL` where 22 names in the project spell it `Url` finding(s) in Naming Consistency — start with annotate.ts, infer.ts. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D22 · Internal API Consistency9.2 / 10Stronggated by 2 serious findings✓ Tool-verified
What it measures: Whether the internal API surface is consistent and coherent.
Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.
2 API inconsistencies among 250 exposed members measured against a convention their peers follow.
`DependencyGraph.getEvaluationOrder` returns an array (`T[]`) where its 3 siblings return a setpackages/engine/src/dependency-graph.ts:143
`Engine.simulateCavity` takes (optionsjson, paramsjson) where its 8 siblings take (paramsjson, optionsjson)packages/engine/src/index.ts:2795
What to do
Resolve the 1 `DependencyGraph.getEvaluationOrder` returns an array (`T[]`) where its… finding(s) in Internal API Consistency — start with dependency-graph.ts. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `Engine.simulateCavity` takes (optionsjson, paramsjson) where its 8… finding(s) in Internal API Consistency — start with index.ts. — 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 comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
10 of 118 build units (Cargo, Python, SwiftPM, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×10packages/app/package.json:1
What to do
Resolve the 10 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with package.json (5), Cargo.toml (3), Package.swift (2). — One of this dimension's main actionable groups (10 recommendation-level).
Detailed fixes: d26_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.
3 finding(s): 0 critical, 3 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 3 High secret finding(s) in Secrets (history) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
102 finding(s): 0 critical, 86 high, 13 medium, 1 low. 67 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) — `apple/VcadApp/Branding/make-icns.sh` (line 13), `apple/VcadApp/Sources/VcadApp/Editor.swift`, `apple/VcadApp/Sources/VcadApp/FrogClient.swift` (line 271), `apple/VcadApp/scripts/make-appcast.sh` (line 21, line 24), `apple/VcadApp/scripts/release.sh`, … (+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 6 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 15 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
No action in Static Analysis (SAST) — all 67 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 (67 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 60 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (55), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (60 issue-level).
Resolve the 11 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9), REDACTED, REDACTED. — One of this dimension's main actionable groups (11 issue-level).
Resolve the 2 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_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 1440 of the 1695 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 Boundary-crossing change coupling finding(s) in Change Coupling — start with ElectronicsWorkspace.swift, ElectronicsView.swift. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 8 Change coupling finding(s) in Change Coupling — start with validate.rs (2), vcode.rs, server.ts. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 4 Change-coupling hub finding(s) in Change Coupling — start with repl.rs, sheet_metal.rs, REDACTED. — One of this dimension's main actionable groups (4 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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 9 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives6.7 / 10Strong✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×2) — packages/app/src/components/RayTracedViewport.tsx:850, packages/app/src/components/ViewportContent.tsx:1523
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels4.6 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — packages/app/public/launch/index.html:447
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×19) — packages/app/src/components/AnalyzePanel.tsx:265, packages/app/src/components/AnalyzePanel.tsx:426, packages/app/src/components/CameraSettingsPanel.tsx:139, …
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×13) — packages/app/src/components/AnalyzePanel.tsx:285, packages/app/src/components/AnalyzePanel.tsx:311, packages/app/src/components/AnalyzePanel.tsx:441, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×5) — packages/app/src/components/CommandPalette.tsx:429, packages/app/src/components/ExportAllPage.tsx:87, packages/app/src/components/FeedbackModal.tsx:54, …
This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — packages/app/src/components/QuotePanel.tsx:209
This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. — packages/app/src/components/cam/CamSettings.tsx:25
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure6.4 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. — packages/app/index.html:5
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×5) — packages/app/public/launch/index.html:14, packages/app/public/splashscreen.html:2, packages/mcp/viewer-app/index.html:2, …
A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — packages/app/src/components/CompressedFieldOverlay.tsx:309
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×4) — packages/docs/src/app/gallery/page.tsx:89, packages/docs/src/app/guides/[...slug]/page.tsx:83, packages/docs/src/app/reference/[...slug]/page.tsx:83, …
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
This <div> announces itself as a role="separator" and is operated by mousedown, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — packages/app/src/components/AppShell.tsx:75
A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×5) — packages/app/src/components/DimensionOverlay.tsx:128, packages/app/src/components/DocumentPicker.tsx:122, packages/app/src/components/FeatureTree.tsx:913, …
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×17) — packages/app/src/components/DrawingView.tsx:707, packages/app/src/components/DrawingView.tsx:776, packages/app/src/components/MoleculeTree.tsx:38, …
This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — packages/app/src/components/ui/notifications/DecisionCard.tsx:44
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. — packages/mcp/viewer-app/main.ts:1302
The repo's own CSS styles .terminal with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — www/agents/index.html:33
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`.progress .bar` moves (`animation: slide 1.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/app/public/auth/popup.html:116
`.btn.primary` sets color: #ffffff on background-color: #f92672 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/auth/popup.html:158
`::selection` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/launch/index.html:75
`a:hover` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/launch/index.html:83
`a.hero-btn.primary` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/launch/index.html:115
`a.hero-btn:hover` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/launch/index.html:116
`.step-btn:hover` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/launch/index.html:139
`.deeper:hover .deeper-link` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/app/public/launch/index.html:271
`.bar::after` moves (`animation: slide 1.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/app/public/splashscreen.html:94
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×18) — packages/app/src/components/CommandPalette.tsx:429, packages/app/src/components/DimensionOverlay.tsx:111, packages/app/src/components/DocTitle.tsx:119, …
<button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×4) — packages/app/src/components/DocTitle.tsx:203, packages/app/src/components/DocTitle.tsx:235, packages/app/src/components/Header.tsx:471, …
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. — packages/app/src/components/FeatureTree.tsx:186
<textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — packages/app/src/components/FeedbackModal.tsx:54, packages/app/src/components/dialogs/TextDialog.tsx:58, packages/app/src/components/embroidery/EmbroideryPanel.tsx:164
<select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — packages/app/src/components/ParametersPanel.tsx:343, packages/app/src/components/PropertyPanel.tsx:519, packages/app/src/components/SceneInspector.tsx:107
<div> moves — its `animate-[splash-slide_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — packages/app/src/components/Splash.tsx:132
<span> moves — its inline style sets `animation: vcad-pulse ${pulseDur.toFixed(2)}s cubic-bezier(0.4, 0, 0.6, 1) infinite` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — packages/app/src/components/footer/KernelPulseChip.tsx:74
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
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.
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.
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 in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of 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.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`push_user_message` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/vcad-cli/src/chat_session.rs:31
`drain_chat_events` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/vcad-cli/src/chat_session.rs:41
`init` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/vcad-i18n/src/lib.rs:15
`write_layer` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/vcad-kernel-sheet/src/dxf.rs:207
`write_line` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/vcad-kernel-sheet/src/dxf.rs:233
`tune_filter` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/vcad-kernel-wasm/src/circuit_sim.rs:790
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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.
2 ADR-shaped document(s) detected by content — `docs/design/stdlib-and-social.md`, `docs/plans/timeline-editing.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
What to do
Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
packages/training/README.md links to `../../docs/features/vcode.md`, but `docs/features/vcode.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/training/README.md:253
packages/training/README.md links to `../../docs/features/text-to-cad.md`, but `docs/features/text-to-cad.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/training/README.md:254
What to do
Reconcile the README with reality: packages/training/README.md links to `../../docs/features/vcode.md`, but `docs/features/vcode.md` does not exist; packages/training/README.md links to `../../docs/features/text-to-cad.md`, but `docs/features/text-to-cad.md` does not exist.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 7/20 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/vcad-kernel-constraints`, `crates/vcad-mcp`, `crates/vcad-render`, `crates/vcad-torture` and 8 more.
`packages/app/src/lib/backfill.ts` reports through `console.*` at line 61 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/backfill.ts:61
`packages/app/src/lib/backfill.ts` reports through `console.*` at line 90 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/backfill.ts:90
`packages/app/src/lib/backfill.ts` reports through `console.*` at line 96 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/backfill.ts:96
`packages/app/src/lib/backfill.ts` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/backfill.ts:103
`packages/app/src/lib/backfill.ts` reports through `console.*` at line 155 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/backfill.ts:155
`packages/app/src/lib/browser-inference.ts` reports through `console.*` at line 369 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/browser-inference.ts:369
`packages/app/src/lib/crypto-polyfill.ts` reports through `console.*` at line 16 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/crypto-polyfill.ts:16
`packages/app/src/lib/open-document.ts` reports through `console.*` at line 27 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/open-document.ts:27
`packages/app/src/lib/save-load.ts` reports through `console.*` at line 47 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/save-load.ts:47
`packages/app/src/lib/urdf-meshes.ts` reports through `console.*` at line 297 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/lib/urdf-meshes.ts:297
`packages/app/src/hooks/useAppCommands.ts` reports through `console.*` at line 514 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useAppCommands.ts:514
`packages/app/src/hooks/useAutoSave.ts` reports through `console.*` at line 38 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useAutoSave.ts:38
`packages/app/src/hooks/useAutoSave.ts` reports through `console.*` at line 88 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useAutoSave.ts:88
`packages/app/src/hooks/useCircuitSim.ts` reports through `console.*` at line 70 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useCircuitSim.ts:70
`packages/app/src/hooks/useKeybindingPrefs.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useKeybindingPrefs.ts:49
`packages/app/src/hooks/useKeybindingPrefs.ts` reports through `console.*` at line 54 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useKeybindingPrefs.ts:54
`packages/app/src/hooks/useKeybindingPrefs.ts` reports through `console.*` at line 68 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useKeybindingPrefs.ts:68
`packages/app/src/hooks/useOperationPreview.ts` reports through `console.*` at line 147 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/useOperationPreview.ts:147
`packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 53 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/usePhysicsSimulation.ts:53
`packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 126 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/usePhysicsSimulation.ts:126
`packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 130 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/usePhysicsSimulation.ts:130
`packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 257 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/hooks/usePhysicsSimulation.ts:257
`packages/app/src/components/CommandPalette.tsx` reports through `console.*` at line 233 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/CommandPalette.tsx:233
`packages/app/src/components/CommandPalette.tsx` reports through `console.*` at line 304 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/CommandPalette.tsx:304
`packages/app/src/components/DrawingToolbar.tsx` reports through `console.*` at line 74 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/DrawingToolbar.tsx:74
`packages/app/src/components/PostProcessingBoundary.tsx` reports through `console.*` at line 27 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/PostProcessingBoundary.tsx:27
`packages/app/src/components/SceneMesh.tsx` reports through `console.*` at line 717 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/SceneMesh.tsx:717
`packages/app/src/components/SceneMesh.tsx` reports through `console.*` at line 831 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/SceneMesh.tsx:831
`packages/app/src/components/SheetMetalView.tsx` reports through `console.*` at line 57 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/SheetMetalView.tsx:57
`packages/app/src/components/SheetMetalView.tsx` reports through `console.*` at line 70 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/SheetMetalView.tsx:70
`packages/app/src/components/print/PrintPanel.tsx` reports through `console.*` at line 160 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/print/PrintPanel.tsx:160
`packages/app/src/components/print/PrintPanel.tsx` reports through `console.*` at line 184 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/print/PrintPanel.tsx:184
`packages/app/src/components/print/PrintPanel.tsx` reports through `console.*` at line 233 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/print/PrintPanel.tsx:233
`packages/app/src/components/print/PrintPreview.tsx` reports through `console.*` at line 95 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/print/PrintPreview.tsx:95
`packages/app/src/components/print/PrinterSelect.tsx` reports through `console.*` at line 94 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/print/PrinterSelect.tsx:94
`packages/app/src/components/embroidery/EmbroideryPanel.tsx` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/embroidery/EmbroideryPanel.tsx:103
`packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx` reports through `console.*` at line 128 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx:128
`packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx` reports through `console.*` at line 136 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx:136
`packages/app/src/components/cam/CamPanel.tsx` reports through `console.*` at line 217 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/app/src/components/cam/CamPanel.tsx:217
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
`REDACTED` schedules updates, but no `package-ecosystem` entry covers `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:12
What to do
Dependabot is configured but does not watch `pip` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`writeFileSync` in `callback to createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:78
`fs.readFileSync` in `loadAndInit` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/engine/src/wasm-singleton.ts:191
`readFileSync` in `loadWasm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/resvg-loader.ts:33
`writeFileSync` in `saveDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — packages/mcp/src/tools/session.ts:488, packages/mcp/src/tools/session.ts:498
`readFileSync` in `loadDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/session.ts:632
`readFileSync` in `loadDocumentFromPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/session.ts:728
`existsSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/verify.ts:188
`mkdtempSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/verify.ts:209
`writeFileSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/verify.ts:212
`rmSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/mcp/src/tools/verify.ts:263
`fs.mkdirSync` in `generateImageIRPairs` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/training/src/multimodal.ts:81
`fs.writeFileSync` in `generateImageIRPairs` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/training/src/multimodal.ts:124
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety9.5 / 10Exemplary✓ 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.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
45 duplicated blocks under packages/app/src/ have copies in at least two of the sibling directories components, hooks, lib, stores — 19 of them are reported below, and 26 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 45 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 45 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 45 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/app/src/components/SceneMesh.tsx:169
36 duplicated blocks under packages/ have copies in at least two of the sibling directories app, core, engine, ir, mcp, training (+1 more sibling(s) not listed) — 21 of them are reported below, and 15 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 36 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 36 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 36 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/core/src/commands/executors.ts:530
21 of the duplicated blocks reported below have copies in at least two of the sibling directories apple, mecheval, packages, www under the repository root. That concentration is one structural fact, not 21 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 21 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/app/public/launch/launch.js:99
15 duplicated blocks under packages/app/src/components/ have copies in at least two of the sibling directories cam, dialogs, electronics, embroidery, footer, materials (+2 more sibling(s) not listed) — 7 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 15 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 15 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 15 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/app/src/components/dialogs/StitchDialog.tsx:79
packages/app/src/components/materials/InstanceMaterialSelector.tsx:6 · packages/app/src/components/materials/MaterialSelector.tsx:6 — these 2 files are line-for-line copies of one another — 163 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — packages/app/src/components/materials/InstanceMaterialSelector.tsx:6
packages/app/src/components/shadcn/dropdown-menu.tsx:9 · packages/app/src/components/shadcn/select.tsx:9 — the two spans are one implementation copied and then locally edited — 504 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/shadcn/dropdown-menu.tsx:9
mecheval/harness/src/solvers/claude-mcp.ts:367 · mecheval/harness/src/solvers/gateway-mcp.ts:145 — the two spans are one implementation copied and then locally edited — 473 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — mecheval/harness/src/solvers/claude-mcp.ts:367
packages/app/src/components/ui/toolbar.tsx:131 · packages/app/src/components/ui/toolbar.tsx:253 — the two spans are one implementation copied and then locally edited — 448 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/ui/toolbar.tsx:131
mecheval/harness/src/solvers/gateway-direct.ts:56 · mecheval/harness/src/solvers/wafer-direct.ts:40 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — mecheval/harness/src/solvers/gateway-direct.ts:56
packages/app/public/launch/launch.js:99 · www/public/kit/gallery.js:211 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/app/public/launch/launch.js:99
packages/app/src/components/StatusBar.tsx:310 · packages/app/src/components/StatusBar.tsx:393 — the two spans are one implementation copied and then locally edited — 214 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/StatusBar.tsx:310
packages/training/src/multimodal.ts:81 · packages/training/src/multimodal.ts:202 — the two spans are one implementation copied and then locally edited — 291 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/training/src/multimodal.ts:81
packages/app/src/components/ui/notifications/ActionResultCard.tsx:8 · packages/app/src/components/ui/notifications/WarningCard.tsx:8 — the two spans are one implementation copied and then locally edited — 272 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/ui/notifications/ActionResultCard.tsx:8
packages/app/public/launch/launch.js:221 · www/public/kit/gallery.js:333 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/app/public/launch/launch.js:221
packages/training/src/generators/array.ts:113 · packages/training/src/generators/funnel.ts:101 — the two spans are one implementation copied and then locally edited — 326 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/training/src/generators/array.ts:113
packages/app/public/launch/launch.js:373 · www/public/kit/gallery.js:546 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/app/public/launch/launch.js:373
packages/training/src/generators/radial.ts:170 · packages/training/src/generators/scaled.ts:149 — the two spans are one implementation copied and then locally edited — 413 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/training/src/generators/radial.ts:170
packages/app/src/components/dialogs/FilletChamferDialog.tsx:17 · packages/app/src/components/dialogs/ShellDialog.tsx:15 — the two spans are one implementation copied and then locally edited — 243 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/dialogs/FilletChamferDialog.tsx:17
packages/app/src/components/cam/OperationList.tsx:479 · packages/app/src/components/cam/ToolLibrary.tsx:95 — the two spans are one implementation copied and then locally edited — 235 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/cam/OperationList.tsx:479
packages/app/src/components/dialogs/MirrorDialog.tsx:21 · packages/app/src/components/dialogs/PatternDialog.tsx:29 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/dialogs/MirrorDialog.tsx:21
packages/core/src/commands/executors.ts:530 · packages/mcp/src/tools/parts.ts:117 — the two spans are one implementation copied and then locally edited — 376 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/commands/executors.ts:530
packages/app/public/launch/launch.js:426 · www/public/kit/gallery.js:599 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/app/public/launch/launch.js:426
mecheval/harness/src/solvers/claude-mcp.ts:314 · mecheval/harness/src/solvers/gateway-mcp.ts:104 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — mecheval/harness/src/solvers/claude-mcp.ts:314
packages/app/src/components/SceneMesh.tsx:169 · packages/app/src/lib/sub-feature-geometry.ts:59 — the two spans are one implementation copied and then locally edited — 398 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/SceneMesh.tsx:169
packages/training/src/generators/hollow.ts:134 · packages/training/src/generators/scaled.ts:143 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/training/src/generators/hollow.ts:134
packages/engine/src/index.ts:3040 · packages/engine/src/index.ts:3077 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/engine/src/index.ts:3040
packages/mcp/src/tools/physics.ts:73 · packages/mcp/src/tools/structure.ts:150 · packages/mcp/src/tools/topopt.ts:79 — the 3 copies are spread across 3 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — packages/mcp/src/tools/physics.ts:73
packages/app/src/components/FeatureTree.tsx:426 · packages/app/src/components/InlineProperties.tsx:8 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/app/src/components/FeatureTree.tsx:426
packages/training/src/generators/ball.ts:121 · packages/training/src/generators/turned.ts:136 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/training/src/generators/ball.ts:121
packages/app/public/launch/launch.js:201 · www/public/kit/gallery.js:313 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/app/public/launch/launch.js:201
apple/VcadApp/scripts/vcad-app-discovery.mjs:55 · packages/mcp/src/app-discovery.ts:70 — the two spans are one implementation copied and then locally edited — 278 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apple/VcadApp/scripts/vcad-app-discovery.mjs:55
packages/app/public/launch/launch.js:481 · www/public/kit/gallery.js:666 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/app/public/launch/launch.js:481
packages/app/src/components/PropertyPanel.tsx:1085 · packages/app/src/components/PropertyPanel.tsx:1271 — 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. — packages/app/src/components/PropertyPanel.tsx:1085
packages/app/src/components/StatusBar.tsx:331 · packages/app/src/components/footer/RaytraceChip.tsx:140 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/app/src/components/StatusBar.tsx:331
packages/app/src/components/cam/CamSettings.tsx:71 · packages/app/src/components/cam/OperationList.tsx:258 — the two spans are one implementation copied and then locally edited — 183 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/components/cam/CamSettings.tsx:71
packages/app/src/components/ui/notifications/Toast.tsx:50 · packages/app/src/components/ui/notifications/WarningCard.tsx:61 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/app/src/components/ui/notifications/Toast.tsx:50
packages/mcp/src/tools/import-pcb.ts:64 · packages/mcp/src/tools/import-pcb.ts:97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/mcp/src/tools/import-pcb.ts:64
packages/training/src/generators/clip.ts:132 · packages/training/src/generators/scaled.ts:148 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/training/src/generators/clip.ts:132
mecheval/harness/src/solvers/claude-direct.ts:192 · mecheval/harness/src/solvers/gateway-direct.ts:97 · mecheval/harness/src/solvers/openai-direct.ts:115 · mecheval/harness/src/solvers/wafer-direct.ts:81 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — mecheval/harness/src/solvers/claude-direct.ts:192
packages/engine/src/evaluate.ts:73 · packages/engine/src/scene-convert.ts:24 — the two spans are one implementation copied and then locally edited — 243 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/engine/src/evaluate.ts:73
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 · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
packages/app/public/launch/hero-worker.js:4 reaches into another package with a relative path (./kernel/vcad_kernel_wasm.js) — import the package by name instead. — packages/app/public/launch/hero-worker.js:4
packages/app/src/components/AboutModal.tsx:2 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:2
packages/app/src/components/AboutModal.tsx:3 imports @phosphor-icons/react/dist/ssr/Cube, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:3
packages/app/src/components/AboutModal.tsx:4 imports @phosphor-icons/react/dist/ssr/PencilSimple, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:4
packages/app/src/components/AboutModal.tsx:5 imports @phosphor-icons/react/dist/ssr/FolderOpen, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:5
packages/app/src/components/AboutModal.tsx:6 imports @phosphor-icons/react/dist/ssr/Play, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:6
packages/app/src/components/AboutModal.tsx:7 imports @phosphor-icons/react/dist/ssr/GithubLogo, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:7
packages/app/src/components/AboutModal.tsx:8 imports @phosphor-icons/react/dist/ssr/Book, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:8
packages/app/src/components/AboutModal.tsx:9 imports @phosphor-icons/react/dist/ssr/ChatCircle, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AboutModal.tsx:9
packages/app/src/components/AnalyzePanel.tsx:10 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnalyzePanel.tsx:10
packages/app/src/components/AnalyzePanel.tsx:11 imports @phosphor-icons/react/dist/ssr/Play, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnalyzePanel.tsx:11
packages/app/src/components/AnalyzePanel.tsx:12 imports @phosphor-icons/react/dist/ssr/Spinner, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnalyzePanel.tsx:12
packages/app/src/components/AnalyzePanel.tsx:13 imports @phosphor-icons/react/dist/ssr/Trash, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnalyzePanel.tsx:13
packages/app/src/components/AnalyzePanel.tsx:14 imports @phosphor-icons/react/dist/ssr/Plus, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnalyzePanel.tsx:14
packages/app/src/components/AnimationTimeline.tsx:11 imports @phosphor-icons/react/dist/ssr/Pause, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnimationTimeline.tsx:11
packages/app/src/components/AnimationTimeline.tsx:12 imports @phosphor-icons/react/dist/ssr/Play, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnimationTimeline.tsx:12
packages/app/src/components/AnimationTimeline.tsx:13 imports @phosphor-icons/react/dist/ssr/Repeat, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnimationTimeline.tsx:13
packages/app/src/components/AnimationTimeline.tsx:14 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnimationTimeline.tsx:14
packages/app/src/components/AnimationTimeline.tsx:15 imports @phosphor-icons/react/dist/ssr/FilmStrip, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/AnimationTimeline.tsx:15
packages/app/src/components/CommandPalette.tsx:4 imports @phosphor-icons/react/dist/ssr/Cube, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:4
packages/app/src/components/CommandPalette.tsx:5 imports @phosphor-icons/react/dist/ssr/Cylinder, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:5
packages/app/src/components/CommandPalette.tsx:6 imports @phosphor-icons/react/dist/ssr/Globe, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:6
packages/app/src/components/CommandPalette.tsx:7 imports @phosphor-icons/react/dist/ssr/ArrowsOutCardinal, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:7
packages/app/src/components/CommandPalette.tsx:8 imports @phosphor-icons/react/dist/ssr/ArrowClockwise, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:8
packages/app/src/components/CommandPalette.tsx:9 imports @phosphor-icons/react/dist/ssr/ArrowsOut, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:9
packages/app/src/components/CommandPalette.tsx:10 imports @phosphor-icons/react/dist/ssr/ArrowCounterClockwise, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:10
packages/app/src/components/CommandPalette.tsx:11 imports @phosphor-icons/react/dist/ssr/Unite, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:11
packages/app/src/components/CommandPalette.tsx:12 imports @phosphor-icons/react/dist/ssr/Subtract, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:12
packages/app/src/components/CommandPalette.tsx:13 imports @phosphor-icons/react/dist/ssr/Intersect, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:13
packages/app/src/components/CommandPalette.tsx:14 imports @phosphor-icons/react/dist/ssr/FloppyDisk, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:14
packages/app/src/components/CommandPalette.tsx:15 imports @phosphor-icons/react/dist/ssr/FolderOpen, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:15
packages/app/src/components/CommandPalette.tsx:16 imports @phosphor-icons/react/dist/ssr/Export, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:16
packages/app/src/components/CommandPalette.tsx:17 imports @phosphor-icons/react/dist/ssr/GridFour, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:17
packages/app/src/components/CommandPalette.tsx:18 imports @phosphor-icons/react/dist/ssr/CubeTransparent, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:18
packages/app/src/components/CommandPalette.tsx:19 imports @phosphor-icons/react/dist/ssr/SidebarSimple, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:19
packages/app/src/components/CommandPalette.tsx:20 imports @phosphor-icons/react/dist/ssr/Sun, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:20
packages/app/src/components/CommandPalette.tsx:21 imports @phosphor-icons/react/dist/ssr/Info, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:21
packages/app/src/components/CommandPalette.tsx:22 imports @phosphor-icons/react/dist/ssr/Trash, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:22
packages/app/src/components/CommandPalette.tsx:23 imports @phosphor-icons/react/dist/ssr/Copy, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:23
packages/app/src/components/CommandPalette.tsx:24 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/app/src/components/CommandPalette.tsx:24
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
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.
handleKeyDown has cyclomatic complexity 163 and cognitive complexity 197; 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. — packages/app/src/hooks/useKeyboardShortcuts.ts:17
routeNets has cyclomatic complexity 145 and cognitive complexity 233; 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. — packages/mcp/src/tools/ecad.ts:3811
addMotorWinding has cyclomatic complexity 129 and cognitive complexity 231; 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. — packages/mcp/src/tools/ecad.ts:11593
renderView has cyclomatic complexity 107 and cognitive complexity 115; 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. — packages/mcp/src/tools/render.ts:376
fixDrc has cyclomatic complexity 85 and cognitive complexity 166; 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. — packages/mcp/src/tools/ecad.ts:15028
evaluateOp has cyclomatic complexity 81 and cognitive complexity 56; 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. — packages/engine/src/evaluate.ts:715
generateSyntheticDescription has cyclomatic complexity 76 and cognitive complexity 47; 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. — packages/training/src/annotate.ts:237
(anonymous) has cyclomatic complexity 75 and cognitive complexity 65; 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. — packages/app/src/hooks/useToolDefinitions.tsx:281
quoteManufacturing has cyclomatic complexity 66 and cognitive complexity 87; 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. — packages/mcp/src/tools/order.ts:204
layoutLint has cyclomatic complexity 65 and cognitive complexity 113; 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. — packages/mcp/src/tools/ecad.ts:5391
addCoil has cyclomatic complexity 62 and cognitive complexity 91; 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. — packages/mcp/src/tools/ecad.ts:7744
exportVideo has cyclomatic complexity 62 and cognitive complexity 86; 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. — packages/mcp/src/tools/animate.ts:1034
handleModernRequest has cyclomatic complexity 61 and cognitive complexity 72; 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. — packages/mcp/src/protocol-2026.ts:543
check has cyclomatic complexity 61 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. — packages/mcp/src/tools/part-stock.ts:384
placeComponents has cyclomatic complexity 60 and cognitive complexity 78; 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. — packages/mcp/src/tools/ecad.ts:2874
checkClearance has cyclomatic complexity 54 and cognitive complexity 57; 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. — packages/mcp/src/tools/clearance.ts:626
calcMotor has cyclomatic complexity 53 and cognitive complexity 89; 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. — packages/mcp/src/tools/ecad.ts:12513
(anonymous) has cyclomatic complexity 53 and cognitive complexity 70; 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. — packages/mcp/src/server.ts:1405
recordSimulation has cyclomatic complexity 53 and cognitive complexity 70; 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. — packages/mcp/src/tools/record.ts:168
parseGeometryOpcode has cyclomatic complexity 53 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ir/src/index.ts:1481
sizeImpedance has cyclomatic complexity 51 and cognitive complexity 54; 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. — packages/mcp/src/tools/ecad.ts:7129
ViewportContent has cyclomatic complexity 47 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 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. — packages/app/src/components/ViewportContent.tsx:366
verifyReceipt has cyclomatic complexity 46 and cognitive complexity 51; 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. — packages/mcp/src/tools/ecad.ts:14693
(anonymous) has cyclomatic complexity 45 and cognitive complexity 77; 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. — packages/app/src/components/electronics/pcb3d/PcbScene.tsx:84
SceneMesh has cyclomatic complexity 44 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 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. — packages/app/src/components/SceneMesh.tsx:496
buildReceipt has cyclomatic complexity 43 and cognitive complexity 60; 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. — packages/mcp/src/tools/ecad.ts:14504
deriveNets has cyclomatic complexity 42 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/mcp/src/tools/ecad.ts:525
addViaArray has cyclomatic complexity 42 and cognitive complexity 57; 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. — packages/mcp/src/tools/ecad.ts:11318
buildLine has cyclomatic complexity 41 and cognitive complexity 66; 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. — packages/mcp/src/tools/bom.ts:252
(anonymous) has cyclomatic complexity 41 and cognitive complexity 56; 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. — packages/app/src/components/xr/XRGestures.tsx:199
createCommandRegistry has cyclomatic complexity 41 and cognitive complexity 40; 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. — packages/core/src/commands.ts:180
parseRustSourceContentWithInference has cyclomatic complexity 40 and cognitive complexity 106; 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:535
(anonymous) has cyclomatic complexity 40 and cognitive complexity 66; 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. — packages/app/src/components/RayTracedViewport.tsx:91
formatSceneSettings has cyclomatic complexity 40 and cognitive complexity 64; 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. — packages/ir/src/index.ts:935
computeIntegrity has cyclomatic complexity 40 and cognitive complexity 50; 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. — packages/mcp/src/tools/integrity.ts:244
failureReason has cyclomatic complexity 39 and cognitive complexity 53; 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. — mecheval/harness/src/pass_k.ts:58
runMutationViaEngine has cyclomatic complexity 39 and cognitive complexity 46; 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. — packages/mcp/src/tools/registry-dispatch.ts:679
PropertyPanel has cyclomatic complexity 39 and cognitive complexity 37; 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. — packages/app/src/components/PropertyPanel.tsx:1540
TreeNode has cyclomatic complexity 38 and cognitive complexity 32; 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. — packages/app/src/components/FeatureTree.tsx:485
computeInterferenceAudit has cyclomatic complexity 37 and cognitive complexity 74; 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. — packages/mcp/src/tools/clearance.ts:482
Do you agree with this assessment?
R3 · Large Files3.6 / 10Weak✓ 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.
packages/mcp/src/tools/ecad.ts has 15389 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/ecad.ts:1
packages/engine/src/index.ts has 3010 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/engine/src/index.ts:1
mecheval/leaderboard/src/build.ts has 2470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mecheval/leaderboard/src/build.ts:1
packages/mcp/viewer-app/main.ts has 2321 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/viewer-app/main.ts:1
packages/core/src/stores/document-store.ts has 2150 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/stores/document-store.ts:1
packages/mcp/src/server.ts has 1953 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/server.ts:1
packages/app/src/components/ViewportContent.tsx has 1948 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/ViewportContent.tsx:1
packages/engine/src/ecad.ts has 1842 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/engine/src/ecad.ts:1
packages/app/src/components/PropertyPanel.tsx has 1682 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/PropertyPanel.tsx:1
packages/mcp/src/tools/render.ts has 1448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/render.ts:1
packages/ir/src/index.ts has 1426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ir/src/index.ts:1
packages/mcp/src/tools/animate.ts has 1389 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/animate.ts:1
packages/app/src/components/FeatureTree.tsx has 1223 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/FeatureTree.tsx:1
packages/app/src/components/electronics/SchematicCanvas.tsx has 1218 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/electronics/SchematicCanvas.tsx:1
packages/app/src/hooks/useToolDefinitions.tsx has 1158 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/hooks/useToolDefinitions.tsx:1
packages/engine/src/evaluate.ts has 1154 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/engine/src/evaluate.ts:1
packages/mcp/src/tools/clearance.ts has 1145 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/clearance.ts:1
packages/mcp/src/tools/gym.ts has 1141 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/gym.ts:1
packages/app/src/components/DrawingView.tsx has 1113 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/DrawingView.tsx:1
packages/mcp/src/protocol-2026.ts has 1104 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/protocol-2026.ts:1
packages/mcp/src/tools/claims-ledger.ts has 1092 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/claims-ledger.ts:1
packages/training/src/cli.ts has 1040 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/training/src/cli.ts:1
packages/app/src/components/SceneMesh.tsx has 1024 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/SceneMesh.tsx:1
packages/app/src/App.tsx has 997 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/App.tsx:1
packages/app/src/components/SketchPlane3D.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/SketchPlane3D.tsx:1
packages/mcp/src/tools/registry-dispatch.ts has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/registry-dispatch.ts:1
packages/engine/src/sheet-metal.ts has 895 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/engine/src/sheet-metal.ts:1
packages/mcp/src/tools/session.ts has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/session.ts:1
packages/core/src/commands.ts has 809 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/commands.ts:1
packages/app/src/components/RayTracedViewport.tsx has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/RayTracedViewport.tsx:1
packages/mcp/src/tools/sheet-metal.ts has 770 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/sheet-metal.ts:1
packages/mcp/src/tools/bom.ts has 755 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/bom.ts:1
packages/mcp/src/tools/part-stock.ts has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/part-stock.ts:1
packages/core/src/utils/save-load.ts has 723 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/utils/save-load.ts:1
packages/core/src/stores/sketch-store.ts has 722 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/stores/sketch-store.ts:1
packages/app/src/components/Header.tsx has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/Header.tsx:1
packages/mcp/src/tools/preview.ts has 689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/preview.ts:1
www/public/kit/gallery.js has 687 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — www/public/kit/gallery.js:1
packages/mcp/src/tools/parameters.ts has 655 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/mcp/src/tools/parameters.ts:1
packages/app/src/components/AnalyzePanel.tsx has 653 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/components/AnalyzePanel.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage5.7 / 10Adequate✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — mecheval/leaderboard/src/build.ts:1, packages/mcp/viewer-app/main.ts:1, packages/app/src/components/PropertyPanel.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
62 outdated package(s); JS/npm CVEs scored in D30
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
The package in `packages/docs` declares the lint script `lint` (`next lint`), but no step of this repository's CI runs it, by name, through another script, a Makefile target or a workspace runner, and no CI step runs the linter over the package itself. The rules it sets are enforced nowhere a pull request can fail. Run it in CI: a step that runs `npm run lint` in `packages/docs` (or the workspace's task runner). — packages/docs/package.json:10
Do you agree with this assessment?
R7 · Dead Code7.5 / 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 91 application, 42 tooling and 184 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (91 application, 42 tooling, 184 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 (×20) — packages/app/src/components/electronics/pcb3d/usePcbCamera.ts, packages/app/src/components/InlineProperties.tsx, packages/app/src/components/shadcn/dropdown-menu.tsx, …
no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/command.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/app/src/components/shadcn/dialog.tsx
no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/electronics/PcbFootprintGroup.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/app/src/components/electronics/PcbPadShape.tsx
no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/app/src/components/shadcn/dialog.tsx, packages/app/src/components/shadcn/input-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/app/src/components/shadcn/button.tsx
no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/button-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/app/src/components/shadcn/separator.tsx
no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/input-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — packages/app/src/components/shadcn/input.tsx, packages/app/src/components/shadcn/textarea.tsx
Nothing imports this binding — it is safe to review for removal. (×13) — mecheval/harness/src/solvers/claude-mcp.ts:559, REDACTED:70, packages/app/src/components/RayTracedViewport.tsx:867, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — mecheval/scripts/gen-pcb-task-refs.mjs:244, packages/core/src/stores/document-store.ts:1510, packages/mcp/src/__tests__/length-match.test.ts:34
Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json. — packages/app/src/components/TransformGizmo.tsx:11
Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×10) — packages/app/package.json:26, packages/app/package.json:32, packages/app/package.json:33, …
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. 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. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. 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. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.1 / 10Critical✓ Tool-verified
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. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`stableKey` is exported and takes `value: unknown` from its caller, and it calls itself at line 156 (`stableKey`) with a piece of `value` (and at line 160) — and nowhere in `stableKey` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stableKey` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/mcp/src/tools/document-solids.ts:156
`canonicalJson` is exported and takes `v: unknown` from its caller, and it calls itself at line 299 (`canonicalJson`) with a piece of `v` (and at line 304) — and nowhere in `canonicalJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonicalJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/mcp/src/tools/registry-dispatch.ts:299
`sameUnderSerdeDefaults` is exported and takes `a: unknown` from its caller, and it calls itself at line 805 (`sameUnderSerdeDefaults`) with a piece of `a` (and at line 810) — and nowhere in `sameUnderSerdeDefaults` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sameUnderSerdeDefaults` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/mcp/src/tools/registry-dispatch.ts:805
`canonicalJson` is exported, takes a document from its caller (line 27) and hands it to `sortKeys`, which calls itself at line 16 (`sortKeys`) with a piece of `v` (and at line 20) — and nowhere in `sortKeys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sortKeys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/mcp/src/fabricate/kerf/intent-hash.ts:16
`freeVars` is exported, takes a document from its caller (line 138) and hands it to `walk`, which calls itself at line 149 (`walk`) with a piece of `a` (and at line 150, line 153, line 156) — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/engine/src/expressions.ts:149
`mapsToObjects` is exported and takes `value: unknown` from its caller, and it calls itself at line 226 (`mapsToObjects`) with a piece of `value` (and at line 229, line 232) — and nowhere in `mapsToObjects` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `mapsToObjects` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/core/src/utils/save-load.ts:226
`translate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 98 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `translate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:98
`rotate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 103 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `rotate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:103
`scale` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 108 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `scale` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:108
`chamfer` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 114 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `chamfer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:114
`fillet` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 122 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `fillet` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:122
`shell` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 130 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `shell` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:130
`linear_pattern` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 141 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `linear_pattern` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:141
`circular_pattern` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 160 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `circular_pattern` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:160
`volume` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 205 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `volume` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-site-wasm/src/lib.rs:205
`try_from` is public and takes `w: &WireAst` from its caller, and it calls itself at line 120 with a piece of the document (and at line 121, line 129) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `try_from` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/expressions.rs:120
`mirror` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1221 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `mirror` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1221
`num_triangles` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 2062 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `num_triangles` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:2062
`bounding_box` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1979 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `bounding_box` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1979
`translate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1656 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `translate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1656
`rotate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1664 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `rotate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1664
`scale` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1672 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `scale` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1672
`chamfer` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1689 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `chamfer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1689
`edge_blend` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1727 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `edge_blend` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1727
`fillet` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1743 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `fillet` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1743
`shell` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1754 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `shell` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1754
`linear_pattern` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1800 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `linear_pattern` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1800
`circular_pattern` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1827 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `circular_pattern` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1827
`sweep_rotate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1857 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `sweep_rotate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1857
`is_empty` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1875 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_empty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1875
`volume` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1954 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `volume` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1954
`signed_volume` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1961 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `signed_volume` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1961
`is_inside_out` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1967 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_inside_out` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1967
`surface_area` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1973 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `surface_area` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1973
`clearance` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1989 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clearance` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:1989
`center_of_mass` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 2055 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `center_of_mass` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:2055
`to_step_buffer` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 2184 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `to_step_buffer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:2184
`can_export_step` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 2194 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `can_export_step` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-wasm/src/lib.rs:2194
`is_inside` is public and takes a `OctreeNode` as its receiver from its caller, and it calls itself at line 44 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_inside` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-stocksim/src/octree.rs:44
`sdf` is public and takes a `OctreeNode` as its receiver from its caller, and it calls itself at line 64 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `sdf` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/vcad-kernel-stocksim/src/octree.rs:64
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`transport` is never created by `DocumentEngineClient` — it is the constructor parameter `transport` (line 279), and its declared type `EngineTransport` is an interface — yet this class disposes it here (line 353). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — packages/engine/src/engine-host.ts:353
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 2/16 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`buildBoard` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — www/public/kit/gallery.js:656
`__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/kernel-wasm/vcad_kernel_wasm.js:11830
`fetchAndPrimeKernelWasm` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/bootstrap.ts:159
`loadCompressedField` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/compressed-field.ts:93
`loadFieldStack` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/compressed-field.ts:183
`discoverPrinters` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/print-relay.ts:51
`connectPrinter` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/print-relay.ts:58
`getPrinterStatus` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/print-relay.ts:75
`sendPrint` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/print-relay.ts:82
`controlPrinter` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/print-relay.ts:108
`fetchBuffer` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/lib/urdf-meshes.ts:28
`check` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/src/hooks/useAppUpdate.ts:50
`wake` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/app/public/launch/launch.js:473
`listen` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — apple/VcadApp/scripts/vcad-app-mcp.mjs:86
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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 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. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. 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, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture 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. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`Registry` accepts `config` from the caller and keeps it in `this.config` on line 40, where only it can read the value — but nothing ever reads `this.config`. Setting `config` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.config` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `config` from the accepted options so callers stop setting a knob that does nothing. — packages/wasmosis/src/registry.ts:40
`Expect.hash` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-app/src/parity.rs:46
`Commands::Export.strict_brep` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:118
`Commands::Route.blind_vias` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:137
`Commands::Route.only` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:155
`Commands::Route.escape` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:161
`Commands::Route.explain_pours` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:165
`Commands::ImportUrdf.relative_meshes` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:206
`Commands::Features.min_count` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:223
`Commands::Boolean.part_a` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:333
`Commands::Boolean.part_b` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:335
`Commands::Boolean.result_name` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:341
`Commands::Simulate.log_every` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:503
`Commands::Slice.smart` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:552
`Commands::Slice.explain` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:555
`Commands::Dfm.pack` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:577
`Commands::Check.allow_bridge` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:613
`Commands::Probe.quiet` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-cli/src/main.rs:698
`EvalCost.base_eval_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-eval/src/optimize.rs:553
`LegacyVcadFile.consumed_parts` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/file_io.rs:424
`LegacyVcadFile.next_part_num` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/file_io.rs:428
`LegacyVcadFile.loon_source` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/file_io.rs:430
`FillParams.fill_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:765
`FillParams.density_mm` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:769
`FillParams.underlay` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:771
`FillParams.max_stitch_length_mm` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:773
`MaterialDef.emissive_map_origin` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:1879
`MaterialDef.emissive_map_u` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:1889
`MaterialDef.emissive_map_v` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:1901
`PostProcessing.silhouette` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:2379
`Document.claims_ledger` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-ir/src/lib.rs:2719
`MdConfig.bond_r0` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-atoms/src/wasm.rs:39
`MdConfig.thermostat_tau` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `tau_fs`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-atoms/src/wasm.rs:47
`MeasurementContext.measured_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-calibration/src/lib.rs:172
`DfmIssue.explanation` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-dfm/src/issue.rs:72
`DfmIssue.edge_indices` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-dfm/src/issue.rs:77
`RenderedDimension.is_basic` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-drafting/src/dimension/render.rs:30
`DimensionStyle.dimension_line_offset` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-drafting/src/dimension/style.rs:27
`ProjectedView.view_direction` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-kernel-drafting/src/types.rs:302
`ClaimsLedger.schema` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/vcad-receipt/src/ledger.rs:236
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` 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. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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.
Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
`doc.instances.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `check_body_valid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — mecheval/graders/src/suite_c.rs:99
`serde_json::to_string_pretty(&blob)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — mecheval/graders/src/bin/grade.rs:49
`std::env::args().nth(1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — mecheval/graders/src/bin/inspect-topo.rs:10
`std::fs::read_to_string(&path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — mecheval/graders/src/bin/inspect-topo.rs:11
`rows.iter().find(|c|c.arrangement==arrangement)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `to_markdown` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/fidelity.rs:314
`serde_json::to_string(&result)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run_case` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:74
`std::env::current_exe()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:188
`results.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:221
`serde_json::to_string_pretty(&card)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — crates/vcad-torture/src/main.rs:238, crates/vcad-torture/src/main.rs:241
`std::fs::write(path,serde_json::to_string_pretty(&card).unwrap())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — crates/vcad-torture/src/main.rs:238, crates/vcad-torture/src/main.rs:242
`std::fs::OpenOptions::new().create(true).append(true).open(path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:250
`writeln!(f,"## Kernel torture track ({subset} subset)\n")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:251
`writeln!(f,"{}",card.to_markdown())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:252
`std::fs::read_to_string(path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:258
`serde_json::from_str(&std::fs::read_to_string(path).expect("read --baseline"))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-torture/src/main.rs:259
`ch.to_lowercase().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `to_snake_case` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:126
`field.ident.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:195
`prop.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:208
`schema["properties"].as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:229
`schema.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — REDACTED:234
`vcad_ir::materials::resolve_def("aluminum_6061",None)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `fallback_aluminium` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-sound/src/lib.rs:69
`SoundMaterial::from_resolved(&m)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `fallback_aluminium` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-sound/src/lib.rs:70
`rustls::ClientConfig::builder_with_provider(Arc::new(rustls::crypto::ring::default_provider(),)).with_safe_default_protocol_versions()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `printer_client_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-slicer-bambu/src/tls.rs:87
`rustls022::ClientConfig::builder_with_provider(Arc::new(rustls022::crypto::ring::default_provider(),)).with_safe_default_protocol_versions()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `mqtt_client_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-slicer-bambu/src/tls.rs:101
`remaining.iter().enumerate().min_by(|(_,&a),(_,&b)|{let dist_a=if let Some(p)=polygons[a].points.first(){(current_pos-*p).norm()}else{f64::MAX};let dist_b=if let Some(p)=polygons[b].points.first(){(current_pos-*p).norm()}else{f64::MAX};dist_a.partial_cmp(&dist_b).unwrap_or(std::cmp::Ordering::Equal)})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `optimize_polygon_order` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-slicer/src/path.rs:327
`remaining.iter().enumerate().min_by(|(_,&a),(_,&b)|{let dist_a=if let Some(p)=polylines[a].start(){(current_pos-*p).norm()}else{f64::MAX};let dist_b=if let Some(p)=polylines[b].start(){(current_pos-*p).norm()}else{f64::MAX};dist_a.partial_cmp(&dist_b).unwrap_or(std::cmp::Ordering::Equal)})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `optimize_polyline_order` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-slicer/src/path.rs:370
`chain.first()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `chain_segments` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — crates/vcad-slicer/src/slice.rs:210, crates/vcad-slicer/src/slice.rs:247
`chain.last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `chain_segments` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — crates/vcad-slicer/src/slice.rs:211, crates/vcad-slicer/src/slice.rs:247
`b.signed_area().abs().partial_cmp(&a.signed_area().abs())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `chain_segments` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-slicer/src/slice.rs:273
`std::thread::Builder::new().name("vcad-doc-eval".into()).stack_size(cfg.stack_size).spawn(move||evaluator(erx,esink,chord))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-runtime/src/lib.rs:495
`std::thread::Builder::new().name("vcad-doc-runtime".into()).stack_size(cfg.stack_size).spawn(move||run(Core::new(&cfg,etx),rx,thread_sink))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-runtime/src/lib.rs:501
`merged.last_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `merge_intervals` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-render/src/exact.rs:289
`(key(p.0),key(p.1)).partial_cmp(&(key(q.0),key(q.1)))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `chain_segments` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-render/src/lib.rs:2582
`pts.iter().max_by(|a,b|score(a).total_cmp(&score(b)))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `draw_annotations` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-render/src/lib.rs:4942
`cli.animate.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_animation` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-render/src/main.rs:805
`dest` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `render_sheet_one` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcad-render/src/main.rs:1020
What to do
Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 41 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.
AX1 Captive dependencies — 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
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — AX6 reached only 31% of this repository's production lines — rust (508,314 lines), c (966 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "vcad-kernel-wasm:dev: npm error command failed / vcad-kernel-wasm:dev: npm error command sh -c cargo watch -C ../.. -w crates -s 'VCAD_WASM_DEV=1 node packages/kernel-wasm/scripts/build.mjs' / vcad-kernel-wasm:dev: ERROR: command finished with error: command (<repo>/packages/kernel-wasm) /usr/local/bin/npm run dev exited (1) / vcad-kernel-wasm#dev: command (<repo>/packages/kernel-wasm) /usr/local/bin/npm run dev exited (1) / Tasks: 0 successful, 5 total / Cached: 0 cached, 5 total / Time: 626ms / Failed: vcad-kernel-wasm#dev / ERROR run failed: command exited (1)" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (vcad-runtime), 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"]`.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 36 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — mecheval/harness/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
DM1 Domain Modelling — applicable but not scored (4 signals for this style, 3 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); 76 value object(s); 2 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a Rust domain-layer crate (a .../domain/ clean-architecture layer); a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
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
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 — no outbound HTTP usage detected — no HTTP client call or construction in the JavaScript/TypeScript, Python, Rust, Swift source (service entry point: crates/vcad-cli/src/print_server.rs:38 (Router::new()))
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — X19 reached only 31% of this repository's production lines — rust (508,314 lines), c (966 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 24% of this repository's production lines — rust (508,314 lines), swift (57,902 lines), c (966 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — X3 reached only 31% of this repository's production lines — rust (508,314 lines), c (966 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
AC2 · Forms & labels· <input> without a programmatic label · ×20
<input> without a programmatic label packages/app/public/launch/index.html:447— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/AnalyzePanel.tsx:265— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/AnalyzePanel.tsx:426— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/CameraSettingsPanel.tsx:139— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/CommandPalette.tsx:429— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/app/src/components/CompressedFieldOverlay.tsx:286— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/DimensionOverlay.tsx:111— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/DocTitle.tsx:119— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/DocumentPicker.tsx:136— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/ExportAllPage.tsx:87— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/app/src/components/FeatureTree.tsx:452— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/InlineProperties.tsx:34— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/KeyboardPrefsPanel.tsx:131— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/app/src/components/PropertyPanel.tsx:1183— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/QuotePanel.tsx:321— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/app/src/components/SceneInspector.tsx:152— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/SceneInspector.tsx:165— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/SceneInspector.tsx:174— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/SceneMesh.tsx:1059— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/app/src/components/cam/CamSettings.tsx:26— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <button> with no accessible text · ×13
<button> with no accessible text packages/app/src/components/AnalyzePanel.tsx:285— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/AnalyzePanel.tsx:311— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/AnalyzePanel.tsx:441— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/DfmDrawer.tsx:312— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/DocumentPicker.tsx:176— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/DocumentPicker.tsx:188— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/PropertyPanel.tsx:1105— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/PropertyPanel.tsx:1291— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/PropertyPanel.tsx:1628— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/PropertyPanel.tsx:1681— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/QuotePanel.tsx:235— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/SceneInspector.tsx:135— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text packages/app/src/components/cam/CamPanel.tsx:250— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×13
Click handler on a non-interactive <div> packages/app/src/components/DimensionOverlay.tsx:128— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> packages/app/src/components/DocumentPicker.tsx:122— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> packages/app/src/components/FeatureTree.tsx:913— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> packages/app/src/components/FeatureTree.tsx:1011— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> packages/app/src/components/MoleculeTree.tsx:38— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/app/src/components/QuotePanel.tsx:209— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/app/src/components/cam/OperationList.tsx:505— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/app/src/components/cam/ToolLibrary.tsx:158— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/app/src/components/electronics/LayerPanel.tsx:29— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/app/src/components/electronics/LayerPanel.tsx:37— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/docs/src/components/Header.tsx:81— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/docs/src/components/Navigation.tsx:311— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/mcp/viewer-app/main.ts:1302— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC2 · Forms & labels· <select> without a programmatic label · ×4
<select> without a programmatic label packages/app/src/components/DfmDrawer.tsx:108— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label packages/app/src/components/DrawingToolbar.tsx:131— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label packages/app/src/components/PropertyPanel.tsx:519— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label packages/app/src/components/SceneInspector.tsx:107— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Click handler on a non-interactive <g> · ×3
Click handler on a non-interactive <g> packages/app/src/components/DrawingView.tsx:776— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <g> packages/app/src/components/electronics/SchematicCanvas.tsx:921— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <g> packages/app/src/components/electronics/SchematicCanvas.tsx:1023— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <svg> · ×2
Click handler on a non-interactive <svg> packages/app/src/components/DrawingView.tsx:707— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <svg> packages/app/src/components/electronics/SchematicCanvas.tsx:793— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <line> · ×2
Click handler on a non-interactive <line> packages/app/src/components/electronics/SchematicCanvas.tsx:836— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <line> packages/app/src/components/electronics/pcb3d/PcbRatsnest3D.tsx:68— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Boundary-crossing change coupling: ElectronicsWorkspace.swift ↔ REDACTED apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:1— `apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift` (context apple) and `REDACTED` (context crates) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `e10051f2` feat(native): net classes, zone stitching, teardrop view, auto-annotate; `0617d352` feat(native): symbol browser, footprint library save, sheet symbols, …; `ff43831d` feat(native): footprint and symbol editors, hierarchical sheets, pair… — run `git show` on any of them.
Boundary-crossing change coupling: ElectronicsView.swift ↔ REDACTED apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:1— `apple/VcadApp/Sources/VcadApp/ElectronicsView.swift` (context apple) and `REDACTED` (context crates) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `e10051f2` feat(native): net classes, zone stitching, teardrop view, auto-annotate; `0617d352` feat(native): symbol browser, footprint library save, sheet symbols, …; `ff43831d` feat(native): footprint and symbol editors, hierarchical sheets, pair… — run `git show` on any of them.
Unlisted import '@vcad/kernel-wasm' packages/core/src/stores/document-store.ts:1510— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@vcad/kernel-wasm' packages/mcp/src/__tests__/length-match.test.ts:34— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label packages/app/src/components/FeedbackModal.tsx:54— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels· Custom control with no accessible name on <div> · ×1
Custom control with no accessible name on <div> packages/app/src/components/QuotePanel.tsx:209— This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC2 · Forms & labels· <label> that labels no control · ×1
<label> that labels no control packages/app/src/components/cam/CamSettings.tsx:25— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
Viewport restricts zoom packages/app/index.html:5— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
AC4 · Keyboard semantics· Clickable role="separator" that no keyboard user can reach · ×1
Clickable role="separator" that no keyboard user can reach packages/app/src/components/AppShell.tsx:75— This <div> announces itself as a role="separator" and is operated by mousedown, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
AC4 · Keyboard semantics· Click handler on a non-interactive <li> · ×1
Click handler on a non-interactive <li> packages/app/src/components/electronics/CircuitAnalysisPanel.tsx:377— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×1
Click handler on a non-interactive <span> packages/app/src/components/electronics/EcadFeatureInspector.tsx:275— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics· Click handler on a non-interactive <text> · ×1
Click handler on a non-interactive <text> packages/app/src/components/electronics/SchematicCanvas.tsx:888— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×1
Hover-only interaction on <div> packages/app/src/components/ui/notifications/DecisionCard.tsx:44— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×1
Clickable element isn't keyboard-operable www/agents/index.html:33— The repo's own CSS styles .terminal with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Unlisted import '@modelcontextprotocol/sdk' mecheval/scripts/gen-pcb-task-refs.mjs:244— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
FunctionTooLong: vcad_kernel_wasm.__wbg_get_imports packages/kernel-wasm/vcad_kernel_wasm.js:9345— FunctionTooLong — __wbg_get_imports runs 1423 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1323 over it, 14.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_app::materializer::materialize_feature crates/vcad-app/src/materializer.rs:606— FunctionTooLong — vcad_app::materializer::materialize_feature runs 948 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 848 over it, 9.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: SchematicCanvas.SchematicCanvas packages/app/src/components/electronics/SchematicCanvas.tsx:230— FunctionTooLong — SchematicCanvas runs 828 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 728 over it, 8.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useToolDefinitions.useToolDefinitions packages/app/src/hooks/useToolDefinitions.tsx:162— FunctionTooLong — useToolDefinitions runs 816 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 716 over it, 8.16× 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: vcad_kernel_booleans::pipeline::brep_boolean crates/vcad-kernel-booleans/src/pipeline.rs:1283— FunctionTooLong — vcad_kernel_booleans::pipeline::brep_boolean runs 628 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 528 over it, 6.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_ir::to_loon::op_to_loon crates/vcad-ir/src/to_loon.rs:193— FunctionTooLong — vcad_ir::to_loon::op_to_loon runs 537 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 437 over it, 5.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.
FunctionTooLong: vcad_ecad_pcb::router::complete::route_window_complete_islands crates/vcad-ecad-pcb/src/router/complete.rs:434— FunctionTooLong — vcad_ecad_pcb::router::complete::route_window_complete_islands runs 534 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 434 over it, 5.34× 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: vcad_eval::evaluate::evaluate_op_timed crates/vcad-eval/src/evaluate.rs:1120— FunctionTooLong — vcad_eval::evaluate::evaluate_op_timed runs 531 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 431 over it, 5.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_ffi::drafting::compose crates/vcad-ffi/src/drafting.rs:464— FunctionTooLong — vcad_ffi::drafting::compose runs 524 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 424 over it, 5.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_kernel_booleans::classify::face_sample_point crates/vcad-kernel-booleans/src/classify.rs:101— FunctionTooLong — vcad_kernel_booleans::classify::face_sample_point runs 521 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 421 over it, 5.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_ecad_pcb::router::auto::route_all_once crates/vcad-ecad-pcb/src/router/auto.rs:485— FunctionTooLong — vcad_ecad_pcb::router::auto::route_all_once runs 520 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 420 over it, 5.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.
FunctionTooLong: commands.createCommandRegistry packages/core/src/commands.ts:180— FunctionTooLong — createCommandRegistry runs 497 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
FunctionTooLong: vcad_ecad_pcb::router::flow::realize::realize_wires crates/vcad-ecad-pcb/src/router/flow/realize.rs:300— FunctionTooLong — vcad_ecad_pcb::router::flow::realize::realize_wires 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.
FunctionTooLong: vcad_ecad_pcb::router::pair::try_route_pair_reason crates/vcad-ecad-pcb/src/router/pair.rs:278— FunctionTooLong — vcad_ecad_pcb::router::pair::try_route_pair_reason 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.
FunctionTooLong: vcad_eval::evaluate::evaluate_inner crates/vcad-eval/src/evaluate.rs:131— FunctionTooLong — vcad_eval::evaluate::evaluate_inner runs 436 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 336 over it, 4.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.
FunctionTooLong: vcad_ecad_pcb::router::descent::descend_board_inner crates/vcad-ecad-pcb/src/router/descent.rs:915— FunctionTooLong — vcad_ecad_pcb::router::descent::descend_board_inner runs 420 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 320 over it, 4.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.
FunctionTooLong: sketch-store.useSketchStore packages/core/src/stores/sketch-store.ts:178— FunctionTooLong — useSketchStore runs 418 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 318 over it, 4.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_eval::cavity_extract::extract_cavity crates/vcad-eval/src/cavity_extract.rs:687— FunctionTooLong — vcad_eval::cavity_extract::extract_cavity runs 408 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 308 over it, 4.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: vcad_eval::antenna_extract::extract_antenna_spec crates/vcad-eval/src/antenna_extract.rs:338— FunctionTooLong — vcad_eval::antenna_extract::extract_antenna_spec runs 398 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 298 over it, 3.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.
FunctionTooLong: vcad::route_file crates/vcad-cli/src/main.rs:1736— FunctionTooLong — vcad::route_file 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: vcad_render::render_svg_impl crates/vcad-render/src/lib.rs:3009— FunctionTooLong — vcad_render::render_svg_impl runs 385 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 285 over it, 3.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.
FunctionTooLong: vcad::run_command crates/vcad-cli/src/main.rs:827— FunctionTooLong — vcad::run_command runs 379 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 279 over it, 3.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: CommandPalette.CommandPalette packages/app/src/components/CommandPalette.tsx:141— FunctionTooLong — CommandPalette runs 377 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 277 over it, 3.77× 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: PrintPanel.PrintPanel packages/app/src/components/print/PrintPanel.tsx:50— FunctionTooLong — PrintPanel runs 366 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: hero-engine.startHeroEngine www/src/hero-engine.js:16— FunctionTooLong — startHeroEngine runs 366 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: tools/ecad.ts packages/mcp/src/tools/ecad.ts— FileTooLong — 10824 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10324 over it, 21.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED crates/vcad-kernel-wasm/src/lib.rs— FileTooLong — 6831 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 6331 over it, 13.66× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: kernel-wasm/vcad_kernel_wasm.js packages/kernel-wasm/vcad_kernel_wasm.js— FileTooLong — 5762 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5262 over it, 11.52× 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 crates/vcad-kernel-tessellate/src/lib.rs— FileTooLong — 5481 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 79 free functions. The bar is 500 significant lines; this is 4981 over it, 10.96× 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/split.rs crates/vcad-kernel-booleans/src/split.rs— FileTooLong — 4176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 70 free functions. The bar is 500 significant lines; this is 3676 over it, 8.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: src/main.rs crates/vcad-cli/src/main.rs— FileTooLong — 3448 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 2948 over it, 6.90× 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 crates/vcad-render/src/lib.rs— FileTooLong — 3338 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 64 free functions. The bar is 500 significant lines; this is 2838 over it, 6.68× 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: router/auto.rs crates/vcad-ecad-pcb/src/router/auto.rs— FileTooLong — 3165 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 63 free functions. The bar is 500 significant lines; this is 2665 over it, 6.33× 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: VcadApp/Editor.swift apple/VcadApp/Sources/VcadApp/Editor.swift— FileTooLong — 3123 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: EditorModel (292-4788). The bar is 500 significant lines; this is 2623 over it, 6.25× 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: Shared/Editor.swift apple/VcadVision/Sources/VcadVision/Shared/Editor.swift— FileTooLong — 3123 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: EditorModel (292-4788). The bar is 500 significant lines; this is 2623 over it, 6.25× 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/evaluate.rs crates/vcad-eval/src/evaluate.rs— FileTooLong — 2514 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 2014 over it, 5.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/convert.rs crates/vcad-loon/src/convert.rs— FileTooLong — 2232 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 1732 over it, 4.46× 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/drc.rs crates/vcad-ecad-pcb/src/drc.rs— FileTooLong — 2186 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 82 free functions. The bar is 500 significant lines; this is 1686 over it, 4.37× 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/build.ts mecheval/leaderboard/src/build.ts— FileTooLong — 2006 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1506 over it, 4.01× 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/index.ts packages/engine/src/index.ts— FileTooLong — 1945 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1445 over it, 3.89× 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: VcadApp/ReleasedDesktop.swift apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift— FileTooLong — 1940 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1440 over it, 3.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/vcode.rs crates/vcad-ir/src/vcode.rs— FileTooLong — 1894 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 1394 over it, 3.79× 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/kicad_write.rs crates/vcad-ecad-symbols/src/kicad_write.rs— FileTooLong — 1875 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 79 free functions. The bar is 500 significant lines; this is 1375 over it, 3.75× 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 crates/vcad-ir/src/lib.rs— FileTooLong — 1869 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 1369 over it, 3.74× 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 crates/vcad-ffi/src/lib.rs— FileTooLong — 1744 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 99 free functions. The bar is 500 significant lines; this is 1244 over it, 3.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED crates/vcad-kernel/src/lib.rs— FileTooLong — 1652 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: Solid (8 blocks, 382-2694). The bar is 500 significant lines; this is 1152 over it, 3.30× 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: viewer-app/main.ts packages/mcp/viewer-app/main.ts— FileTooLong — 1627 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1127 over it, 3.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/materializer.rs crates/vcad-app/src/materializer.rs— FileTooLong — 1615 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 1115 over it, 3.23× 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: stores/document-store.ts packages/core/src/stores/document-store.ts— FileTooLong — 1613 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: useDocumentStore (948-2355). The bar is 500 significant lines; this is 1113 over it, 3.23× 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: components/PropertyPanel.tsx packages/app/src/components/PropertyPanel.tsx— FileTooLong — 1485 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 985 over it, 2.97× 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.
Duplicated block (7 lines × 2) crates/termview/src/rasterize.rs:618— crates/termview/src/rasterize.rs:618-624 | crates/termview/src/rasterize.rs:697-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/termview/src/rasterize.rs:618` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/termview/src/rasterize.rs:629` calls `draw_tiny_char` and `crates/termview/src/rasterize.rs:704` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/vcad-atoms/src/fab.rs:386— crates/vcad-atoms/src/fab.rs:386-392 | crates/vcad-atoms/src/fab.rs:524-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-atoms/src/fab.rs:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-cli/src/ui/status.rs:101— crates/vcad-cli/src/ui/status.rs:101-107 | crates/vcad-cli/src/ui/toolbar.rs:567-573 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/ui/status.rs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-ecad-pcb/src/drc.rs:931— crates/vcad-ecad-pcb/src/drc.rs:931-937 | crates/vcad-ecad-pcb/src/via_sizing.rs:70-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 (7 lines × 2) crates/vcad-ecad-pcb/src/router/complete.rs:246— crates/vcad-ecad-pcb/src/router/complete.rs:246-252 | crates/vcad-kernel-booleans/src/trim.rs:695-701 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `Vec2` in one and `&Point2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) crates/vcad-ecad-pcb/src/router/complete.rs:1417— crates/vcad-ecad-pcb/src/router/complete.rs:1417-1423 | crates/vcad-ecad-pcb/src/router/maze.rs:775-781 — before extracting anything, compare `crates/vcad-ecad-pcb/src/router/complete.rs` and `crates/vcad-ecad-pcb/src/router/maze.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/complete.rs:1417` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-ecad-pcb/src/router/length_match.rs:294— crates/vcad-ecad-pcb/src/router/length_match.rs:294-300 | crates/vcad-ecad-pcb/src/router/length_match.rs:833-839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/length_match.rs:294` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-ecad-pcb/src/router/maze.rs:574— crates/vcad-ecad-pcb/src/router/maze.rs:574-580 | crates/vcad-ecad-pcb/src/router/maze.rs:1362-1368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:474— crates/vcad-ecad-pcb/src/router/sco.rs:474-480 | crates/vcad-ecad-pcb/src/router/sco.rs:636-642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:474` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-ecad-symbols/src/footprint.rs:2078— crates/vcad-ecad-symbols/src/footprint.rs:2078-2085 | crates/vcad-ecad-symbols/src/footprint.rs:2132-2138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/footprint.rs:2078` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-ecad-symbols/src/footprint.rs:2108— crates/vcad-ecad-symbols/src/footprint.rs:2108-2114 | crates/vcad-ecad-symbols/src/footprint.rs:2170-2176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/vcad-ffi/src/fea.rs:453— crates/vcad-ffi/src/fea.rs:453-459 | crates/vcad-ffi/src/fea.rs:480-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/fea.rs:453` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-ffi/src/gym.rs:531— crates/vcad-ffi/src/gym.rs:531-537 | crates/vcad-ffi/src/train.rs:685-691 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/gym.rs:531` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/bbox.rs:309— crates/vcad-kernel-booleans/src/bbox.rs:309-315 | crates/vcad-kernel-booleans/src/bbox.rs:318-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/bbox.rs:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:807— crates/vcad-kernel-booleans/src/classify.rs:807-813 | crates/vcad-kernel-booleans/src/classify.rs:829-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:807` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:1344— crates/vcad-kernel-booleans/src/classify.rs:1344-1350 | crates/vcad-kernel-booleans/src/pipeline.rs:353-359 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:1344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:921— crates/vcad-kernel-booleans/src/mesh/csg.rs:921-927 | crates/vcad-kernel-tessellate/src/lib.rs:1868-1874 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/csg.rs` and `crates/vcad-kernel-tessellate/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/csg.rs:921` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/no_crossing.rs:395— crates/vcad-kernel-booleans/src/no_crossing.rs:395-401 | crates/vcad-kernel-booleans/src/no_crossing.rs:409-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/no_crossing.rs:395` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1497— crates/vcad-kernel-booleans/src/split.rs:1497-1503 | crates/vcad-kernel-booleans/src/split.rs:3417-3423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1497` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5451— crates/vcad-kernel-booleans/src/split.rs:5451-5457 | crates/vcad-kernel-booleans/src/split.rs:5619-5632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:5451` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-cam/src/operation/contour.rs:156— crates/vcad-kernel-cam/src/operation/contour.rs:156-162 | crates/vcad-kernel-cam/src/operation/pocket.rs:94-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/operation/contour.rs:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-dfm/src/geom/probe.rs:114— crates/vcad-kernel-dfm/src/geom/probe.rs:114-120 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:441-447 — 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) crates/vcad-kernel-dfm/src/rules/fdm.rs:90— crates/vcad-kernel-dfm/src/rules/fdm.rs:90-96 | crates/vcad-kernel-dfm/src/rules/sheet.rs:26-32 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/rules/fdm.rs:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/vcad-kernel-drafting/src/dxf.rs:31— crates/vcad-kernel-drafting/src/dxf.rs:31-37 | crates/vcad-kernel-drafting/src/dxf.rs:120-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/vcad-kernel-drafting/src/sheet.rs:635— crates/vcad-kernel-drafting/src/sheet.rs:635-641 | crates/vcad-kernel-drafting/src/sheet.rs:654-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&ProjectedView` in one and `&SectionView` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) crates/termview/src/rasterize.rs:644— crates/termview/src/rasterize.rs:644-649 | crates/termview/src/rasterize.rs:692-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/termview/src/rasterize.rs:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-cli/src/ui/tree.rs:108— crates/vcad-cli/src/ui/tree.rs:108-113 | crates/vcad-cli/src/ui/tree.rs:122-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:1676— crates/vcad-ecad-pcb/src/router/auto.rs:1676-1681 | crates/vcad-ecad-pcb/src/router/auto.rs:1714-1719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:4020— crates/vcad-ecad-pcb/src/router/auto.rs:4020-4025 | crates/vcad-ecad-pcb/src/router/flow/route.rs:155-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/auto.rs:4020` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:894— crates/vcad-ecad-pcb/src/router/sco.rs:894-899 | crates/vcad-ecad-pcb/src/router/sco.rs:935-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:894` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-ecad-pcb/src/spatial.rs:611— crates/vcad-ecad-pcb/src/spatial.rs:611-616 | mecheval/graders/src/pcb.rs:149-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mecheval/graders/src/pcb.rs:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-ecad-symbols/src/kicad_write.rs:2515— crates/vcad-ecad-symbols/src/kicad_write.rs:2515-2520 | crates/vcad-ecad-symbols/src/kicad_write.rs:2522-2527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/vcad-eval/src/cavity_extract.rs:496— crates/vcad-eval/src/cavity_extract.rs:496-501 | crates/vcad-kernel-booleans/src/split.rs:5183-5188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/cavity_extract.rs:496` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-eval/src/evaluate.rs:3725— crates/vcad-eval/src/evaluate.rs:3725-3730 | crates/vcad-kernel-fea/src/mesh.rs:814-819 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/evaluate.rs:3725` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-eval/src/pcb_preview.rs:589— crates/vcad-eval/src/pcb_preview.rs:589-594 | crates/vcad-eval/src/pcb_preview.rs:595-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/vcad-eval/src/validate.rs:98— crates/vcad-eval/src/validate.rs:98-103 | crates/vcad-kernel-urdf/src/writer.rs:409-414 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/validate.rs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-ffi/src/drafting.rs:262— crates/vcad-ffi/src/drafting.rs:262-267 | crates/vcad-kernel-drafting/src/dimension/placement.rs:90-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/drafting.rs:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-ffi/src/lib.rs:499— crates/vcad-ffi/src/lib.rs:499-504 | crates/vcad-ffi/src/lib.rs:629-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-acoustics/src/instrument.rs:462— crates/vcad-kernel-acoustics/src/instrument.rs:462-467 | crates/vcad-kernel-fea/src/modal.rs:295-300 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/instrument.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/instrument.rs:462` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:588— crates/vcad-kernel-booleans/src/classify.rs:588-593 | crates/vcad-kernel-booleans/src/trim.rs:337-342 — before extracting anything, compare `crates/vcad-kernel-booleans/src/classify.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:588` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:683— crates/vcad-kernel-booleans/src/classify.rs:683-688 | crates/vcad-kernel-tessellate/src/lib.rs:2935-2940 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:683` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:647— crates/vcad-kernel-booleans/src/mesh/csg.rs:647-652 | crates/vcad-kernel-booleans/src/mesh/csg.rs:689-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/csg.rs:647` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/pipeline.rs:115— crates/vcad-kernel-booleans/src/pipeline.rs:115-122 | crates/vcad-kernel-booleans/src/pipeline.rs:137-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1502— crates/vcad-kernel-booleans/src/split.rs:1502-1507 | crates/vcad-kernel-booleans/src/split.rs:1736-1741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1502` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1628— crates/vcad-kernel-booleans/src/split.rs:1628-1633 | crates/vcad-kernel-booleans/src/split.rs:3487-3492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1628` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1919— crates/vcad-kernel-booleans/src/split.rs:1919-1924 | crates/vcad-kernel-booleans/src/split.rs:7149-7154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/vcad-kernel-booleans/src/split.rs:3095— crates/vcad-kernel-booleans/src/split.rs:3095-3100 | crates/vcad-kernel-booleans/src/split.rs:6854-6859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:3095` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-cam/src/dropcutter/ball.rs:86— crates/vcad-kernel-cam/src/dropcutter/ball.rs:86-91 | crates/vcad-kernel-cam/src/dropcutter/bull.rs:201-206 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/dropcutter/ball.rs:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-constraints/src/symbolic.rs:453— crates/vcad-kernel-constraints/src/symbolic.rs:453-458 | crates/vcad-kernel-constraints/src/symbolic.rs:507-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-constraints/src/symbolic.rs:453` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/vcad-kernel-dfm/src/geom/accessibility.rs:72— crates/vcad-kernel-dfm/src/geom/accessibility.rs:72-77 | crates/vcad-kernel-dfm/src/geom/thickness.rs:120-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/geom/accessibility.rs:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) crates/termview/src/rasterize.rs:406— crates/termview/src/rasterize.rs:406-411 | crates/termview/src/rasterize.rs:538-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/termview/src/rasterize.rs:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-app/src/feature.rs:572— crates/vcad-app/src/feature.rs:572-576 | crates/vcad-app/src/feature.rs:591-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/feature.rs:572` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-app/src/feature.rs:589` calls `insert`, `into`, `F64` and `crates/vcad-app/src/feature.rs:570` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/vcad-ecad-pcb/src/dfm.rs:503— crates/vcad-ecad-pcb/src/dfm.rs:503-507 | crates/vcad-ecad-pcb/src/router/escape.rs:87-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/dfm.rs:503` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-ecad-pcb/src/geometry.rs:60— crates/vcad-ecad-pcb/src/geometry.rs:60-64 | crates/vcad-eval/src/evaluate.rs:3478-3482 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/geometry.rs:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:414— crates/vcad-ecad-pcb/src/router/auto.rs:414-418 | crates/vcad-ecad-pcb/src/router/flow/cdt.rs:213-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/auto.rs:414` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:3009— crates/vcad-ecad-pcb/src/router/auto.rs:3009-3013 | crates/vcad-ecad-pcb/src/router/shove.rs:193-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:4577— crates/vcad-ecad-pcb/src/router/auto.rs:4577-4581 | crates/vcad-ecad-pcb/src/router/shove.rs:252-257 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/auto.rs:4577` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-ecad-pcb/src/router/descent.rs:980— crates/vcad-ecad-pcb/src/router/descent.rs:980-984 | crates/vcad-ecad-pcb/src/router/length_match.rs:752-756 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/descent.rs:980` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-ecad-symbols/src/altium/mod.rs:1046— crates/vcad-ecad-symbols/src/altium/mod.rs:1046-1050 | crates/vcad-ecad-symbols/src/eagle_brd.rs:391-395 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/altium/mod.rs:1046` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-eval/src/diff.rs:183— crates/vcad-eval/src/diff.rs:183-187 | crates/vcad-eval/src/diff.rs:321-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 (5 lines × 2) crates/vcad-eval/src/evaluate.rs:1646— crates/vcad-eval/src/evaluate.rs:1646-1650 | crates/vcad-eval/src/evaluate.rs:1728-1732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/evaluate.rs:1646` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-booleans/src/api.rs:872— crates/vcad-kernel-booleans/src/api.rs:872-876 | crates/vcad-kernel-tessellate/src/lib.rs:896-900 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/api.rs:872` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:148— crates/vcad-kernel-booleans/src/classify.rs:148-152 | crates/vcad-kernel-tessellate/src/lib.rs:2935-2939 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:278— crates/vcad-kernel-booleans/src/classify.rs:278-282 | crates/vcad-kernel-tessellate/src/lib.rs:8308-8312 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:278` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:324— crates/vcad-kernel-booleans/src/classify.rs:324-333 | crates/vcad-kernel-booleans/src/classify.rs:336-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:411— crates/vcad-kernel-booleans/src/mesh/csg.rs:411-415 | crates/vcad-kernel-shell/src/lib.rs:1262-1266 — 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) crates/vcad-kernel-booleans/src/split.rs:1602— crates/vcad-kernel-booleans/src/split.rs:1602-1606 | crates/vcad-kernel-booleans/src/split.rs:4031-4036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-booleans/src/split.rs:2769— crates/vcad-kernel-booleans/src/split.rs:2769-2775 | crates/vcad-kernel-tessellate/src/lib.rs:8306-8310 — 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) crates/vcad-kernel-booleans/src/split.rs:4515— crates/vcad-kernel-booleans/src/split.rs:4515-4521 | crates/vcad-kernel-booleans/src/split.rs:4694-4698 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-booleans/src/split.rs:5158— crates/vcad-kernel-booleans/src/split.rs:5158-5162 | crates/vcad-kernel-tessellate/src/lib.rs:6546-6550 — 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) crates/vcad-kernel-cam/src/toolpath.rs:237— crates/vcad-kernel-cam/src/toolpath.rs:237-241 | crates/vcad-kernel-tessellate/src/lib.rs:2298-2302 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/toolpath.rs:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-diff/src/implicit.rs:69— crates/vcad-kernel-diff/src/implicit.rs:69-73 | crates/vcad-kernel-diff/src/implicit.rs:218-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/implicit.rs:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-fillet/src/rolling_ball.rs:249— crates/vcad-kernel-fillet/src/rolling_ball.rs:249-253 | crates/vcad-kernel-fillet/src/rolling_ball.rs:260-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/rolling_ball.rs:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/vcad-kernel-flow/src/adjoint.rs:155— crates/vcad-kernel-flow/src/adjoint.rs:155-159 | crates/vcad-kernel-flow/src/solve.rs:202-206 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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 (5 lines × 2) crates/vcad-kernel-particle/src/space_charge.rs:66— crates/vcad-kernel-particle/src/space_charge.rs:66-70 | crates/vcad-kernel-particle/src/space_charge.rs:476-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-particle/src/space_charge.rs:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Hotspot: apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:997— apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in ReleasedOverlayView.viewport at line 997. 22 of those changes were fix/bug commits, and the other 50 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-eval/src/evaluate.rs crates/vcad-eval/src/evaluate.rs:1120— crates/vcad-eval/src/evaluate.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in vcad_eval::evaluate::evaluate_op_timed at line 1120. 9 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-eval/src/evaluate.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: packages/mcp/src/tools/ecad.ts packages/mcp/src/tools/ecad.ts:3811— packages/mcp/src/tools/ecad.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 161 in ecad.routeNets at line 3811. 12 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- packages/mcp/src/tools/ecad.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-cli/src/main.rs crates/vcad-cli/src/main.rs:1736— crates/vcad-cli/src/main.rs changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in vcad::route_file at line 1736. 10 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-cli/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: crates/vcad-ecad-pcb/src/router/auto.rs crates/vcad-ecad-pcb/src/router/auto.rs:485— crates/vcad-ecad-pcb/src/router/auto.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in vcad_ecad_pcb::router::auto::route_all_once at line 485. 3 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-ecad-pcb/src/router/auto.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: packages/core/src/stores/document-store.ts packages/core/src/stores/document-store.ts:948— packages/core/src/stores/document-store.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 181 in document-store.useDocumentStore at line 948. 1 of those changes was a fix/bug commit, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- packages/core/src/stores/document-store.ts`: 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: packages/mcp/src/server.ts packages/mcp/src/server.ts:744— packages/mcp/src/server.ts changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 115 in server.createServer at line 744. 6 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- packages/mcp/src/server.ts`: 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: apple/VcadApp/Sources/VcadApp/Editor.swift apple/VcadApp/Sources/VcadApp/Editor.swift:2156— apple/VcadApp/Sources/VcadApp/Editor.swift changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in EditorModel.finishSketch at line 2156. 13 of those changes were fix/bug commits, and the other 59 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/Editor.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-kernel-booleans/src/pipeline.rs crates/vcad-kernel-booleans/src/pipeline.rs:1283— crates/vcad-kernel-booleans/src/pipeline.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 144 in vcad_kernel_booleans::pipeline::brep_boolean at line 1283. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-kernel-booleans/src/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.
Hotspot: crates/vcad-loon/src/convert.rs crates/vcad-loon/src/convert.rs:2335— crates/vcad-loon/src/convert.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in ConvertCtx::convert_solid at line 2335. 3 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-loon/src/convert.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-ecad-pcb/src/router/maze.rs crates/vcad-ecad-pcb/src/router/maze.rs:323— crates/vcad-ecad-pcb/src/router/maze.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in vcad_ecad_pcb::router::maze::route_net_maze3d at line 323. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-ecad-pcb/src/router/maze.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-kernel-wasm/src/lib.rs crates/vcad-kernel-wasm/src/lib.rs:4823— crates/vcad-kernel-wasm/src/lib.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in vcad_kernel_wasm::evaluate_node at line 4823. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-kernel-wasm/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-ecad-pcb/src/router/descent.rs crates/vcad-ecad-pcb/src/router/descent.rs:915— crates/vcad-ecad-pcb/src/router/descent.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in vcad_ecad_pcb::router::descent::descend_board_inner at line 915. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-ecad-pcb/src/router/descent.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-render/src/lib.rs crates/vcad-render/src/lib.rs:3009— crates/vcad-render/src/lib.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in vcad_render::render_svg_impl at line 3009. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-render/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-kernel-tessellate/src/lib.rs crates/vcad-kernel-tessellate/src/lib.rs:7422— crates/vcad-kernel-tessellate/src/lib.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in vcad_kernel_tessellate::tessellate_trimmed_region at line 7422. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-kernel-tessellate/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-ecad-pcb/src/router/complete.rs crates/vcad-ecad-pcb/src/router/complete.rs:434— crates/vcad-ecad-pcb/src/router/complete.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in vcad_ecad_pcb::router::complete::route_window_complete_islands at line 434. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-ecad-pcb/src/router/complete.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: packages/kernel-wasm/vcad_kernel_wasm.js packages/kernel-wasm/vcad_kernel_wasm.js:9345— packages/kernel-wasm/vcad_kernel_wasm.js changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in vcad_kernel_wasm.__wbg_get_imports at line 9345. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- packages/kernel-wasm/vcad_kernel_wasm.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apple/VcadApp/Sources/VcadApp/ElectronicsView.swift apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:473— apple/VcadApp/Sources/VcadApp/ElectronicsView.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in ElectronicsCanvas.body at line 473. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/ElectronicsView.swift`: 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: apple/VcadApp/Sources/VcadApp/Shell.swift apple/VcadApp/Sources/VcadApp/Shell.swift:176— apple/VcadApp/Sources/VcadApp/Shell.swift changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in DocumentCommands.body at line 176. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/Shell.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-app/src/migrate.rs crates/vcad-app/src/migrate.rs:336— crates/vcad-app/src/migrate.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in vcad_app::migrate::migrate_node at line 336. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-app/src/migrate.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-app/src/materializer.rs crates/vcad-app/src/materializer.rs:556— crates/vcad-app/src/materializer.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in vcad_app::materializer::materialize_doc_extras at line 556. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-app/src/materializer.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: apple/VcadApp/Sources/VcadApp/GlassChrome.swift apple/VcadApp/Sources/VcadApp/GlassChrome.swift:554— apple/VcadApp/Sources/VcadApp/GlassChrome.swift changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in DockTools.design at line 554. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/GlassChrome.swift`: 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: apple/VcadApp/Sources/VcadApp/AgentBridge.swift apple/VcadApp/Sources/VcadApp/AgentBridge.swift:239— apple/VcadApp/Sources/VcadApp/AgentBridge.swift changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in AgentTools.call at line 239. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/AgentBridge.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/vcad-ecad-pcb/src/router/pair.rs crates/vcad-ecad-pcb/src/router/pair.rs:278— crates/vcad-ecad-pcb/src/router/pair.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in vcad_ecad_pcb::router::pair::try_route_pair_reason at line 278. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-ecad-pcb/src/router/pair.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: packages/mcp/src/tools/render.ts packages/mcp/src/tools/render.ts:376— packages/mcp/src/tools/render.ts changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 105 in render.renderView at line 376. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- packages/mcp/src/tools/render.ts`: 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.
vcad_ecad_pcb::router::complete::route_window_complete_islands (cognitive 238) crates/vcad-ecad-pcb/src/router/complete.rs:434— vcad_ecad_pcb::router::complete::route_window_complete_islands has cognitive complexity 238 (threshold 15). Drivers by points: if/else 63 (144 pts), loops 28 (60 pts), boolean chains 19, match/switch 6 (15 pts) (nesting depth added 122). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::router::flow::realize::realize_wires (cognitive 237) crates/vcad-ecad-pcb/src/router/flow/realize.rs:300— vcad_ecad_pcb::router::flow::realize::realize_wires has cognitive complexity 237 (threshold 15). Drivers by points: if/else 48 (127 pts), loops 34 (85 pts), match/switch 5 (17 pts), boolean chains 8 (nesting depth added 142). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::router::auto::route_all_once (cognitive 176) crates/vcad-ecad-pcb/src/router/auto.rs:485— vcad_ecad_pcb::router::auto::route_all_once has cognitive complexity 176 (threshold 15). Drivers by points: if/else 40 (79 pts), loops 35 (70 pts), boolean chains 17, match/switch 3 (10 pts) (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::router::descent::descend_board_inner (cognitive 173) crates/vcad-ecad-pcb/src/router/descent.rs:915— vcad_ecad_pcb::router::descent::descend_board_inner has cognitive complexity 173 (threshold 15). Drivers by points: if/else 37 (116 pts), loops 16 (42 pts), boolean chains 13, match/switch 1 (2 pts) (nesting depth added 106). 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.
vcad_ecad_pcb::router::maze::route_net_maze3d (cognitive 173) crates/vcad-ecad-pcb/src/router/maze.rs:323— vcad_ecad_pcb::router::maze::route_net_maze3d has cognitive complexity 173 (threshold 15). Drivers by points: if/else 54 (117 pts), boolean chains 32, loops 11 (16 pts), match/switch 2 (8 pts) (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.
vcad_ecad_pcb::router::flow::route::route_flow (cognitive 151) crates/vcad-ecad-pcb/src/router/flow/route.rs:879— vcad_ecad_pcb::router::flow::route::route_flow has cognitive complexity 151 (threshold 15). Drivers by points: if/else 27 (82 pts), loops 21 (58 pts), boolean chains 8, match/switch 1 (3 pts) (nesting depth added 94). 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.
vcad_ecad_pcb::router::pair::try_route_pair_reason (cognitive 118) crates/vcad-ecad-pcb/src/router/pair.rs:278— vcad_ecad_pcb::router::pair::try_route_pair_reason has cognitive complexity 118 (threshold 15). Drivers by points: if/else 45 (86 pts), loops 13 (20 pts), boolean chains 9, match/switch 2 (3 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.
vcad_ecad_pcb::router::escape::plan_field_escapes_toward (cognitive 105) crates/vcad-ecad-pcb/src/router/escape.rs:400— vcad_ecad_pcb::router::escape::plan_field_escapes_toward has cognitive complexity 105 (threshold 15). Drivers by points: if/else 27 (75 pts), loops 11 (20 pts), boolean chains 9, match/switch 1 (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.
vcad_ecad_pcb::router::auto::route_pass (cognitive 90) crates/vcad-ecad-pcb/src/router/auto.rs:1580— vcad_ecad_pcb::router::auto::route_pass has cognitive complexity 90 (threshold 15). Drivers by points: if/else 25 (55 pts), loops 10 (24 pts), boolean chains 11 (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.
vcad_ecad_pcb::router::flow::route::realize (cognitive 88) crates/vcad-ecad-pcb/src/router/flow/route.rs:385— vcad_ecad_pcb::router::flow::route::realize has cognitive complexity 88 (threshold 15). Drivers by points: loops 23 (51 pts), if/else 10 (32 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 51). 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.
vcad_ecad_pcb::router::pair::polish_pairs (cognitive 86) crates/vcad-ecad-pcb/src/router/pair.rs:1605— vcad_ecad_pcb::router::pair::polish_pairs has cognitive complexity 86 (threshold 15). Drivers by points: loops 17 (40 pts), if/else 12 (33 pts), boolean chains 7, match/switch 2 (6 pts) (nesting depth added 48). 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.
vcad_ecad_pcb::router::legalize::merge_same_net_vias (cognitive 80) crates/vcad-ecad-pcb/src/router/legalize.rs:444— vcad_ecad_pcb::router::legalize::merge_same_net_vias has cognitive complexity 80 (threshold 15). Drivers by points: if/else 17 (55 pts), loops 11 (21 pts), boolean chains 4 (nesting depth added 48). Of this number, 78 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.
vcad_ecad_pcb::router::auto::joint_window_repair (cognitive 74) crates/vcad-ecad-pcb/src/router/auto.rs:4742— vcad_ecad_pcb::router::auto::joint_window_repair has cognitive complexity 74 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 7 (22 pts), match/switch 2 (12 pts), boolean chains 8 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::router::sco::qp_l1 (cognitive 73) crates/vcad-ecad-pcb/src/router/sco.rs:709— vcad_ecad_pcb::router::sco::qp_l1 has cognitive complexity 73 (threshold 15). Drivers by points: loops 13 (40 pts), if/else 10 (32 pts), boolean chains 1 (nesting depth added 49). 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.
vcad_ecad_pcb::router::pair::realize_legs (cognitive 72) crates/vcad-ecad-pcb/src/router/pair.rs:1231— vcad_ecad_pcb::router::pair::realize_legs has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 10 (14 pts), boolean chains 11, match/switch 2 (5 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::drc::check_keepout (cognitive 65) crates/vcad-ecad-pcb/src/drc.rs:1304— vcad_ecad_pcb::drc::check_keepout has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (47 pts), loops 5 (14 pts), boolean chains 4 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::router::gpu_bridge::gpu_search_batch_inner (cognitive 62) crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:222— vcad_ecad_pcb::router::gpu_bridge::gpu_search_batch_inner has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 8 (15 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.
vcad_ecad_pcb::router::compensate_run (cognitive 53) crates/vcad-ecad-pcb/src/router/mod.rs:233— vcad_ecad_pcb::router::compensate_run has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 5 (13 pts), boolean chains 7, match/switch 2 (6 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.
vcad_ecad_pcb::router::auto::ring_escape (cognitive 53) crates/vcad-ecad-pcb/src/router/auto.rs:3975— vcad_ecad_pcb::router::auto::ring_escape has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 7 (13 pts), boolean chains 5 (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.
vcad_ecad_pcb::drc::detect_shorts (cognitive 48) crates/vcad-ecad-pcb/src/drc.rs:2025— vcad_ecad_pcb::drc::detect_shorts has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 6 (11 pts), match/switch 1 (4 pts), 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.
vcad_ecad_pcb::router::flow::human::human_load (cognitive 48) crates/vcad-ecad-pcb/src/router/flow/human.rs:109— vcad_ecad_pcb::router::flow::human::human_load has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 7 (16 pts), match/switch 1 (4 pts), boolean chains 3 (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.
vcad_ecad_pcb::router::auto::stitch_planes (cognitive 45) crates/vcad-ecad-pcb/src/router/auto.rs:4399— vcad_ecad_pcb::router::auto::stitch_planes has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 3 (6 pts), boolean chains 3 (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.
vcad_ecad_pcb::router::flow::flow::choose_sites (cognitive 45) crates/vcad-ecad-pcb/src/router/flow/flow.rs:372— vcad_ecad_pcb::router::flow::flow::choose_sites has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 6 (9 pts), boolean chains 5 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_pcb::drc::check_clearance (cognitive 42) crates/vcad-ecad-pcb/src/drc.rs:477— vcad_ecad_pcb::drc::check_clearance has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 4 (6 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.
vcad_ecad_pcb::router::auto::route_batch (cognitive 42) crates/vcad-ecad-pcb/src/router/auto.rs:2252— vcad_ecad_pcb::router::auto::route_batch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 4 (12 pts), loops 4 (7 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.
Duplicated block (8 lines × 2) crates/vcad-cli/src/app.rs:190— crates/vcad-cli/src/app.rs:190-197 | crates/vcad-cli/src/repl.rs:23-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/vcad-cli/src/main.rs:4653— crates/vcad-cli/src/main.rs:4653-4660 | crates/vcad-cli/src/main.rs:4824-4831 — both copies are in the same file, so extract the block into 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) crates/vcad-ecad-package/src/presets.rs:54— crates/vcad-ecad-package/src/presets.rs:54-61 | crates/vcad-ecad-symbols/src/footprint.rs:212-219 — 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) crates/vcad-ecad-pcb/src/copper_pour.rs:188— crates/vcad-ecad-pcb/src/copper_pour.rs:188-195 | crates/vcad-ecad-pcb/src/router/mod.rs:759-766 — 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) crates/vcad-ecad-pcb/src/router/escape.rs:507— crates/vcad-ecad-pcb/src/router/escape.rs:507-514 | crates/vcad-ecad-pcb/src/router/escape.rs:563-570 — both copies are in the same file, so extract the block into 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) crates/vcad-ecad-pcb/src/router/global.rs:282— crates/vcad-ecad-pcb/src/router/global.rs:282-289 | crates/vcad-ecad-pcb/src/router/global.rs:339-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/global.rs:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-ecad-symbols/src/kicad_write.rs:463— crates/vcad-ecad-symbols/src/kicad_write.rs:463-470 | crates/vcad-ecad-symbols/src/kicad_write.rs:2873-2880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/kicad_write.rs:463` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-eval/src/diff.rs:288— crates/vcad-eval/src/diff.rs:288-295 | crates/vcad-eval/src/sensitivity.rs:387-394 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/diff.rs:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-ffi/src/engine.rs:74— crates/vcad-ffi/src/engine.rs:74-81 | crates/vcad-ffi/src/engine.rs:111-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/engine.rs:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-ir/src/vcode.rs:2204— crates/vcad-ir/src/vcode.rs:2204-2211 | crates/vcad-ir/src/vcode.rs:2222-2229 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-acoustics/src/helmholtz.rs:332— crates/vcad-kernel-acoustics/src/helmholtz.rs:332-339 | crates/vcad-kernel-acoustics/src/helmholtz.rs:348-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/helmholtz.rs:332` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-acoustics/src/strike.rs:205— crates/vcad-kernel-acoustics/src/strike.rs:205-212 | crates/vcad-kernel-fea/src/modal.rs:271-278 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/strike.rs:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:148— crates/vcad-kernel-booleans/src/classify.rs:148-155 | crates/vcad-kernel-booleans/src/trim.rs:380-387 — before extracting anything, compare `crates/vcad-kernel-booleans/src/classify.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:602— crates/vcad-kernel-booleans/src/mesh/csg.rs:602-609 | crates/vcad-kernel/src/lib.rs:1597-1604 — 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) crates/vcad-kernel-booleans/src/split.rs:726— crates/vcad-kernel-booleans/src/split.rs:726-733 | crates/vcad-kernel-booleans/src/split.rs:807-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:726` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-booleans/src/trim.rs:393— crates/vcad-kernel-booleans/src/trim.rs:393-400 | crates/vcad-kernel-booleans/src/trim.rs:735-742 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-cam/src/post/grbl.rs:153— crates/vcad-kernel-cam/src/post/grbl.rs:153-160 | crates/vcad-kernel-cam/src/post/grbl.rs:204-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-cam/src/post/grbl.rs:201` calls `push`, `coord` and `crates/vcad-kernel-cam/src/post/grbl.rs:150` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crates/vcad-kernel-cam/src/post/linuxcnc.rs:205— crates/vcad-kernel-cam/src/post/linuxcnc.rs:205-212 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:264-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-cam/src/post/linuxcnc.rs:261` calls `push`, `coord` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs:202` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crates/vcad-kernel-dfm/src/geom/probe.rs:99— crates/vcad-kernel-dfm/src/geom/probe.rs:99-106 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:428-435 — 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) crates/vcad-kernel-dfm/src/geom/radii.rs:22— crates/vcad-kernel-dfm/src/geom/radii.rs:22-29 | crates/vcad-kernel-features/src/lib.rs:174-181 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/geom/radii.rs:22` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/vcad-kernel-em/src/ac.rs:143— crates/vcad-kernel-em/src/ac.rs:143-150 | crates/vcad-kernel-em/src/grid.rs:418-425 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/ac.rs:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-em/src/axisym.rs:558— crates/vcad-kernel-em/src/axisym.rs:558-567 | crates/vcad-kernel-em/src/planar.rs:462-469 — before extracting anything, compare `crates/vcad-kernel-em/src/axisym.rs` and `crates/vcad-kernel-em/src/planar.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:558` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-em/src/axisym.rs:593— crates/vcad-kernel-em/src/axisym.rs:593-600 | crates/vcad-kernel-em/src/planar.rs:510-517 — before extracting anything, compare `crates/vcad-kernel-em/src/axisym.rs` and `crates/vcad-kernel-em/src/planar.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:593` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-em/src/planar.rs:725— crates/vcad-kernel-em/src/planar.rs:725-732 | crates/vcad-kernel-em/src/planar.rs:742-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/planar.rs:725` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/vcad-kernel-neutronics/src/diffusion.rs:308— crates/vcad-kernel-neutronics/src/diffusion.rs:308-315 | crates/vcad-kernel-neutronics/src/diffusion.rs:336-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-neutronics/src/diffusion.rs:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
vcad_kernel_booleans::classify::face_sample_point (cognitive 359) crates/vcad-kernel-booleans/src/classify.rs:101— vcad_kernel_booleans::classify::face_sample_point has cognitive complexity 359 (threshold 15). Drivers by points: if/else 80 (243 pts), loops 25 (105 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 247). 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.
vcad_kernel_booleans::pipeline::brep_boolean (cognitive 298) crates/vcad-kernel-booleans/src/pipeline.rs:1283— vcad_kernel_booleans::pipeline::brep_boolean has cognitive complexity 298 (threshold 15). Drivers by points: if/else 91 (203 pts), loops 33 (59 pts), boolean chains 29, match/switch 3 (7 pts) (nesting depth added 142). 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.
vcad_kernel_booleans::pipeline::apply_splits_to_solid (cognitive 251) crates/vcad-kernel-booleans/src/pipeline.rs:774— vcad_kernel_booleans::pipeline::apply_splits_to_solid has cognitive complexity 251 (threshold 15). Drivers by points: if/else 43 (203 pts), loops 6 (26 pts), match/switch 2 (15 pts), boolean chains 7 (nesting depth added 193). 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.
vcad_kernel_booleans::trim::point_in_face_inner (cognitive 195) crates/vcad-kernel-booleans/src/trim.rs:149— vcad_kernel_booleans::trim::point_in_face_inner has cognitive complexity 195 (threshold 15). Drivers by points: if/else 53 (148 pts), loops 11 (27 pts), boolean chains 20 (nesting depth added 111). 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.
vcad_kernel_booleans::split::split_planar_face_by_circle (cognitive 121) crates/vcad-kernel-booleans/src/split.rs:1344— vcad_kernel_booleans::split::split_planar_face_by_circle has cognitive complexity 121 (threshold 15). Drivers by points: if/else 35 (81 pts), loops 7 (19 pts), match/switch 5 (15 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.
vcad_kernel_booleans::split::split_face_by_curve (cognitive 92) crates/vcad-kernel-booleans/src/split.rs:334— vcad_kernel_booleans::split::split_face_by_curve has cognitive complexity 92 (threshold 15). Drivers by points: if/else 41 (62 pts), loops 12 (20 pts), boolean chains 10 (nesting depth added 29). Of this number, 90 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.
vcad_kernel_booleans::trim::trim_curve_to_face (cognitive 83) crates/vcad-kernel-booleans/src/trim.rs:905— vcad_kernel_booleans::trim::trim_curve_to_face has cognitive complexity 83 (threshold 15). Drivers by points: if/else 28 (56 pts), loops 8 (18 pts), boolean chains 5, match/switch 2 (4 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.
vcad_kernel_booleans::split::clip_spherical_face_by_circle (cognitive 81) crates/vcad-kernel-booleans/src/split.rs:4055— vcad_kernel_booleans::split::clip_spherical_face_by_circle has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (51 pts), loops 12 (19 pts), boolean chains 9, match/switch 1 (2 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.
vcad_kernel_booleans::api::boolean_op_reported_untimed (cognitive 70) crates/vcad-kernel-booleans/src/api.rs:369— vcad_kernel_booleans::api::boolean_op_reported_untimed has cognitive complexity 70 (threshold 15). Drivers by points: if/else 29 (48 pts), boolean chains 20, match/switch 1 (2 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.
vcad_kernel_booleans::split::split_conical_face_by_ruling (cognitive 68) crates/vcad-kernel-booleans/src/split.rs:4795— vcad_kernel_booleans::split::split_conical_face_by_ruling has cognitive complexity 68 (threshold 15). Drivers by points: if/else 33 (51 pts), loops 5 (9 pts), boolean chains 7, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_booleans::split::split_planar_face_by_multi_arc (cognitive 58) crates/vcad-kernel-booleans/src/split.rs:3188— vcad_kernel_booleans::split::split_planar_face_by_multi_arc has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 13 (18 pts), boolean chains 4, match/switch 2 (4 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.
vcad_kernel_booleans::split::split_planar_face_by_arc (cognitive 55) crates/vcad-kernel-booleans/src/split.rs:2708— vcad_kernel_booleans::split::split_planar_face_by_arc has cognitive complexity 55 (threshold 15). Drivers by points: if/else 30 (38 pts), loops 7 (11 pts), boolean chains 5, match/switch 1 (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.
vcad_kernel_booleans::bbox::face_aabb (cognitive 51) crates/vcad-kernel-booleans/src/bbox.rs:159— vcad_kernel_booleans::bbox::face_aabb has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 7 (17 pts), boolean chains 1, match/switch 1 (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.
vcad_kernel_booleans::cyl_band::try_parse_two_chain (cognitive 51) crates/vcad-kernel-booleans/src/cyl_band.rs:578— vcad_kernel_booleans::cyl_band::try_parse_two_chain has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (34 pts), loops 7 (8 pts), boolean chains 6, 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.
vcad_kernel_booleans::trim::project_point_to_uv (cognitive 51) crates/vcad-kernel-booleans/src/trim.rs:713— vcad_kernel_booleans::trim::project_point_to_uv has cognitive complexity 51 (threshold 15). Drivers by points: if/else 26 (50 pts), match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_booleans::cyl_band::extract_regions (cognitive 50) crates/vcad-kernel-booleans/src/cyl_band.rs:1041— vcad_kernel_booleans::cyl_band::extract_regions has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 6 (15 pts), boolean chains 4 (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.
vcad_kernel_booleans::freeze::freeze_circle_loops (cognitive 50) crates/vcad-kernel-booleans/src/freeze.rs:105— vcad_kernel_booleans::freeze::freeze_circle_loops has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 4 (9 pts), match/switch 3 (6 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.
vcad_kernel_booleans::cyl_band::split_cylindrical_face_by_patch (cognitive 49) crates/vcad-kernel-booleans/src/cyl_band.rs:2331— vcad_kernel_booleans::cyl_band::split_cylindrical_face_by_patch has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 7, loops 6 (7 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.
vcad_kernel_booleans::mesh::csg::triangulate (cognitive 44) crates/vcad-kernel-booleans/src/mesh/csg.rs:402— vcad_kernel_booleans::mesh::csg::triangulate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 5 (14 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_booleans::sew::sew_faces (cognitive 43) crates/vcad-kernel-booleans/src/sew.rs:101— vcad_kernel_booleans::sew::sew_faces has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 2 (7 pts), match/switch 2 (3 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.
vcad_kernel_booleans::classify::find_coincident_classification (cognitive 42) crates/vcad-kernel-booleans/src/classify.rs:1004— vcad_kernel_booleans::classify::find_coincident_classification has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 3 (5 pts), match/switch 3 (5 pts), boolean chains 3 (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.
vcad_kernel_booleans::split::clip_spherical_face_multi (cognitive 42) crates/vcad-kernel-booleans/src/split.rs:4542— vcad_kernel_booleans::split::clip_spherical_face_multi has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 6 (9 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.
vcad_kernel_booleans::repair::split_edges_at_interior_vertices_impl (cognitive 41) crates/vcad-kernel-booleans/src/repair.rs:139— vcad_kernel_booleans::repair::split_edges_at_interior_vertices_impl has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 5 (8 pts), boolean chains 6, 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.
vcad_kernel_booleans::cyl_band::split_band_by_profile (cognitive 39) crates/vcad-kernel-booleans/src/cyl_band.rs:905— vcad_kernel_booleans::cyl_band::split_band_by_profile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 7 (10 pts), boolean chains 6 (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.
vcad_kernel_booleans::split::split_cylindrical_face (cognitive 38) crates/vcad-kernel-booleans/src/split.rs:6365— vcad_kernel_booleans::split::split_cylindrical_face has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (30 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 20). 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 (9 lines × 2) crates/vcad-ecad-pcb/src/router/flow/route.rs:952— crates/vcad-ecad-pcb/src/router/flow/route.rs:952-960 | crates/vcad-ecad-pcb/src/router/flow/route.rs:1200-1208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/flow/route.rs:952` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:51— crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:51-59 | crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:85-93 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:321— crates/vcad-ecad-pcb/src/router/sco.rs:321-329 | crates/vcad-ecad-pcb/src/router/sco.rs:558-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ecad-pcb/src/router/sco.rs:320` calls `include` and `crates/vcad-ecad-pcb/src/router/sco.rs:557` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/vcad-ecad-schematic/src/erc.rs:178— crates/vcad-ecad-schematic/src/erc.rs:178-186 | crates/vcad-ecad-schematic/src/erc.rs:288-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/vcad-ecad-sim/src/circuit/ac.rs:176— crates/vcad-ecad-sim/src/circuit/ac.rs:176-184 | crates/vcad-ecad-sim/src/circuit/linalg.rs:56-64 — before extracting anything, compare `crates/vcad-ecad-sim/src/circuit/ac.rs` and `crates/vcad-ecad-sim/src/circuit/linalg.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-sim/src/circuit/ac.rs:176` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&mut [Cplx]` in one and `&mut [f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) crates/vcad-ecad-symbols/src/builtin.rs:131— crates/vcad-ecad-symbols/src/builtin.rs:131-139 | crates/vcad-ecad-symbols/src/builtin.rs:207-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/builtin.rs:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-eval/src/evaluate.rs:141— crates/vcad-eval/src/evaluate.rs:141-149 | crates/vcad-eval/src/evaluate.rs:826-834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/vcad-eval/src/evaluate.rs:2698— crates/vcad-eval/src/evaluate.rs:2698-2706 | crates/vcad-kernel-tessellate/src/placement.rs:30-38 — 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) crates/vcad-ffi/src/import.rs:214— crates/vcad-ffi/src/import.rs:214-222 | crates/vcad-ffi/src/lib.rs:3615-3623 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/import.rs:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-ffi/src/lib.rs:483— crates/vcad-ffi/src/lib.rs:483-491 | crates/vcad-ffi/src/lib.rs:552-560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:483` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) crates/vcad-ir/src/lib.rs:1535— crates/vcad-ir/src/lib.rs:1535-1543 | crates/vcad-ir/src/vcode.rs:2311-2319 — 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) crates/vcad-kernel-booleans/src/classify.rs:592— crates/vcad-kernel-booleans/src/classify.rs:592-600 | crates/vcad-kernel-booleans/src/classify.rs:818-826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:592` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) crates/vcad-kernel-booleans/src/repair.rs:301— crates/vcad-kernel-booleans/src/repair.rs:301-309 | crates/vcad-kernel-booleans/src/repair.rs:331-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/repair.rs:301` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1721— crates/vcad-kernel-booleans/src/split.rs:1721-1729 | crates/vcad-kernel-tessellate/src/lib.rs:2968-2976 — 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) crates/vcad-kernel-booleans/src/split.rs:2937— crates/vcad-kernel-booleans/src/split.rs:2937-2945 | crates/vcad-kernel-booleans/src/trim.rs:1067-1075 — before extracting anything, compare `crates/vcad-kernel-booleans/src/split.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:2937` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-booleans/src/split.rs:7180— crates/vcad-kernel-booleans/src/split.rs:7180-7188 | crates/vcad-kernel-booleans/src/split.rs:7225-7233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:7180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-booleans/src/trim.rs:330— crates/vcad-kernel-booleans/src/trim.rs:330-338 | crates/vcad-kernel-booleans/src/trim.rs:499-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/trim.rs:330` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-constraints/src/residual.rs:33— crates/vcad-kernel-constraints/src/residual.rs:33-41 | crates/vcad-kernel-constraints/src/residual.rs:234-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-constraints/src/residual.rs:234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) crates/vcad-kernel-drafting/src/edge_extract.rs:147— crates/vcad-kernel-drafting/src/edge_extract.rs:147-155 | crates/vcad-kernel-drafting/src/edge_extract.rs:187-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/edge_extract.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-drafting/src/edge_extract.rs:186— crates/vcad-kernel-drafting/src/edge_extract.rs:186-194 | crates/vcad-kernel-drafting/src/edge_extract.rs:232-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/edge_extract.rs:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-drafting/src/sheet.rs:640— crates/vcad-kernel-drafting/src/sheet.rs:640-649 | crates/vcad-kernel-drafting/src/sheet.rs:692-700 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/sheet.rs:640` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `view` to `&ProjectedView` in one and `&DetailView` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) crates/vcad-kernel-fea/src/buckling.rs:885— crates/vcad-kernel-fea/src/buckling.rs:885-893 | crates/vcad-kernel-fea/src/modal.rs:395-403 — before extracting anything, compare `crates/vcad-kernel-fea/src/buckling.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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) crates/vcad-kernel-fillet/src/topology.rs:194— crates/vcad-kernel-fillet/src/topology.rs:194-202 | crates/vcad-kernel-shell/src/lib.rs:1354-1362 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/topology.rs:194` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/vcad-kernel-flow/src/adjoint.rs:203— crates/vcad-kernel-flow/src/adjoint.rs:203-211 | crates/vcad-kernel-flow/src/solve.rs:321-329 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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 (9 lines × 2) crates/vcad-kernel-particle/src/poisson.rs:275— crates/vcad-kernel-particle/src/poisson.rs:275-283 | crates/vcad-kernel-particle/src/space_charge.rs:211-219 — before extracting anything, compare `crates/vcad-kernel-particle/src/poisson.rs` and `crates/vcad-kernel-particle/src/space_charge.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-particle/src/poisson.rs:275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-cli/src/app.rs:1351— crates/vcad-cli/src/app.rs:1351-1361 | crates/vcad-render/src/main.rs:1178-1188 — 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) crates/vcad-cli/src/ui/chat.rs:363— crates/vcad-cli/src/ui/chat.rs:363-373 | crates/vcad-cli/src/ui/command.rs:147-157 — before extracting anything, compare `crates/vcad-cli/src/ui/chat.rs` and `crates/vcad-cli/src/ui/command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:1223— crates/vcad-ecad-pcb/src/router/auto.rs:1223-1233 | crates/vcad-ecad-pcb/src/router/auto.rs:1244-1254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/auto.rs:1223` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:4160— crates/vcad-ecad-pcb/src/router/auto.rs:4160-4170 | crates/vcad-ecad-pcb/src/router/auto.rs:4427-4437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/auto.rs:4160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crates/vcad-ecad-pcb/src/router/flow/realize.rs:434— crates/vcad-ecad-pcb/src/router/flow/realize.rs:434-444 | crates/vcad-ecad-pcb/src/router/flow/realize.rs:644-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/flow/realize.rs:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-ecad-pcb/src/router/flow/realize.rs:446— crates/vcad-ecad-pcb/src/router/flow/realize.rs:446-456 | crates/vcad-ecad-pcb/src/router/flow/realize.rs:656-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/flow/realize.rs:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-ecad-pcb/src/session.rs:789— crates/vcad-ecad-pcb/src/session.rs:789-799 | crates/vcad-ecad-pcb/src/session.rs:869-879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/session.rs:789` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crates/vcad-ecad-sim/src/circuit/ac.rs:346— crates/vcad-ecad-sim/src/circuit/ac.rs:346-356 | crates/vcad-ecad-sim/src/circuit/ac.rs:360-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/vcad-ecad-symbols/src/builtin.rs:14— crates/vcad-ecad-symbols/src/builtin.rs:14-24 | crates/vcad-ecad-symbols/src/footprint.rs:60-70 — before extracting anything, compare `crates/vcad-ecad-symbols/src/builtin.rs` and `crates/vcad-ecad-symbols/src/footprint.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/builtin.rs:14` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-ecad-symbols/src/kicad_write.rs:535— crates/vcad-ecad-symbols/src/kicad_write.rs:535-545 | crates/vcad-ecad-symbols/src/kicad_write.rs:1060-1070 — both copies are in the same file, so extract the block into 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) crates/vcad-eval/src/evaluate.rs:2028— crates/vcad-eval/src/evaluate.rs:2028-2038 | crates/vcad-eval/src/evaluate.rs:2080-2090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/evaluate.rs:2028` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) crates/vcad-eval/src/kinematics.rs:154— crates/vcad-eval/src/kinematics.rs:154-164 | crates/vcad-eval/src/kinematics.rs:180-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) crates/vcad-ffi/src/cam_job.rs:521— crates/vcad-ffi/src/cam_job.rs:521-531 | crates/vcad-ffi/src/cam_job.rs:583-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/cam_job.rs:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-acoustics/src/instrument.rs:499— crates/vcad-kernel-acoustics/src/instrument.rs:499-509 | crates/vcad-kernel-fea/src/modal.rs:317-327 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/instrument.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/instrument.rs:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:1665— crates/vcad-kernel-booleans/src/classify.rs:1665-1675 | crates/vcad-kernel-booleans/src/classify.rs:1676-1686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crates/vcad-kernel-booleans/src/split.rs:3336— crates/vcad-kernel-booleans/src/split.rs:3336-3346 | crates/vcad-kernel-booleans/src/split.rs:3603-3613 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-cam/src/operation/contour.rs:240— crates/vcad-kernel-cam/src/operation/contour.rs:240-250 | crates/vcad-kernel-cam/src/operation/pocket.rs:246-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/operation/contour.rs:240` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-diff/src/seam.rs:311— crates/vcad-kernel-diff/src/seam.rs:311-321 | crates/vcad-kernel-diff/src/second_order.rs:137-147 — before extracting anything, compare `crates/vcad-kernel-diff/src/seam.rs` and `crates/vcad-kernel-diff/src/second_order.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/seam.rs:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-diff/src/seam.rs:403— crates/vcad-kernel-diff/src/seam.rs:403-413 | crates/vcad-kernel-diff/src/second_order.rs:217-227 — before extracting anything, compare `crates/vcad-kernel-diff/src/seam.rs` and `crates/vcad-kernel-diff/src/second_order.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/seam.rs:403` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-em/src/axisym.rs:659— crates/vcad-kernel-em/src/axisym.rs:659-669 | crates/vcad-kernel-em/src/planar.rs:563-573 — before extracting anything, compare `crates/vcad-kernel-em/src/axisym.rs` and `crates/vcad-kernel-em/src/planar.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-em/src/planar.rs:574` calls `cell_geometry` and `crates/vcad-kernel-em/src/axisym.rs:670` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) crates/vcad-kernel-flow/src/conjugate_adjoint.rs:474— crates/vcad-kernel-flow/src/conjugate_adjoint.rs:474-484 | crates/vcad-kernel-flow/src/conjugate_adjoint.rs:509-519 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-flow/src/gpu.rs:249— crates/vcad-kernel-flow/src/gpu.rs:249-259 | crates/vcad-kernel-gpu/src/wavefront.rs:229-239 — before extracting anything, compare `crates/vcad-kernel-flow/src/gpu.rs` and `crates/vcad-kernel-gpu/src/wavefront.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/gpu.rs:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-sheet/src/poly2d.rs:537— crates/vcad-kernel-sheet/src/poly2d.rs:537-547 | crates/vcad-kernel-sheet/src/poly2d.rs:664-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/poly2d.rs:537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:1198— crates/vcad-kernel-sketch/src/extrude.rs:1198-1208 | crates/vcad-kernel-sweep/src/sweep.rs:276-286 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/sweep.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 111 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) crates/vcad-kernel-thermal/src/solve.rs:742— crates/vcad-kernel-thermal/src/solve.rs:742-752 | crates/vcad-kernel-thermal/src/solve.rs:754-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/vcad-cli/src/input.rs:394— crates/vcad-cli/src/input.rs:394-403 | crates/vcad-cli/src/input.rs:441-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-ecad-pcb/src/dfm.rs:528— crates/vcad-ecad-pcb/src/dfm.rs:528-537 | crates/vcad-ecad-pcb/src/drc.rs:1462-1471 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/dfm.rs:528` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-ecad-pcb/src/router/diff_pair.rs:72— crates/vcad-ecad-pcb/src/router/diff_pair.rs:72-81 | crates/vcad-ecad-pcb/src/router/pair.rs:141-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/vcad-ecad-pcb/src/router/pair.rs:1814— crates/vcad-ecad-pcb/src/router/pair.rs:1814-1823 | crates/vcad-ecad-pcb/src/router/pair.rs:1833-1842 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:902— crates/vcad-ecad-pcb/src/router/sco.rs:902-911 | crates/vcad-ecad-pcb/src/router/sco.rs:943-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:902` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-pcb/src/router/sco.rs:916` calls `cholesky_apply` and `crates/vcad-ecad-pcb/src/router/sco.rs:953` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/vcad-ecad-symbols/src/kicad_pcb.rs:625— crates/vcad-ecad-symbols/src/kicad_pcb.rs:625-634 | crates/vcad-ecad-symbols/src/kicad_pcb.rs:638-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/kicad_pcb.rs:625` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-ir/src/constraints.rs:315— crates/vcad-ir/src/constraints.rs:315-324 | crates/vcad-ir/src/constraints.rs:329-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/vcad-kernel-acoustics/src/linalg.rs:70— crates/vcad-kernel-acoustics/src/linalg.rs:70-79 | crates/vcad-kernel-antenna/src/linalg.rs:90-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/linalg.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-acoustics/src/strike.rs:226— crates/vcad-kernel-acoustics/src/strike.rs:226-235 | crates/vcad-kernel-acoustics/src/strike.rs:237-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-atoms/src/inspect.rs:49— crates/vcad-kernel-atoms/src/inspect.rs:49-58 | crates/vcad-kernel-atoms/src/inspect.rs:67-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-atoms/src/inspect.rs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-booleans/src/cyl_band.rs:1312— crates/vcad-kernel-booleans/src/cyl_band.rs:1312-1321 | crates/vcad-kernel-booleans/src/cyl_band.rs:2544-2553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-booleans/src/split.rs:2198— crates/vcad-kernel-booleans/src/split.rs:2198-2210 | crates/vcad-kernel-booleans/src/split.rs:3763-3772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-booleans/src/split.rs:3322— crates/vcad-kernel-booleans/src/split.rs:3322-3331 | crates/vcad-kernel-booleans/src/split.rs:3574-3583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-booleans/src/split.rs:4903— crates/vcad-kernel-booleans/src/split.rs:4903-4912 | crates/vcad-kernel-booleans/src/split.rs:6119-6128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5585— crates/vcad-kernel-booleans/src/split.rs:5585-5597 | crates/vcad-kernel-booleans/src/split.rs:6092-6101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-booleans/src/trim.rs:190— crates/vcad-kernel-booleans/src/trim.rs:190-199 | crates/vcad-kernel-booleans/src/trim.rs:251-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/trim.rs:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-cam/src/operation/contour.rs:117— crates/vcad-kernel-cam/src/operation/contour.rs:117-126 | crates/vcad-kernel-cam/src/operation/pocket.rs:59-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/vcad-kernel-cam/src/turning/geom.rs:99— crates/vcad-kernel-cam/src/turning/geom.rs:99-108 | crates/vcad-kernel-cam/src/turning/geom.rs:111-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/turning/geom.rs:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:105— crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:105-114 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:179-188 — before extracting anything, compare `crates/vcad-kernel-raytrace/src/intersect/bilinear.rs` and `crates/vcad-kernel-raytrace/src/intersect/bspline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:1180— crates/vcad-kernel-sketch/src/extrude.rs:1180-1189 | crates/vcad-kernel-sweep/src/sweep.rs:245-254 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/sweep.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:1180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-tessellate/src/clearance.rs:646— crates/vcad-kernel-tessellate/src/clearance.rs:646-655 | crates/vcad-kernel-tessellate/src/clearance.rs:720-729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/clearance.rs:646` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:2618— crates/vcad-kernel-tessellate/src/lib.rs:2618-2627 | crates/vcad-kernel-tessellate/src/lib.rs:4103-4112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:2618` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:4678— crates/vcad-kernel-tessellate/src/lib.rs:4678-4687 | crates/vcad-kernel-tessellate/src/lib.rs:4910-4919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/vcad-kernel-thermal/src/adjoint.rs:270— crates/vcad-kernel-thermal/src/adjoint.rs:270-279 | crates/vcad-kernel-thermal/src/graph.rs:241-250 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-thermal/src/adjoint.rs:270` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:10396— crates/vcad-kernel-wasm/src/lib.rs:10396-10405 | crates/vcad-kernel-wasm/src/lib.rs:10480-10489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:10396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-ecad-package/src/derive.rs:102— crates/vcad-ecad-package/src/derive.rs:102-113 | crates/vcad-ecad-symbols/src/footprint.rs:62-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-package/src/derive.rs:102` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-ecad-pcb/src/router/flow/route.rs:750— crates/vcad-ecad-pcb/src/router/flow/route.rs:750-761 | crates/vcad-ecad-pcb/src/router/flow/route.rs:774-785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/flow/route.rs:750` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-ecad-pcb/src/router/maze.rs:589— crates/vcad-ecad-pcb/src/router/maze.rs:589-600 | crates/vcad-ecad-pcb/src/router/maze.rs:1370-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/maze.rs:589` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-ecad-pcb/src/router/pair.rs:1819— crates/vcad-ecad-pcb/src/router/pair.rs:1819-1830 | crates/vcad-ecad-pcb/src/router/pair.rs:1848-1859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/pair.rs:1819` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-ecad-symbols/src/kicad_write.rs:1112— crates/vcad-ecad-symbols/src/kicad_write.rs:1112-1123 | mecheval/graders/src/pcb.rs:144-155 — 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) crates/vcad-ffi/src/lib.rs:2031— crates/vcad-ffi/src/lib.rs:2031-2042 | crates/vcad-ffi/src/lib.rs:2400-2411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) crates/vcad-ir/src/vcode.rs:1145— crates/vcad-ir/src/vcode.rs:1145-1156 | crates/vcad-ir/src/vcode.rs:1185-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1145` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:1220— crates/vcad-kernel-booleans/src/classify.rs:1220-1231 | crates/vcad-kernel-booleans/src/pipeline.rs:305-316 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:729— crates/vcad-kernel-booleans/src/mesh/csg.rs:729-740 | crates/vcad-kernel-tessellate/src/manifold.rs:389-400 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/csg.rs:729` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) crates/vcad-kernel-booleans/src/pipeline.rs:2178— crates/vcad-kernel-booleans/src/pipeline.rs:2178-2189 | crates/vcad-kernel-booleans/src/pipeline.rs:2258-2269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/pipeline.rs:2178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-booleans/src/split.rs:2938— crates/vcad-kernel-booleans/src/split.rs:2938-2949 | crates/vcad-kernel-booleans/src/split.rs:7226-7237 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-booleans/src/split.rs:7181— crates/vcad-kernel-booleans/src/split.rs:7181-7192 | crates/vcad-kernel-booleans/src/trim.rs:1068-1079 — before extracting anything, compare `crates/vcad-kernel-booleans/src/split.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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 × 2) crates/vcad-kernel-diff/src/mass.rs:166— crates/vcad-kernel-diff/src/mass.rs:166-177 | crates/vcad-kernel-diff/src/seam.rs:470-481 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `seam` to `&SeamMesh` in one and `&SeamMesh) -> (f64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/vcad-kernel-fillet/src/chamfer.rs:135— crates/vcad-kernel-fillet/src/chamfer.rs:135-146 | crates/vcad-kernel-fillet/src/fillet_planar.rs:217-229 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_planar.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/chamfer.rs:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-geom/src/lib.rs:386— crates/vcad-kernel-geom/src/lib.rs:386-397 | crates/vcad-kernel-geom/src/lib.rs:927-938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-geom/src/lib.rs:386` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-gpu/src/decimate.rs:67— crates/vcad-kernel-gpu/src/decimate.rs:67-78 | crates/vcad-kernel-gpu/src/normals.rs:41-52 — before extracting anything, compare `crates/vcad-kernel-gpu/src/decimate.rs` and `crates/vcad-kernel-gpu/src/normals.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-gpu/src/decimate.rs:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-tessellate/src/frozen.rs:900— crates/vcad-kernel-tessellate/src/frozen.rs:900-911 | crates/vcad-kernel-tessellate/src/frozen.rs:1327-1338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/frozen.rs:900` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:3057— crates/vcad-kernel-tessellate/src/lib.rs:3057-3068 | crates/vcad-kernel-tessellate/src/lib.rs:3118-3129 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-wasm/src/lib.rs:2248— crates/vcad-kernel-wasm/src/lib.rs:2248-2259 | crates/vcad-kernel-wasm/src/lib.rs:2428-2439 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel/src/lib.rs:2343— crates/vcad-kernel/src/lib.rs:2343-2354 | crates/vcad-kernel/src/lib.rs:2403-2414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel/src/lib.rs:2343` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-slicer/src/slice.rs:74— crates/vcad-slicer/src/slice.rs:74-85 | crates/vcad-slicer/src/support.rs:85-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-slicer/src/slice.rs:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-slicer/src/support.rs:81` calls `is_empty` and `crates/vcad-slicer/src/slice.rs:72` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crates/vcad-kernel-booleans/src/api.rs:883— crates/vcad-kernel-booleans/src/api.rs:883-894 | crates/vcad-kernel-tessellate/src/lib.rs:903-914 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/api.rs:883` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:1208— crates/vcad-kernel-sketch/src/extrude.rs:1208-1219 | crates/vcad-kernel-sweep/src/loft.rs:185-196 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/loft.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:1208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-ecad-export/src/gerber.rs:683— crates/vcad-ecad-export/src/gerber.rs:683-694 | crates/vcad-ecad-export/src/gerber.rs:809-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-export/src/gerber.rs:683` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/vcad-kernel-fea/src/mesh.rs:786— crates/vcad-kernel-fea/src/mesh.rs:786-797 | crates/vcad-kernel-topopt/src/domain.rs:176-187 — before extracting anything, compare `crates/vcad-kernel-fea/src/mesh.rs` and `crates/vcad-kernel-topopt/src/domain.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/mesh.rs:786` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
vcad_ecad_pcb::router::complete::route_window_complete_islands (cyclomatic 112) crates/vcad-ecad-pcb/src/router/complete.rs:434— vcad_ecad_pcb::router::complete::route_window_complete_islands has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_ecad_pcb::router::flow::realize::realize_wires (cyclomatic 93) crates/vcad-ecad-pcb/src/router/flow/realize.rs:300— vcad_ecad_pcb::router::flow::realize::realize_wires has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_ecad_pcb::router::auto::route_all_once (cyclomatic 89) crates/vcad-ecad-pcb/src/router/auto.rs:485— vcad_ecad_pcb::router::auto::route_all_once 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.
vcad_ecad_pcb::router::maze::route_net_maze3d (cyclomatic 89) crates/vcad-ecad-pcb/src/router/maze.rs:323— vcad_ecad_pcb::router::maze::route_net_maze3d 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.
vcad_ecad_pcb::router::pair::try_route_pair_reason (cyclomatic 65) crates/vcad-ecad-pcb/src/router/pair.rs:278— vcad_ecad_pcb::router::pair::try_route_pair_reason has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_ecad_pcb::router::descent::descend_board_inner (cyclomatic 63) crates/vcad-ecad-pcb/src/router/descent.rs:915— vcad_ecad_pcb::router::descent::descend_board_inner 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.
vcad_ecad_pcb::router::flow::route::route_flow (cyclomatic 55) crates/vcad-ecad-pcb/src/router/flow/route.rs:879— vcad_ecad_pcb::router::flow::route::route_flow 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.
vcad_ecad_pcb::router::escape::plan_field_escapes_toward (cyclomatic 47) crates/vcad-ecad-pcb/src/router/escape.rs:400— vcad_ecad_pcb::router::escape::plan_field_escapes_toward 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.
vcad_ecad_pcb::router::auto::route_pass (cyclomatic 44) crates/vcad-ecad-pcb/src/router/auto.rs:1580— vcad_ecad_pcb::router::auto::route_pass 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.
vcad_ecad_pcb::router::pair::realize_legs (cyclomatic 43) crates/vcad-ecad-pcb/src/router/pair.rs:1231— vcad_ecad_pcb::router::pair::realize_legs 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.
vcad_ecad_pcb::router::flow::route::realize (cyclomatic 39) crates/vcad-ecad-pcb/src/router/flow/route.rs:385— vcad_ecad_pcb::router::flow::route::realize has cyclomatic complexity 39 (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.
vcad_ecad_pcb::router::pair::polish_pairs (cyclomatic 39) crates/vcad-ecad-pcb/src/router/pair.rs:1605— vcad_ecad_pcb::router::pair::polish_pairs has cyclomatic complexity 39 (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.
vcad_ecad_pcb::router::legalize::merge_same_net_vias (cyclomatic 33) crates/vcad-ecad-pcb/src/router/legalize.rs:444— vcad_ecad_pcb::router::legalize::merge_same_net_vias has cyclomatic complexity 33 (threshold 15). Of this number, 31 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.
vcad_ecad_pcb::router::gpu_bridge::gpu_search_batch_inner (cyclomatic 32) crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:222— vcad_ecad_pcb::router::gpu_bridge::gpu_search_batch_inner 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.
vcad_ecad_pcb::router::auto::joint_window_repair (cyclomatic 28) crates/vcad-ecad-pcb/src/router/auto.rs:4742— vcad_ecad_pcb::router::auto::joint_window_repair 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.
vcad_ecad_pcb::pour_synth::decide_pours (cyclomatic 26) crates/vcad-ecad-pcb/src/pour_synth.rs:309— vcad_ecad_pcb::pour_synth::decide_pours 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.
vcad_ecad_pcb::drc::check_keepout (cyclomatic 25) crates/vcad-ecad-pcb/src/drc.rs:1304— vcad_ecad_pcb::drc::check_keepout 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.
vcad_ecad_pcb::router::auto::ring_escape (cyclomatic 25) crates/vcad-ecad-pcb/src/router/auto.rs:3975— vcad_ecad_pcb::router::auto::ring_escape 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.
vcad_ecad_pcb::router::sco::qp_l1 (cyclomatic 25) crates/vcad-ecad-pcb/src/router/sco.rs:709— vcad_ecad_pcb::router::sco::qp_l1 has cyclomatic complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_ecad_pcb::drc::check_clearance (cyclomatic 24) crates/vcad-ecad-pcb/src/drc.rs:477— vcad_ecad_pcb::drc::check_clearance 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.
vcad_ecad_pcb::router::compensate_run (cyclomatic 24) crates/vcad-ecad-pcb/src/router/mod.rs:233— vcad_ecad_pcb::router::compensate_run 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.
vcad_ecad_pcb::router::auto::validate_and_commit (cyclomatic 23) crates/vcad-ecad-pcb/src/router/auto.rs:2936— vcad_ecad_pcb::router::auto::validate_and_commit 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.
vcad_ecad_pcb::router::flow::flow::choose_sites (cyclomatic 23) crates/vcad-ecad-pcb/src/router/flow/flow.rs:372— vcad_ecad_pcb::router::flow::flow::choose_sites 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.
vcad_ecad_pcb::pour_synth::synthesize_outlines (cyclomatic 22) crates/vcad-ecad-pcb/src/pour_synth.rs:686— vcad_ecad_pcb::pour_synth::synthesize_outlines 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.
vcad_ecad_pcb::router::auto::route_batch (cyclomatic 22) crates/vcad-ecad-pcb/src/router/auto.rs:2252— vcad_ecad_pcb::router::auto::route_batch 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.
vcad_kernel_tessellate::tessellate_cylindrical_face (cognitive 146) crates/vcad-kernel-tessellate/src/lib.rs:4186— vcad_kernel_tessellate::tessellate_cylindrical_face has cognitive complexity 146 (threshold 15). Drivers by points: if/else 54 (106 pts), loops 16 (34 pts), boolean chains 6 (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.
vcad_kernel_tessellate::fill_closed_boundary_loops (cognitive 137) crates/vcad-kernel-tessellate/src/lib.rs:1427— vcad_kernel_tessellate::fill_closed_boundary_loops has cognitive complexity 137 (threshold 15). Drivers by points: if/else 34 (88 pts), loops 21 (45 pts), boolean chains 4 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::tessellate_trimmed_region (cognitive 135) crates/vcad-kernel-tessellate/src/lib.rs:7422— vcad_kernel_tessellate::tessellate_trimmed_region has cognitive complexity 135 (threshold 15). Drivers by points: if/else 42 (81 pts), loops 24 (37 pts), boolean chains 16, match/switch 1 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::heal_t_junctions_pass (cognitive 95) crates/vcad-kernel-tessellate/src/lib.rs:978— vcad_kernel_tessellate::heal_t_junctions_pass has cognitive complexity 95 (threshold 15). Drivers by points: if/else 34 (70 pts), loops 11 (23 pts), boolean chains 2 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::manifold::clean_pass (cognitive 74) crates/vcad-kernel-tessellate/src/manifold.rs:484— vcad_kernel_tessellate::manifold::clean_pass has cognitive complexity 74 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 11 (26 pts), match/switch 2 (10 pts), boolean chains 3 (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.
vcad_kernel_tessellate::torus_two_chain_rotated (cognitive 72) crates/vcad-kernel-tessellate/src/lib.rs:6849— vcad_kernel_tessellate::torus_two_chain_rotated has cognitive complexity 72 (threshold 15). Drivers by points: if/else 37 (53 pts), loops 10 (12 pts), boolean chains 6, 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.
vcad_kernel_tessellate::collapse_short_defective_edges (cognitive 71) crates/vcad-kernel-tessellate/src/lib.rs:8773— vcad_kernel_tessellate::collapse_short_defective_edges has cognitive complexity 71 (threshold 15). Drivers by points: if/else 18 (49 pts), loops 9 (19 pts), boolean chains 3 (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.
vcad_kernel_tessellate::prune_redundant_patches (cognitive 70) crates/vcad-kernel-tessellate/src/lib.rs:1787— vcad_kernel_tessellate::prune_redundant_patches has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 15 (27 pts), boolean chains 5 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::triangulate_circular_cap_with_holes (cognitive 69) crates/vcad-kernel-tessellate/src/lib.rs:3932— vcad_kernel_tessellate::triangulate_circular_cap_with_holes has cognitive complexity 69 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 14 (29 pts) (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.
vcad_kernel_tessellate::frozen::capture_plan (cognitive 68) crates/vcad-kernel-tessellate/src/frozen.rs:935— vcad_kernel_tessellate::frozen::capture_plan has cognitive complexity 68 (threshold 15). Drivers by points: loops 11 (25 pts), if/else 7 (24 pts), match/switch 4 (15 pts), boolean chains 4 (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.
vcad_kernel_tessellate::tessellate_ruled_two_chain (cognitive 63) crates/vcad-kernel-tessellate/src/lib.rs:4752— vcad_kernel_tessellate::tessellate_ruled_two_chain has cognitive complexity 63 (threshold 15). Drivers by points: if/else 33 (43 pts), boolean chains 10, loops 8 (10 pts) (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.
vcad_kernel_tessellate::refill_defective_neighborhoods (cognitive 58) crates/vcad-kernel-tessellate/src/lib.rs:1981— vcad_kernel_tessellate::refill_defective_neighborhoods has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 8 (18 pts), boolean chains 2 (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.
vcad_kernel_tessellate::fill_tiny_boundary_loops (cognitive 56) crates/vcad-kernel-tessellate/src/lib.rs:2181— vcad_kernel_tessellate::fill_tiny_boundary_loops has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (37 pts), loops 11 (19 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::ear_clip_triangulate (cognitive 56) crates/vcad-kernel-tessellate/src/lib.rs:3628— vcad_kernel_tessellate::ear_clip_triangulate has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (43 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::tessellate_toroidal_face (cognitive 55) crates/vcad-kernel-tessellate/src/lib.rs:7121— vcad_kernel_tessellate::tessellate_toroidal_face has cognitive complexity 55 (threshold 15). Drivers by points: if/else 26 (46 pts), loops 5 (8 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.
vcad_kernel_tessellate::tessellate_spherical_region (cognitive 52) crates/vcad-kernel-tessellate/src/lib.rs:5596— vcad_kernel_tessellate::tessellate_spherical_region has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 13 (19 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::tessellate_conical_face (cognitive 52) crates/vcad-kernel-tessellate/src/lib.rs:6323— vcad_kernel_tessellate::tessellate_conical_face has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (36 pts), loops 7 (15 pts), boolean chains 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.
vcad_kernel_tessellate::frozen::evaluate_plan_impl (cognitive 47) crates/vcad-kernel-tessellate/src/frozen.rs:1199— vcad_kernel_tessellate::frozen::evaluate_plan_impl has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 7 (11 pts), match/switch 4 (10 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tessellate::delaunay_flip (cognitive 43) crates/vcad-kernel-tessellate/src/lib.rs:5305— vcad_kernel_tessellate::delaunay_flip has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 6 (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.
vcad_kernel_tessellate::tessellate_small_spherical_cap (cognitive 42) crates/vcad-kernel-tessellate/src/lib.rs:5921— vcad_kernel_tessellate::tessellate_small_spherical_cap has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 7 (12 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.
vcad_kernel_tessellate::flip_sliver_triangles (cognitive 39) crates/vcad-kernel-tessellate/src/lib.rs:5415— vcad_kernel_tessellate::flip_sliver_triangles has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 4 (8 pts), boolean chains 4 (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.
vcad_kernel_tessellate::tessellate_cone_direct (cognitive 36) crates/vcad-kernel-tessellate/src/lib.rs:6707— vcad_kernel_tessellate::tessellate_cone_direct has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 6 (14 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.
vcad_kernel_tessellate::tessellate_spherical_face (cognitive 35) crates/vcad-kernel-tessellate/src/lib.rs:5139— vcad_kernel_tessellate::tessellate_spherical_face has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 7 (11 pts), match/switch 1 (2 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.
vcad_kernel_tessellate::reinsert_dropped_boundary (cognitive 35) crates/vcad-kernel-tessellate/src/lib.rs:5508— vcad_kernel_tessellate::reinsert_dropped_boundary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (21 pts), boolean chains 7, 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.
vcad_kernel_tessellate::tessellate_cone_sector_two_chain (cognitive 35) crates/vcad-kernel-tessellate/src/lib.rs:6536— vcad_kernel_tessellate::tessellate_cone_sector_two_chain has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 5, loops 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.
MethodTooLong: ConvertCtx.convert_solid crates/vcad-loon/src/convert.rs:2335— MethodTooLong — convert_solid runs 351 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 251 over it, 3.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Repl.execute crates/vcad-cli/src/repl.rs:81— MethodTooLong — execute runs 347 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 247 over it, 3.47× 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: FeatureInput.to_crdt_params crates/vcad-app/src/feature.rs:552— MethodTooLong — to_crdt_params runs 319 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PhysicsWorld.from_document_with_colliders crates/vcad-kernel-physics/src/world.rs:266— MethodTooLong — from_document_with_colliders runs 270 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 170 over it, 2.70× 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: Embedding.route crates/vcad-ecad-pcb/src/router/flow/embed.rs:397— MethodTooLong — route runs 250 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 150 over it, 2.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ReleasedOverlayView.viewport apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:997— MethodTooLong — viewport runs 246 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× 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: AssemblyReader.read_structure crates/vcad-kernel-step/src/assembly.rs:301— MethodTooLong — read_structure runs 228 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 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CommandRegistry.tsFallbackTools packages/core/src/commands/registry.ts:113— MethodTooLong — tsFallbackTools runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StepReader.read_solid crates/vcad-kernel-step/src/reader.rs:709— MethodTooLong — read_solid runs 224 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Server.handle_modern crates/vcad-mcp/src/server.rs:818— MethodTooLong — handle_modern runs 211 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 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Builder.build crates/vcad-ffi/src/features.rs:302— MethodTooLong — build runs 203 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 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DocumentCommands.body apple/VcadApp/Sources/VcadApp/Shell.swift:176— MethodTooLong — body runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DocumentCommands.body apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:176— MethodTooLong — body runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Problem.sample crates/vcad-eval/src/optimize.rs:1172— MethodTooLong — sample runs 195 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 95 over it, 1.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: UrdfWriter.node_to_geometry crates/vcad-kernel-urdf/src/writer.rs:187— MethodTooLong — node_to_geometry runs 186 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 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AccessMarket.build crates/vcad-ecad-pcb/src/router/flow/access.rs:195— MethodTooLong — build runs 185 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 85 over it, 1.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: InteractiveRouter.shortest_path crates/vcad-ecad-fabprep/src/verdict.rs:772— MethodTooLong — shortest_path runs 179 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 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayerCdt.build crates/vcad-ecad-pcb/src/router/flow/cdt.rs:532— MethodTooLong — build runs 179 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 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ReleasedARView.rebuild apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2149— MethodTooLong — rebuild runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LinearDimension.render crates/vcad-kernel-drafting/src/dimension/linear.rs:134— MethodTooLong — render runs 166 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FlowGraph.shortest crates/vcad-ecad-pcb/src/router/flow/flow.rs:881— MethodTooLong — shortest runs 162 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 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FeatureInput.from_crdt_params crates/vcad-app/src/feature.rs:964— MethodTooLong — from_crdt_params runs 161 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 61 over it, 1.61× 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: Proxy.spawn crates/vcad-mcp/src/proxy.rs:198— MethodTooLong — spawn runs 157 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GpuScene.from_brep crates/vcad-kernel-raytrace/src/gpu/buffers.rs:635— MethodTooLong — from_brep runs 153 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 53 over it, 1.53× 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: FlowGraph.build crates/vcad-ecad-pcb/src/router/flow/flow.rs:562— MethodTooLong — build runs 152 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 52 over it, 1.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.
Boundary violation [package:relative-cross-package] packages/app/public/launch/hero-worker.js:4— packages/app/public/launch/hero-worker.js:4 reaches into another package with a relative path (./kernel/vcad_kernel_wasm.js) — import the package by name instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:2— packages/app/src/components/AboutModal.tsx:2 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:3— packages/app/src/components/AboutModal.tsx:3 imports @phosphor-icons/react/dist/ssr/Cube, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:4— packages/app/src/components/AboutModal.tsx:4 imports @phosphor-icons/react/dist/ssr/PencilSimple, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:5— packages/app/src/components/AboutModal.tsx:5 imports @phosphor-icons/react/dist/ssr/FolderOpen, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:6— packages/app/src/components/AboutModal.tsx:6 imports @phosphor-icons/react/dist/ssr/Play, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:7— packages/app/src/components/AboutModal.tsx:7 imports @phosphor-icons/react/dist/ssr/GithubLogo, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:8— packages/app/src/components/AboutModal.tsx:8 imports @phosphor-icons/react/dist/ssr/Book, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AboutModal.tsx:9— packages/app/src/components/AboutModal.tsx:9 imports @phosphor-icons/react/dist/ssr/ChatCircle, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnalyzePanel.tsx:10— packages/app/src/components/AnalyzePanel.tsx:10 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnalyzePanel.tsx:11— packages/app/src/components/AnalyzePanel.tsx:11 imports @phosphor-icons/react/dist/ssr/Play, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnalyzePanel.tsx:12— packages/app/src/components/AnalyzePanel.tsx:12 imports @phosphor-icons/react/dist/ssr/Spinner, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnalyzePanel.tsx:13— packages/app/src/components/AnalyzePanel.tsx:13 imports @phosphor-icons/react/dist/ssr/Trash, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnalyzePanel.tsx:14— packages/app/src/components/AnalyzePanel.tsx:14 imports @phosphor-icons/react/dist/ssr/Plus, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnimationTimeline.tsx:11— packages/app/src/components/AnimationTimeline.tsx:11 imports @phosphor-icons/react/dist/ssr/Pause, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnimationTimeline.tsx:12— packages/app/src/components/AnimationTimeline.tsx:12 imports @phosphor-icons/react/dist/ssr/Play, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnimationTimeline.tsx:13— packages/app/src/components/AnimationTimeline.tsx:13 imports @phosphor-icons/react/dist/ssr/Repeat, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnimationTimeline.tsx:14— packages/app/src/components/AnimationTimeline.tsx:14 imports @phosphor-icons/react/dist/ssr/X, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/AnimationTimeline.tsx:15— packages/app/src/components/AnimationTimeline.tsx:15 imports @phosphor-icons/react/dist/ssr/FilmStrip, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/CommandPalette.tsx:4— packages/app/src/components/CommandPalette.tsx:4 imports @phosphor-icons/react/dist/ssr/Cube, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/CommandPalette.tsx:5— packages/app/src/components/CommandPalette.tsx:5 imports @phosphor-icons/react/dist/ssr/Cylinder, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/CommandPalette.tsx:6— packages/app/src/components/CommandPalette.tsx:6 imports @phosphor-icons/react/dist/ssr/Globe, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/CommandPalette.tsx:7— packages/app/src/components/CommandPalette.tsx:7 imports @phosphor-icons/react/dist/ssr/ArrowsOutCardinal, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/CommandPalette.tsx:8— packages/app/src/components/CommandPalette.tsx:8 imports @phosphor-icons/react/dist/ssr/ArrowClockwise, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/app/src/components/CommandPalette.tsx:9— packages/app/src/components/CommandPalette.tsx:9 imports @phosphor-icons/react/dist/ssr/ArrowsOut, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file mecheval/leaderboard/src/build.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/mcp/viewer-app/main.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/PropertyPanel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/FeatureTree.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/hooks/useToolDefinitions.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/App.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/wasmosis/src/cli.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/Header.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file mecheval/leaderboard/scripts/gen-task-refs.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file www/public/kit/gallery.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/AnalyzePanel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/SketchPropertyPanel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/CommandPalette.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/public/launch/launch.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/cam/OperationList.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/hooks/useAppCommands.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/DocumentPicker.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file www/src/hero-engine.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/SheetMetalView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/wasmosis/src/splitter.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/electronics/CircuitTabTools.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/lib/bootstrap.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/hooks/useKeyboardShortcuts.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/print/PrintPanel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/app/src/components/DfmDrawer.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
+ 15 more in this group — see findings.md.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×40
Recursive walk over a caller-supplied document has no depth cap packages/mcp/src/tools/document-solids.ts:156— `stableKey` is exported and takes `value: unknown` from its caller, and it calls itself at line 156 (`stableKey`) with a piece of `value` (and at line 160) — and nowhere in `stableKey` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stableKey` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/mcp/src/tools/registry-dispatch.ts:299— `canonicalJson` is exported and takes `v: unknown` from its caller, and it calls itself at line 299 (`canonicalJson`) with a piece of `v` (and at line 304) — and nowhere in `canonicalJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonicalJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/mcp/src/tools/registry-dispatch.ts:805— `sameUnderSerdeDefaults` is exported and takes `a: unknown` from its caller, and it calls itself at line 805 (`sameUnderSerdeDefaults`) with a piece of `a` (and at line 810) — and nowhere in `sameUnderSerdeDefaults` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sameUnderSerdeDefaults` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/mcp/src/fabricate/kerf/intent-hash.ts:16— `canonicalJson` is exported, takes a document from its caller (line 27) and hands it to `sortKeys`, which calls itself at line 16 (`sortKeys`) with a piece of `v` (and at line 20) — and nowhere in `sortKeys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sortKeys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/engine/src/expressions.ts:149— `freeVars` is exported, takes a document from its caller (line 138) and hands it to `walk`, which calls itself at line 149 (`walk`) with a piece of `a` (and at line 150, line 153, line 156) — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/core/src/utils/save-load.ts:226— `mapsToObjects` is exported and takes `value: unknown` from its caller, and it calls itself at line 226 (`mapsToObjects`) with a piece of `value` (and at line 229, line 232) — and nowhere in `mapsToObjects` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `mapsToObjects` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:98— `translate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 98 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `translate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:103— `rotate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 103 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `rotate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:108— `scale` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 108 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `scale` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:114— `chamfer` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 114 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `chamfer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:122— `fillet` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 122 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `fillet` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:130— `shell` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 130 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `shell` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:141— `linear_pattern` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 141 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `linear_pattern` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:160— `circular_pattern` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 160 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `circular_pattern` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-site-wasm/src/lib.rs:205— `volume` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 205 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `volume` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/expressions.rs:120— `try_from` is public and takes `w: &WireAst` from its caller, and it calls itself at line 120 with a piece of the document (and at line 121, line 129) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `try_from` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1221— `mirror` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1221 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `mirror` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:2062— `num_triangles` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 2062 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `num_triangles` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1979— `bounding_box` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1979 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `bounding_box` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1656— `translate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1656 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `translate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1664— `rotate` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1664 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `rotate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1672— `scale` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1672 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `scale` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1689— `chamfer` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1689 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `chamfer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1727— `edge_blend` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1727 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `edge_blend` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/vcad-kernel-wasm/src/lib.rs:1743— `fillet` is public and takes a `Solid` as its receiver from its caller, and it calls itself at line 1743 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `fillet` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
+ 15 more in this group — see findings.md.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×40
Symbol treated as nullable, then dereferenced unguarded mecheval/graders/src/suite_c.rs:99— `doc.instances.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `check_body_valid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded mecheval/graders/src/bin/grade.rs:49— `serde_json::to_string_pretty(&blob)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded mecheval/graders/src/bin/inspect-topo.rs:10— `std::env::args().nth(1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded mecheval/graders/src/bin/inspect-topo.rs:11— `std::fs::read_to_string(&path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/fidelity.rs:314— `rows.iter().find(|c|c.arrangement==arrangement)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `to_markdown` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:74— `serde_json::to_string(&result)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run_case` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:188— `std::env::current_exe()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:221— `results.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:238— `serde_json::to_string_pretty(&card)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:238— `std::fs::write(path,serde_json::to_string_pretty(&card).unwrap())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:241— `serde_json::to_string_pretty(&card)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:242— `std::fs::write(path,serde_json::to_string_pretty(&card).unwrap())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:250— `std::fs::OpenOptions::new().create(true).append(true).open(path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:251— `writeln!(f,"## Kernel torture track ({subset} subset)\n")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:252— `writeln!(f,"{}",card.to_markdown())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:258— `std::fs::read_to_string(path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-torture/src/main.rs:259— `serde_json::from_str(&std::fs::read_to_string(path).expect("read --baseline"))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded REDACTED:126— `ch.to_lowercase().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `to_snake_case` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded REDACTED:195— `field.ident.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded REDACTED:208— `prop.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded REDACTED:229— `schema["properties"].as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded REDACTED:234— `schema.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `build_fields_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-sound/src/lib.rs:69— `vcad_ir::materials::resolve_def("aluminum_6061",None)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `fallback_aluminium` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-sound/src/lib.rs:70— `SoundMaterial::from_resolved(&m)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `fallback_aluminium` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/vcad-slicer-bambu/src/tls.rs:87— `rustls::ClientConfig::builder_with_provider(Arc::new(rustls::crypto::ring::default_provider(),)).with_safe_default_protocol_versions()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `printer_client_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
+ 15 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×39
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:2117— apple/VcadApp/Sources/VcadApp/Editor.swift:2117-2120 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2117-2120 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Shell.swift:1095— apple/VcadApp/Sources/VcadApp/Shell.swift:1095-1098 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:1095-1098 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/vcad-kernel-tessellate/src/manifold.rs:211— crates/vcad-kernel-tessellate/src/manifold.rs:211-214 | crates/vcad-parts/src/vacuum/mod.rs:499-504 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:2138— apple/VcadApp/Sources/VcadApp/Editor.swift:2138-2141 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2138-2141 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:3808— apple/VcadApp/Sources/VcadApp/Editor.swift:3808-3811 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3808-3811 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1754— apple/VcadApp/Sources/VcadApp/Editor.swift:1754-1757 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1754-1757 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:3037— apple/VcadApp/Sources/VcadApp/Editor.swift:3037-3040 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3037-3040 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Sim.swift:92— apple/VcadApp/Sources/VcadApp/Sim.swift:92-95 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:92-95 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1377— apple/VcadApp/Sources/VcadApp/Editor.swift:1377-1380 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1377-1380 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1513— apple/VcadApp/Sources/VcadApp/Editor.swift:1513-1516 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1513-1516 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1501— apple/VcadApp/Sources/VcadApp/Editor.swift:1501-1504 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1501-1504 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:4776— apple/VcadApp/Sources/VcadApp/Editor.swift:4776-4779 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4776-4779 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/FabricatePanel.swift:104— apple/VcadApp/Sources/VcadApp/FabricatePanel.swift:104-107 | apple/VcadApp/Sources/VcadApp/FabricatePanel.swift:109-112 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:166— apple/VcadApp/Sources/VcadApp/Document.swift:166-169 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:166-169 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:199— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:199-202 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:199-202 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1039— apple/VcadApp/Sources/VcadApp/Editor.swift:1039-1042 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1039-1042 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:3110— apple/VcadApp/Sources/VcadApp/Editor.swift:3110-3113 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3110-3113 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1426— apple/VcadApp/Sources/VcadApp/Editor.swift:1426-1429 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1426-1429 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/SimController.swift:456— apple/VcadApp/Sources/VcadApp/SimController.swift:456-459 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:456-459 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Shell.swift:807— apple/VcadApp/Sources/VcadApp/Shell.swift:807-810 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:807-810 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1850— apple/VcadApp/Sources/VcadApp/Editor.swift:1850-1853 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1850-1853 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/VisionShell.swift:122— apple/VcadApp/Sources/VcadApp/VisionShell.swift:122-125 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:122-125 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1199— apple/VcadApp/Sources/VcadApp/Editor.swift:1199-1202 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1199-1202 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:3875— apple/VcadApp/Sources/VcadApp/Editor.swift:3875-3878 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3875-3878 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) apple/VcadApp/Sources/VcadApp/Sim.swift:339— apple/VcadApp/Sources/VcadApp/Sim.swift:339-342 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:339-342 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Configuration option is read nowhere crates/vcad-app/src/parity.rs:46— `Expect.hash` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:118— `Commands::Export.strict_brep` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:137— `Commands::Route.blind_vias` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:155— `Commands::Route.only` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:161— `Commands::Route.escape` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:165— `Commands::Route.explain_pours` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:206— `Commands::ImportUrdf.relative_meshes` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:223— `Commands::Features.min_count` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:333— `Commands::Boolean.part_a` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:335— `Commands::Boolean.part_b` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:341— `Commands::Boolean.result_name` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:503— `Commands::Simulate.log_every` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:552— `Commands::Slice.smart` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:555— `Commands::Slice.explain` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:577— `Commands::Dfm.pack` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:613— `Commands::Check.allow_bridge` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-cli/src/main.rs:698— `Commands::Probe.quiet` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-eval/src/optimize.rs:553— `EvalCost.base_eval_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/file_io.rs:424— `LegacyVcadFile.consumed_parts` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/file_io.rs:428— `LegacyVcadFile.next_part_num` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/file_io.rs:430— `LegacyVcadFile.loon_source` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/lib.rs:765— `FillParams.fill_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/lib.rs:769— `FillParams.density_mm` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/lib.rs:771— `FillParams.underlay` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/vcad-ir/src/lib.rs:773— `FillParams.max_stitch_length_mm` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
vcad_kernel_booleans::pipeline::brep_boolean (cyclomatic 144) crates/vcad-kernel-booleans/src/pipeline.rs:1283— vcad_kernel_booleans::pipeline::brep_boolean has cyclomatic complexity 144 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_booleans::classify::face_sample_point (cyclomatic 101) crates/vcad-kernel-booleans/src/classify.rs:101— vcad_kernel_booleans::classify::face_sample_point has cyclomatic complexity 101 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_booleans::trim::point_in_face_inner (cyclomatic 81) crates/vcad-kernel-booleans/src/trim.rs:149— vcad_kernel_booleans::trim::point_in_face_inner has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_booleans::split::split_face_by_curve (cyclomatic 56) crates/vcad-kernel-booleans/src/split.rs:334— vcad_kernel_booleans::split::split_face_by_curve has cyclomatic complexity 56 (threshold 15). Of this number, 54 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.
vcad_kernel_booleans::pipeline::apply_splits_to_solid (cyclomatic 50) crates/vcad-kernel-booleans/src/pipeline.rs:774— vcad_kernel_booleans::pipeline::apply_splits_to_solid 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.
vcad_kernel_booleans::split::clip_spherical_face_by_circle (cyclomatic 50) crates/vcad-kernel-booleans/src/split.rs:4055— vcad_kernel_booleans::split::clip_spherical_face_by_circle 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.
vcad_kernel_booleans::api::boolean_op_reported_untimed (cyclomatic 49) crates/vcad-kernel-booleans/src/api.rs:369— vcad_kernel_booleans::api::boolean_op_reported_untimed 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.
vcad_kernel_booleans::split::split_planar_face_by_circle (cyclomatic 46) crates/vcad-kernel-booleans/src/split.rs:1344— vcad_kernel_booleans::split::split_planar_face_by_circle 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.
vcad_kernel_booleans::trim::trim_curve_to_face (cyclomatic 43) crates/vcad-kernel-booleans/src/trim.rs:905— vcad_kernel_booleans::trim::trim_curve_to_face 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.
vcad_kernel_booleans::split::split_conical_face_by_ruling (cyclomatic 41) crates/vcad-kernel-booleans/src/split.rs:4795— vcad_kernel_booleans::split::split_conical_face_by_ruling 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.
vcad_kernel_booleans::cyl_band::split_cylindrical_face_by_patch (cyclomatic 38) crates/vcad-kernel-booleans/src/cyl_band.rs:2331— vcad_kernel_booleans::cyl_band::split_cylindrical_face_by_patch 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.
vcad_kernel_booleans::split::split_planar_face_by_arc (cyclomatic 36) crates/vcad-kernel-booleans/src/split.rs:2708— vcad_kernel_booleans::split::split_planar_face_by_arc has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
vcad_kernel_booleans::split::split_planar_face_by_multi_arc (cyclomatic 36) crates/vcad-kernel-booleans/src/split.rs:3188— vcad_kernel_booleans::split::split_planar_face_by_multi_arc 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.
vcad_kernel_booleans::cyl_band::try_parse_two_chain (cyclomatic 35) crates/vcad-kernel-booleans/src/cyl_band.rs:578— vcad_kernel_booleans::cyl_band::try_parse_two_chain 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.
vcad_kernel_booleans::ssi::intersect_surfaces (cyclomatic 31) crates/vcad-kernel-booleans/src/ssi.rs:87— vcad_kernel_booleans::ssi::intersect_surfaces has cyclomatic complexity 31 (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.
vcad_kernel_booleans::split::split_dense_conical_band_by_circle (cyclomatic 27) crates/vcad-kernel-booleans/src/split.rs:5142— vcad_kernel_booleans::split::split_dense_conical_band_by_circle 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.
vcad_kernel_booleans::freeze::rechain_rim (cyclomatic 26) crates/vcad-kernel-booleans/src/freeze.rs:391— vcad_kernel_booleans::freeze::rechain_rim 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.
vcad_kernel_booleans::bbox::face_aabb (cyclomatic 25) crates/vcad-kernel-booleans/src/bbox.rs:159— vcad_kernel_booleans::bbox::face_aabb 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.
vcad_kernel_booleans::repair::split_edges_at_interior_vertices_impl (cyclomatic 25) crates/vcad-kernel-booleans/src/repair.rs:139— vcad_kernel_booleans::repair::split_edges_at_interior_vertices_impl 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.
vcad_kernel_booleans::classify::find_coincident_classification (cyclomatic 24) crates/vcad-kernel-booleans/src/classify.rs:1004— vcad_kernel_booleans::classify::find_coincident_classification 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.
vcad_kernel_booleans::split::merge_crossed_hole (cyclomatic 24) crates/vcad-kernel-booleans/src/split.rs:190— vcad_kernel_booleans::split::merge_crossed_hole 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.
vcad_kernel_booleans::split::merge_circle_with_crossing_hole (cyclomatic 24) crates/vcad-kernel-booleans/src/split.rs:2327— vcad_kernel_booleans::split::merge_circle_with_crossing_hole 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.
vcad_kernel_booleans::cyl_band::split_band_by_profile (cyclomatic 23) crates/vcad-kernel-booleans/src/cyl_band.rs:905— vcad_kernel_booleans::cyl_band::split_band_by_profile 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.
vcad_kernel_booleans::cyl_band::extract_regions (cyclomatic 23) crates/vcad-kernel-booleans/src/cyl_band.rs:1041— vcad_kernel_booleans::cyl_band::extract_regions 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.
vcad_kernel_booleans::freeze::freeze_circle_loops (cyclomatic 23) crates/vcad-kernel-booleans/src/freeze.rs:105— vcad_kernel_booleans::freeze::freeze_circle_loops 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.
Duplicated block (13 lines × 2) crates/vcad-cli/src/main.rs:2611— crates/vcad-cli/src/main.rs:2611-2623 | crates/vcad-cli/src/main.rs:2639-2651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/main.rs:2611` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-ecad-pcb/src/pour_synth.rs:260— crates/vcad-ecad-pcb/src/pour_synth.rs:260-272 | crates/vcad-ecad-pcb/src/router/auto.rs:3923-3935 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:917— crates/vcad-ecad-pcb/src/router/sco.rs:917-929 | crates/vcad-ecad-pcb/src/router/sco.rs:953-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ecad-pcb/src/router/sco.rs:916` calls `cholesky_apply` and `crates/vcad-ecad-pcb/src/router/sco.rs:952` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/vcad-ecad-symbols/src/footprint.rs:1486— crates/vcad-ecad-symbols/src/footprint.rs:1486-1498 | crates/vcad-ecad-symbols/src/footprint.rs:1556-1568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/footprint.rs:1486` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-eval/src/cavity_extract.rs:336— crates/vcad-eval/src/cavity_extract.rs:336-348 | crates/vcad-eval/src/sim_extract.rs:364-376 — before extracting anything, compare `crates/vcad-eval/src/cavity_extract.rs` and `crates/vcad-eval/src/sim_extract.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/cavity_extract.rs:336` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-ffi/src/lib.rs:372— crates/vcad-ffi/src/lib.rs:372-384 | crates/vcad-ffi/src/lib.rs:423-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:372` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-ffi/src/print.rs:359— crates/vcad-ffi/src/print.rs:359-371 | crates/vcad-slicer/src/orient.rs:92-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/print.rs:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-booleans/src/pipeline.rs:2343— crates/vcad-kernel-booleans/src/pipeline.rs:2343-2355 | crates/vcad-kernel-booleans/src/pipeline.rs:2357-2369 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-booleans/src/split.rs:5054— crates/vcad-kernel-booleans/src/split.rs:5054-5066 | crates/vcad-kernel-booleans/src/split.rs:6266-6278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:5054` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-fillet/src/chamfer.rs:116— crates/vcad-kernel-fillet/src/chamfer.rs:116-128 | crates/vcad-kernel-fillet/src/fillet_planar.rs:202-214 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_planar.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 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) crates/vcad-kernel-gpu/src/wavefront.rs:329— crates/vcad-kernel-gpu/src/wavefront.rs:329-341 | crates/vcad-kernel-gpu/src/wavefront.rs:684-696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-gpu/src/wavefront.rs:329` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-naming/src/lib.rs:377— crates/vcad-kernel-naming/src/lib.rs:377-389 | crates/vcad-kernel-naming/src/profile.rs:163-175 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-naming/src/lib.rs:377` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:4722— crates/vcad-kernel-tessellate/src/lib.rs:4722-4734 | crates/vcad-kernel-tessellate/src/lib.rs:5040-5053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:4722` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:8200— crates/vcad-kernel-tessellate/src/lib.rs:8200-8212 | crates/vcad-kernel-tessellate/src/lib.rs:8240-8252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:8200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-text/src/glyph.rs:76— crates/vcad-kernel-text/src/glyph.rs:76-88 | crates/vcad-kernel-text/src/glyph.rs:109-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-text/src/glyph.rs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-render/src/lib.rs:5128— crates/vcad-render/src/lib.rs:5128-5140 | crates/vcad-render/src/lib.rs:5248-5260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/lib.rs:5128` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-booleans/src/split.rs:6818— crates/vcad-kernel-booleans/src/split.rs:6818-6830 | crates/vcad-kernel-booleans/src/split.rs:6834-6846 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-tessellate/src/lib.rs:1992— crates/vcad-kernel-tessellate/src/lib.rs:1992-2004 | crates/vcad-kernel-tessellate/src/lib.rs:8809-8821 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-tessellate/src/lib.rs:4709— crates/vcad-kernel-tessellate/src/lib.rs:4709-4721 | crates/vcad-kernel-tessellate/src/lib.rs:5022-5034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) crates/vcad-ir/src/vcode.rs:2559— crates/vcad-ir/src/vcode.rs:2559-2571 | crates/vcad-ir/src/vcode.rs:2719-2732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:2559` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) crates/vcad-cli/src/app.rs:692— crates/vcad-cli/src/app.rs:692-704 | crates/vcad-cli/src/app.rs:730-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:692` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:140— crates/vcad-kernel-tessellate/src/lib.rs:140-152 | crates/vcad-kernel-tessellate/src/lib.rs:679-691 — both copies are in the same file, so extract the block into 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) crates/vcad-ir/src/file_io.rs:451— crates/vcad-ir/src/file_io.rs:451-463 | crates/vcad-ir/src/file_io.rs:469-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/file_io.rs:451` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2745— apple/VcadApp/Sources/VcadApp/Editor.swift:2745-2757 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2745-2757 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3317— apple/VcadApp/Sources/VcadApp/Editor.swift:3317-3329 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3317-3329 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14 lines × 2) crates/vcad-app/src/engine.rs:279— crates/vcad-app/src/engine.rs:279-292 | crates/vcad-cli/src/app.rs:1079-1092 — before extracting anything, compare `crates/vcad-app/src/engine.rs` and `crates/vcad-cli/src/app.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) crates/vcad-app/src/migrate.rs:503— crates/vcad-app/src/migrate.rs:503-516 | crates/vcad-app/src/migrate.rs:586-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/migrate.rs:503` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crates/vcad-ecad-pcb/src/router/auto.rs:5020— crates/vcad-ecad-pcb/src/router/auto.rs:5020-5033 | crates/vcad-render/src/pcb.rs:1044-1057 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/auto.rs:5020` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-render/src/pcb.rs:1041` calls `is_empty` and `crates/vcad-ecad-pcb/src/router/auto.rs:5019` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) crates/vcad-eval/src/sensitivity.rs:273— crates/vcad-eval/src/sensitivity.rs:273-286 | crates/vcad-eval/src/sensitivity.rs:361-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/vcad-ir/src/vcode.rs:1122— crates/vcad-ir/src/vcode.rs:1122-1135 | crates/vcad-ir/src/vcode.rs:1162-1175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-acoustics/src/receipt.rs:398— crates/vcad-kernel-acoustics/src/receipt.rs:398-411 | crates/vcad-kernel-particle/src/receipt.rs:547-560 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-particle/src/receipt.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:398` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:849— crates/vcad-kernel-booleans/src/classify.rs:849-862 | crates/vcad-kernel-booleans/src/classify.rs:864-877 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-booleans/src/pipeline.rs:838— crates/vcad-kernel-booleans/src/pipeline.rs:838-851 | crates/vcad-kernel-booleans/src/pipeline.rs:871-884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/pipeline.rs:838` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5565— crates/vcad-kernel-booleans/src/split.rs:5565-5578 | crates/vcad-kernel-booleans/src/split.rs:6064-6077 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-diff/src/synthesize.rs:300— crates/vcad-kernel-diff/src/synthesize.rs:300-313 | crates/vcad-kernel-diff/src/synthesize.rs:405-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/synthesize.rs:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-drafting/src/section.rs:442— crates/vcad-kernel-drafting/src/section.rs:442-455 | crates/vcad-kernel-drafting/src/section.rs:555-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/section.rs:442` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-fea/src/graph.rs:86— crates/vcad-kernel-fea/src/graph.rs:86-99 | crates/vcad-kernel-thermal/src/graph.rs:654-667 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/graph.rs:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-gpu/src/decimate.rs:116— crates/vcad-kernel-gpu/src/decimate.rs:116-129 | crates/vcad-kernel-gpu/src/normals.rs:76-89 — before extracting anything, compare `crates/vcad-kernel-gpu/src/decimate.rs` and `crates/vcad-kernel-gpu/src/normals.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-gpu/src/decimate.rs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-kernel-step/src/entities/curves.rs:269— crates/vcad-kernel-step/src/entities/curves.rs:269-282 | crates/vcad-kernel-step/src/entities/surfaces.rs:443-456 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-step/src/entities/curves.rs:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:2159— crates/vcad-kernel-wasm/src/lib.rs:2159-2172 | crates/vcad-kernel-wasm/src/lib.rs:2667-2680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:2159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) mecheval/graders/src/fit.rs:396— mecheval/graders/src/fit.rs:396-409 | mecheval/graders/src/fit_physics.rs:176-189 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/vcad-kernel-particle/src/poisson.rs:260— crates/vcad-kernel-particle/src/poisson.rs:260-273 | crates/vcad-kernel-particle/src/space_charge.rs:196-209 — before extracting anything, compare `crates/vcad-kernel-particle/src/poisson.rs` and `crates/vcad-kernel-particle/src/space_charge.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-particle/src/poisson.rs:260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-ecad-pcb/src/router/length_match.rs:116— crates/vcad-ecad-pcb/src/router/length_match.rs:116-129 | crates/vcad-ecad-pcb/src/router/length_match.rs:634-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/length_match.rs:116` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crates/vcad-kernel-em/src/axisym.rs:861— crates/vcad-kernel-em/src/axisym.rs:861-874 | crates/vcad-kernel-em/src/axisym.rs:890-903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:861` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/vcad-ecad-symbols/src/kicad_board.rs:401— crates/vcad-ecad-symbols/src/kicad_board.rs:401-414 | crates/vcad-ffi/src/lib.rs:1879-1892 — 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) crates/vcad-ffi/src/cam.rs:194— crates/vcad-ffi/src/cam.rs:194-207 | crates/vcad-ffi/src/cam_job.rs:529-542 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/cam.rs:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) apple/VcadApp/Sources/VcadApp/Chime.swift:22— apple/VcadApp/Sources/VcadApp/Chime.swift:22-35 | apple/VcadVision/Sources/VcadVision/Shared/Chime.swift:22-35 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Chime.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Chime.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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) apple/VcadApp/Sources/VcadApp/Editor.swift:347— apple/VcadApp/Sources/VcadApp/Editor.swift:347-360 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:347-360 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1586— apple/VcadApp/Sources/VcadApp/Editor.swift:1586-1599 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1586-1599 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3669— apple/VcadApp/Sources/VcadApp/Editor.swift:3669-3682 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3669-3682 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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.
vcad::input::handle_key (cognitive 107) crates/vcad-cli/src/input.rs:651— vcad::input::handle_key has cognitive complexity 107 (threshold 15). Drivers by points: if/else 31 (81 pts), match/switch 8 (17 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 63). 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.
vcad::route_file (cognitive 99) crates/vcad-cli/src/main.rs:1736— vcad::route_file has cognitive complexity 99 (threshold 15). Drivers by points: if/else 36 (61 pts), loops 16 (27 pts), boolean chains 9, match/switch 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad::ui::chat::draw_chat (cognitive 73) crates/vcad-cli/src/ui/chat.rs:165— vcad::ui::chat::draw_chat has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 16 (33 pts), match/switch 1 (3 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.
vcad::stitch_to_planes (cognitive 69) crates/vcad-cli/src/main.rs:4642— vcad::stitch_to_planes has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (55 pts), loops 4 (10 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad::input::handle_mouse (cognitive 68) crates/vcad-cli/src/input.rs:345— vcad::input::handle_mouse has cognitive complexity 68 (threshold 15). Drivers by points: if/else 26 (61 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 38). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad::ui::command::render_palette (cognitive 53) crates/vcad-cli/src/ui/command.rs:37— vcad::ui::command::render_palette has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 12 (25 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad::slice_file (cognitive 43) crates/vcad-cli/src/main.rs:3562— vcad::slice_file has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (13 pts), match/switch 2 (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.
vcad::ui::viewport::render_viewport_braille (cognitive 43) crates/vcad-cli/src/ui/viewport.rs:43— vcad::ui::viewport::render_viewport_braille has cognitive complexity 43 (threshold 15). Drivers by points: if/else 4 (21 pts), match/switch 2 (11 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad::direct_links (cognitive 38) crates/vcad-cli/src/main.rs:4504— vcad::direct_links has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 3 (6 pts), boolean chains 3 (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.
vcad::ui::tree::render_sidebar (cognitive 38) crates/vcad-cli/src/ui/tree.rs:35— vcad::ui::tree::render_sidebar has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 9 (13 pts), boolean chains 3 (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.
vcad::plan_bga_escapes (cognitive 37) crates/vcad-cli/src/main.rs:1512— vcad::plan_bga_escapes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 6 (11 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.
vcad::anchor_track_ends (cognitive 37) crates/vcad-cli/src/main.rs:4403— vcad::anchor_track_ends has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 6 (9 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad::ui::welcome::render_card (cognitive 37) crates/vcad-cli/src/ui/welcome.rs:40— vcad::ui::welcome::render_card has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 10 (16 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.
vcad::ui::toolbar::draw_toolbar (cognitive 35) crates/vcad-cli/src/ui/toolbar.rs:364— vcad::ui::toolbar::draw_toolbar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 5 (8 pts), boolean chains 4 (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.
vcad::app::run_loop (cognitive 31) crates/vcad-cli/src/app.rs:1465— vcad::app::run_loop has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 5 (12 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.
vcad::input::hit_test (cognitive 28) crates/vcad-cli/src/input.rs:73— vcad::input::hit_test has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4 (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.
vcad::floating_floor_area (cognitive 27) crates/vcad-cli/src/main.rs:2442— vcad::floating_floor_area has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (7 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.
vcad::ui::toolbar::render_sub_tools_flush (cognitive 26) crates/vcad-cli/src/ui/toolbar.rs:527— vcad::ui::toolbar::render_sub_tools_flush has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad::ui::status::draw_cursor_segment (cognitive 24) crates/vcad-cli/src/ui/status.rs:165— vcad::ui::status::draw_cursor_segment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 pts), match/switch 2 (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.
vcad::restore_layer_change_vias (cognitive 23) crates/vcad-cli/src/main.rs:4818— vcad::restore_layer_change_vias has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (9 pts), boolean chains 4 (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.
vcad::ui::menu::draw_open_menu (cognitive 23) crates/vcad-cli/src/ui/menu.rs:396— vcad::ui::menu::draw_open_menu has cognitive complexity 23 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 5 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). 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.
vcad::recognize_features (cognitive 22) crates/vcad-cli/src/main.rs:2810— vcad::recognize_features has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 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.
vcad::trim_leaf_copper (cognitive 22) crates/vcad-cli/src/main.rs:4961— vcad::trim_leaf_copper has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 7, loops 4 (6 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.
vcad::input::handle_tool_input_key (cognitive 21) crates/vcad-cli/src/input.rs:560— vcad::input::handle_tool_input_key has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, match/switch 2 (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.
vcad::run_command (cognitive 20) crates/vcad-cli/src/main.rs:827— vcad::run_command has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_tessellate::tessellate_trimmed_region (cyclomatic 74) crates/vcad-kernel-tessellate/src/lib.rs:7422— vcad_kernel_tessellate::tessellate_trimmed_region 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.
vcad_kernel_tessellate::tessellate_cylindrical_face (cyclomatic 61) crates/vcad-kernel-tessellate/src/lib.rs:4186— vcad_kernel_tessellate::tessellate_cylindrical_face 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.
vcad_kernel_tessellate::fill_closed_boundary_loops (cyclomatic 57) crates/vcad-kernel-tessellate/src/lib.rs:1427— vcad_kernel_tessellate::fill_closed_boundary_loops has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_tessellate::torus_two_chain_rotated (cyclomatic 49) crates/vcad-kernel-tessellate/src/lib.rs:6849— vcad_kernel_tessellate::torus_two_chain_rotated 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.
vcad_kernel_tessellate::tessellate_ruled_two_chain (cyclomatic 46) crates/vcad-kernel-tessellate/src/lib.rs:4752— vcad_kernel_tessellate::tessellate_ruled_two_chain has cyclomatic complexity 46 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
vcad_kernel_tessellate::heal_t_junctions_pass (cyclomatic 43) crates/vcad-kernel-tessellate/src/lib.rs:978— vcad_kernel_tessellate::heal_t_junctions_pass 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.
vcad_kernel_tessellate::prune_redundant_patches (cyclomatic 38) crates/vcad-kernel-tessellate/src/lib.rs:1787— vcad_kernel_tessellate::prune_redundant_patches 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.
vcad_kernel_tessellate::tessellate_spherical_region (cyclomatic 32) crates/vcad-kernel-tessellate/src/lib.rs:5596— vcad_kernel_tessellate::tessellate_spherical_region 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.
vcad_kernel_tessellate::frozen::capture_plan (cyclomatic 30) crates/vcad-kernel-tessellate/src/frozen.rs:935— vcad_kernel_tessellate::frozen::capture_plan has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
vcad_kernel_tessellate::manifold::clean_pass (cyclomatic 29) crates/vcad-kernel-tessellate/src/manifold.rs:484— vcad_kernel_tessellate::manifold::clean_pass 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.
vcad_kernel_tessellate::fill_tiny_boundary_loops (cyclomatic 28) crates/vcad-kernel-tessellate/src/lib.rs:2181— vcad_kernel_tessellate::fill_tiny_boundary_loops 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.
vcad_kernel_tessellate::triangulate_circular_cap_with_holes (cyclomatic 28) crates/vcad-kernel-tessellate/src/lib.rs:3932— vcad_kernel_tessellate::triangulate_circular_cap_with_holes 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.
vcad_kernel_tessellate::collapse_short_defective_edges (cyclomatic 28) crates/vcad-kernel-tessellate/src/lib.rs:8773— vcad_kernel_tessellate::collapse_short_defective_edges 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.
vcad_kernel_tessellate::tessellate_cone_sector_two_chain (cyclomatic 26) crates/vcad-kernel-tessellate/src/lib.rs:6536— vcad_kernel_tessellate::tessellate_cone_sector_two_chain 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.
vcad_kernel_tessellate::frozen::evaluate_plan_impl (cyclomatic 26) crates/vcad-kernel-tessellate/src/frozen.rs:1199— vcad_kernel_tessellate::frozen::evaluate_plan_impl 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.
vcad_kernel_tessellate::refill_defective_neighborhoods (cyclomatic 24) crates/vcad-kernel-tessellate/src/lib.rs:1981— vcad_kernel_tessellate::refill_defective_neighborhoods 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.
vcad_kernel_tessellate::tessellate_conical_face (cyclomatic 23) crates/vcad-kernel-tessellate/src/lib.rs:6323— vcad_kernel_tessellate::tessellate_conical_face 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.
vcad_kernel_tessellate::delaunay_flip (cyclomatic 22) crates/vcad-kernel-tessellate/src/lib.rs:5305— vcad_kernel_tessellate::delaunay_flip 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.
vcad_kernel_tessellate::tessellate_toroidal_face (cyclomatic 22) crates/vcad-kernel-tessellate/src/lib.rs:7121— vcad_kernel_tessellate::tessellate_toroidal_face 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.
vcad_kernel_tessellate::ear_clip_triangulate (cyclomatic 21) crates/vcad-kernel-tessellate/src/lib.rs:3628— vcad_kernel_tessellate::ear_clip_triangulate 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.
vcad_kernel_tessellate::tessellate_small_arc_fan (cyclomatic 20) crates/vcad-kernel-tessellate/src/lib.rs:4631— vcad_kernel_tessellate::tessellate_small_arc_fan 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.
vcad_kernel_tessellate::refine_outer_polygon_for_holes (cyclomatic 19) crates/vcad-kernel-tessellate/src/lib.rs:3325— vcad_kernel_tessellate::refine_outer_polygon_for_holes 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.
vcad_kernel_tessellate::tessellate_spherical_face (cyclomatic 19) crates/vcad-kernel-tessellate/src/lib.rs:5139— vcad_kernel_tessellate::tessellate_spherical_face 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.
vcad_kernel_tessellate::flip_sliver_triangles (cyclomatic 19) crates/vcad-kernel-tessellate/src/lib.rs:5415— vcad_kernel_tessellate::flip_sliver_triangles 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.
vcad_kernel_tessellate::mesh_ray::strip_membranes_once (cyclomatic 19) crates/vcad-kernel-tessellate/src/mesh_ray.rs:399— vcad_kernel_tessellate::mesh_ray::strip_membranes_once 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.
Focus outline removed inline packages/app/src/components/CommandPalette.tsx:429— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/DimensionOverlay.tsx:111— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/DocTitle.tsx:119— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/DocTitle.tsx:203— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/DocTitle.tsx:235— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/DocumentPicker.tsx:136— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/FeedbackModal.tsx:54— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/Header.tsx:471— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/KeyboardPrefsPanel.tsx:131— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/ParametersPanel.tsx:343— <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/PropertyPanel.tsx:519— <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/QuotePanel.tsx:321— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/ReadOnlyBanner.tsx:45— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/SceneInspector.tsx:107— <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/SceneMesh.tsx:1059— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/NewPcbDialog.tsx:135— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/NewPcbDialog.tsx:149— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/NewPcbDialog.tsx:186— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/NewPcbDialog.tsx:213— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/NewPcbDialog.tsx:227— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/TextDialog.tsx:58— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/TextDialog.tsx:72— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/dialogs/TextDialog.tsx:88— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/embroidery/EmbroideryPanel.tsx:164— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/components/embroidery/EmbroideryProperties.tsx:95— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
vcad_eval::evaluate::evaluate_inner (cognitive 219) crates/vcad-eval/src/evaluate.rs:131— vcad_eval::evaluate::evaluate_inner has cognitive complexity 219 (threshold 15). Drivers by points: if/else 54 (144 pts), match/switch 20 (47 pts), loops 9 (21 pts), boolean chains 7 (nesting depth added 129). 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.
vcad_eval::evaluate::evaluate_op_timed (cognitive 171) crates/vcad-eval/src/evaluate.rs:1120— vcad_eval::evaluate::evaluate_op_timed has cognitive complexity 171 (threshold 15). Drivers by points: if/else 31 (95 pts), loops 16 (43 pts), match/switch 11 (30 pts), boolean chains 3 (nesting depth added 110). 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.
vcad_eval::cavity_extract::extract_cavity (cognitive 159) crates/vcad-eval/src/cavity_extract.rs:687— vcad_eval::cavity_extract::extract_cavity has cognitive complexity 159 (threshold 15). Drivers by points: if/else 56 (84 pts), loops 22 (37 pts), boolean chains 20, match/switch 10 (18 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::antenna_extract::extract_antenna_spec (cognitive 92) crates/vcad-eval/src/antenna_extract.rs:338— vcad_eval::antenna_extract::extract_antenna_spec has cognitive complexity 92 (threshold 15). Drivers by points: if/else 39 (58 pts), loops 14 (18 pts), boolean chains 14, match/switch 2 (nesting depth added 23). Of this number, 91 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.
vcad_eval::optimize::optimize_document (cognitive 73) crates/vcad-eval/src/optimize.rs:1565— vcad_eval::optimize::optimize_document has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (49 pts), loops 9 (16 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::sim_extract::em::extract_axisym_mag_spec_from_scene (cognitive 66) crates/vcad-eval/src/sim_extract/em.rs:493— vcad_eval::sim_extract::em::extract_axisym_mag_spec_from_scene has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 8 (15 pts), boolean chains 7, match/switch 3 (7 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.
vcad_eval::thermal_extract::extract_thermal_spec_from_scene (cognitive 62) crates/vcad-eval/src/thermal_extract.rs:1168— vcad_eval::thermal_extract::extract_thermal_spec_from_scene has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 14 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::pcb_preview::pcb_preview_meshes (cognitive 52) crates/vcad-eval/src/pcb_preview.rs:151— vcad_eval::pcb_preview::pcb_preview_meshes has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 15 (18 pts), match/switch 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.
vcad_eval::sim_extract::tolerance::measure_fit (cognitive 45) crates/vcad-eval/src/sim_extract/tolerance.rs:185— vcad_eval::sim_extract::tolerance::measure_fit has cognitive complexity 45 (threshold 15). Drivers by points: if/else 5 (23 pts), loops 5 (18 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::thermal_extract::part_box (cognitive 35) crates/vcad-eval/src/thermal_extract.rs:1447— vcad_eval::thermal_extract::part_box has cognitive complexity 35 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 5 (15 pts), boolean chains 3 (nesting depth added 20). 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.
vcad_eval::sim_extract::tolerance::extract_stackup_spec_from_scene (cognitive 34) crates/vcad-eval/src/sim_extract/tolerance.rs:351— vcad_eval::sim_extract::tolerance::extract_stackup_spec_from_scene has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 4 (9 pts), loops 2 (3 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.
vcad_eval::sim_extract::chamber_cavity (cognitive 32) crates/vcad-eval/src/sim_extract.rs:651— vcad_eval::sim_extract::chamber_cavity has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (7 pts), boolean chains 4, match/switch 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.
vcad_eval::evaluate::union_tree (cognitive 31) crates/vcad-eval/src/evaluate.rs:3129— vcad_eval::evaluate::union_tree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (3 pts), match/switch 1 (3 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.
vcad_eval::sensitivity::document_sensitivities (cognitive 31) crates/vcad-eval/src/sensitivity.rs:472— vcad_eval::sensitivity::document_sensitivities has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (9 pts), loops 2 (3 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.
vcad_eval::sim_extract::extract_device_spec_from_scene (cognitive 30) crates/vcad-eval/src/sim_extract.rs:902— vcad_eval::sim_extract::extract_device_spec_from_scene has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 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.
vcad_eval::cavity_extract::trace_passage (cognitive 29) crates/vcad-eval/src/cavity_extract.rs:638— vcad_eval::cavity_extract::trace_passage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (27 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.
vcad_eval::evaluate::evaluate_text_extrude (cognitive 29) crates/vcad-eval/src/evaluate.rs:2390— vcad_eval::evaluate::evaluate_text_extrude has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (9 pts), match/switch 2, 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.
vcad_eval::sim_extract::em::rev_section (cognitive 27) crates/vcad-eval/src/sim_extract/em.rs:262— vcad_eval::sim_extract::em::rev_section has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::step_doc::step_assembly_document (cognitive 26) crates/vcad-eval/src/step_doc.rs:97— vcad_eval::step_doc::step_assembly_document has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (3 pts), boolean chains 2, 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.
vcad_eval::sim_extract::wire_features (cognitive 24) crates/vcad-eval/src/sim_extract.rs:525— vcad_eval::sim_extract::wire_features has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (8 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.
vcad_eval::cavity_extract::measure (cognitive 23) crates/vcad-eval/src/cavity_extract.rs:434— vcad_eval::cavity_extract::measure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::thermal_extract::voxelize_part (cognitive 23) crates/vcad-eval/src/thermal_extract.rs:873— vcad_eval::thermal_extract::voxelize_part has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (21 pts), boolean chains 1, if/else 1 (nesting depth added 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.
vcad_eval::cache::root_fingerprint (cognitive 22) crates/vcad-eval/src/cache.rs:103— vcad_eval::cache::root_fingerprint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (7 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.
vcad_eval::sim_extract::em::section_annuli (cognitive 20) crates/vcad-eval/src/sim_extract/em.rs:367— vcad_eval::sim_extract::em::section_annuli has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 5 (7 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_eval::thermal_extract::thickness_p05 (cognitive 20) crates/vcad-eval/src/thermal_extract.rs:927— vcad_eval::thermal_extract::thickness_p05 has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (9 pts), boolean chains 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_ecad_symbols::footprint::match_family (cognitive 121) crates/vcad-ecad-symbols/src/footprint.rs:1757— vcad_ecad_symbols::footprint::match_family has cognitive complexity 121 (threshold 15). Drivers by points: if/else 60 (90 pts), boolean chains 27, loops 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.
vcad_ecad_symbols::altium::build_pcb (cognitive 103) crates/vcad-ecad-symbols/src/altium/mod.rs:468— vcad_ecad_symbols::altium::build_pcb has cognitive complexity 103 (threshold 15). Drivers by points: if/else 31 (80 pts), loops 7 (12 pts), match/switch 4 (7 pts), boolean chains 4 (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.
vcad_ecad_symbols::eagle_brd::parse_eagle_brd (cognitive 63) crates/vcad-ecad-symbols/src/eagle_brd.rs:19— vcad_ecad_symbols::eagle_brd::parse_eagle_brd has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 8 (13 pts), match/switch 3 (10 pts), boolean chains 1 (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.
vcad_ecad_symbols::kicad_write::auto_layout (cognitive 49) crates/vcad-ecad-symbols/src/kicad_write.rs:1854— vcad_ecad_symbols::kicad_write::auto_layout has cognitive complexity 49 (threshold 15). Drivers by points: loops 14 (25 pts), if/else 8 (22 pts), boolean chains 2 (nesting depth added 25). 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.
vcad_ecad_symbols::kicad_write::write_library_body (cognitive 38) crates/vcad-ecad-symbols/src/kicad_write.rs:649— vcad_ecad_symbols::kicad_write::write_library_body has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 2 (5 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 18). Of this number, 34 points are the body's own statements and 4 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.
vcad_ecad_symbols::kicad_sym::parse_symbol (cognitive 37) crates/vcad-ecad-symbols/src/kicad_sym.rs:238— vcad_ecad_symbols::kicad_sym::parse_symbol has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (25 pts), match/switch 2 (7 pts), loops 2 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_symbols::kicad_write::flip_sx (cognitive 37) crates/vcad-ecad-symbols/src/kicad_write.rs:798— vcad_ecad_symbols::kicad_write::flip_sx has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 3 (7 pts), loops 2 (6 pts), boolean chains 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.
vcad_ecad_symbols::footprint::match_power_family (cognitive 35) crates/vcad-ecad-symbols/src/footprint.rs:1665— vcad_ecad_symbols::footprint::match_power_family has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 10 (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.
vcad_ecad_symbols::kicad_write::net_stubs (cognitive 31) crates/vcad-ecad-symbols/src/kicad_write.rs:2086— vcad_ecad_symbols::kicad_write::net_stubs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (5 pts), match/switch 1 (3 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.
vcad_ecad_symbols::kicad_pcb::parse_stackup (cognitive 30) crates/vcad-ecad-symbols/src/kicad_pcb.rs:741— vcad_ecad_symbols::kicad_pcb::parse_stackup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 1 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
vcad_ecad_symbols::kicad_board::place_footprint (cognitive 27) crates/vcad-ecad-symbols/src/kicad_board.rs:133— vcad_ecad_symbols::kicad_board::place_footprint has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (5 pts), match/switch 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.
vcad_ecad_symbols::kicad_pcb::parse_declared_stackup (cognitive 27) crates/vcad-ecad-symbols/src/kicad_pcb.rs:812— vcad_ecad_symbols::kicad_pcb::parse_declared_stackup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 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.
vcad_ecad_symbols::kicad_board::place_designators (cognitive 25) crates/vcad-ecad-symbols/src/kicad_board.rs:708— vcad_ecad_symbols::kicad_board::place_designators has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_symbols::kicad_board::board_from_sheet (cognitive 24) crates/vcad-ecad-symbols/src/kicad_board.rs:428— vcad_ecad_symbols::kicad_board::board_from_sheet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 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.
vcad_ecad_symbols::kicad_pcb::convert_pcb (cognitive 24) crates/vcad-ecad-symbols/src/kicad_pcb.rs:235— vcad_ecad_symbols::kicad_pcb::convert_pcb has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4, boolean chains 3 (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.
vcad_ecad_symbols::kicad_pcb::order_outline_points (cognitive 23) crates/vcad-ecad-symbols/src/kicad_pcb.rs:674— vcad_ecad_symbols::kicad_pcb::order_outline_points has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_symbols::kicad_sch::reconstruct_nets (cognitive 23) crates/vcad-ecad-symbols/src/kicad_sch.rs:268— vcad_ecad_symbols::kicad_sch::reconstruct_nets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 7 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). Of this number, 22 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.
vcad_ecad_symbols::kicad_pcb::parse_footprint (cognitive 22) crates/vcad-ecad-symbols/src/kicad_pcb.rs:1020— vcad_ecad_symbols::kicad_pcb::parse_footprint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (6 pts), loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_symbols::kicad_write::transistor_artwork (cognitive 21) crates/vcad-ecad-symbols/src/kicad_write.rs:1637— vcad_ecad_symbols::kicad_write::transistor_artwork has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2, 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.
vcad_ecad_symbols::altium::chain_outline (cognitive 19) crates/vcad-ecad-symbols/src/altium/mod.rs:1019— vcad_ecad_symbols::altium::chain_outline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 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.
vcad_ecad_symbols::eagle_brd::chain_outline (cognitive 19) crates/vcad-ecad-symbols/src/eagle_brd.rs:363— vcad_ecad_symbols::eagle_brd::chain_outline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 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.
vcad_ecad_symbols::eagle_brd::xml_depth_exceeds (cognitive 19) crates/vcad-ecad-symbols/src/eagle_brd.rs:528— vcad_ecad_symbols::eagle_brd::xml_depth_exceeds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 1 (3 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.
vcad_ecad_symbols::kicad_write::write_footprint (cognitive 19) crates/vcad-ecad-symbols/src/kicad_write.rs:512— vcad_ecad_symbols::kicad_write::write_footprint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
vcad_ecad_symbols::kicad_pcb::calibrate_rules_from_copper (cognitive 18) crates/vcad-ecad-symbols/src/kicad_pcb.rs:576— vcad_ecad_symbols::kicad_pcb::calibrate_rules_from_copper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_symbols::kicad_mod::parse_single_footprint (cognitive 17) crates/vcad-ecad-symbols/src/kicad_mod.rs:469— vcad_ecad_symbols::kicad_mod::parse_single_footprint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ClassTooLong: EditorModel apple/VcadApp/Sources/VcadApp/Editor.swift:290— ClassTooLong — 2840 significant lines (blank, comment-only and punctuation-only lines excluded), 378 methods. The bar is 400 significant lines; this is 2440 over it, 7.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.
ClassTooLong: EditorModel apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:290— ClassTooLong — 2840 significant lines (blank, comment-only and punctuation-only lines excluded), 218 methods. The bar is 400 significant lines; this is 2440 over it, 7.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.
ClassTooLong: ConvertCtx crates/vcad-loon/src/convert.rs:1122— ClassTooLong — 1317 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 2 blocks, lines 1122-3073. The bar is 400 significant lines; this is 917 over it, 3.29× 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: Solid crates/vcad-kernel/src/lib.rs:382— ClassTooLong — 1135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 98 methods, 8 blocks, lines 382-2694. The bar is 400 significant lines; this is 735 over it, 2.84× 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: Engine packages/engine/src/index.ts:1351— ClassTooLong — 979 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 400 significant lines; this is 579 over it, 2.45× 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: SketchSession apple/VcadApp/Sources/VcadApp/SketchSession.swift:264— ClassTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded), 79 methods. The bar is 400 significant lines; this is 543 over it, 2.36× 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: PhysicsWorld crates/vcad-kernel-physics/src/world.rs:138— ClassTooLong — 882 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 2 blocks, lines 138-1975. The bar is 400 significant lines; this is 482 over it, 2.21× 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: SchematicCanvas packages/app/src/components/electronics/SchematicCanvas.tsx:1— ClassTooLong — 828 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 428 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: useToolDefinitions packages/app/src/hooks/useToolDefinitions.tsx:1— ClassTooLong — 816 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 416 over it, 2.04× 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: App crates/vcad-cli/src/app.rs:102— ClassTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 2 blocks, lines 102-1291. The bar is 400 significant lines; this is 399 over it, 2.00× 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: FeatureInput crates/vcad-app/src/feature.rs:58— ClassTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 58-1165. The bar is 400 significant lines; this is 367 over it, 1.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: ReleasedOverlayView apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:826— ClassTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 323 over it, 1.81× 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: Server crates/vcad-mcp/src/server.rs:165— ClassTooLong — 689 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 2 blocks, lines 165-1188. The bar is 400 significant lines; this is 289 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StepWriter crates/vcad-kernel-step/src/writer.rs:319— ClassTooLong — 650 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 2 blocks, lines 319-1292. The bar is 400 significant lines; this is 250 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.
ClassTooLong: FlowGraph crates/vcad-ecad-pcb/src/router/flow/flow.rs:294— ClassTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 2 blocks, lines 294-1379. The bar is 400 significant lines; this is 231 over it, 1.58× 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: InteractiveRouter crates/vcad-ecad-fabprep/src/verdict.rs:570— ClassTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 570-1411. The bar is 400 significant lines; this is 212 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.
ClassTooLong: Simulation crates/vcad-kernel-photonics/src/sim.rs:131— ClassTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 2 blocks, lines 131-955. The bar is 400 significant lines; this is 143 over it, 1.36× 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: Problem crates/vcad-eval/src/optimize.rs:771— ClassTooLong — 522 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 771-1529. The bar is 400 significant lines; this is 122 over it, 1.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: CsgOp crates/vcad-ir/src/lib.rs:815— ClassTooLong — 499 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 2 blocks, lines 815-1688. The bar is 400 significant lines; this is 99 over it, 1.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: StepReader crates/vcad-kernel-step/src/reader.rs:493— ClassTooLong — 476 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 493-1285. The bar is 400 significant lines; this is 76 over it, 1.19× 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: TurnPlanner crates/vcad-kernel-cam/src/turning/ops.rs:28— ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 2 blocks, lines 28-655. The bar is 400 significant lines; this is 70 over it, 1.18× 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: ReleaseWindowController apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:105— ClassTooLong — 446 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 46 over it, 1.12× 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: Embedding crates/vcad-ecad-pcb/src/router/flow/embed.rs:138— ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 2 blocks, lines 138-738. The bar is 400 significant lines; this is 38 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.
ClassTooLong: DocumentApi crates/vcad-app/src/document_api.rs:119— ClassTooLong — 433 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 2 blocks, lines 119-848. The bar is 400 significant lines; this is 33 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SceneMesh packages/app/src/components/SceneMesh.tsx:1— ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
+ 2 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium CVE · ×27
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×27
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsToolsViews.swift:355— apple/VcadApp/Sources/VcadApp/ElectronicsToolsViews.swift:355-357 | apple/VcadApp/Sources/VcadApp/ElectronicsToolsViews.swift:418-420 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:765— apple/VcadApp/Sources/VcadApp/Document.swift:765-767 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:765-767 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsToolsViews.swift:153— apple/VcadApp/Sources/VcadApp/ElectronicsToolsViews.swift:153-156 | apple/VcadApp/Sources/VcadApp/ElectronicsToolsViews.swift:358-360 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:241— apple/VcadApp/Sources/VcadApp/Editor.swift:241-243 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:241-243 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:244— apple/VcadApp/Sources/VcadApp/Editor.swift:244-246 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:244-246 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:247— apple/VcadApp/Sources/VcadApp/Editor.swift:247-249 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:247-249 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Theme.swift:183— apple/VcadApp/Sources/VcadApp/Theme.swift:183-185 | apple/VcadVision/Sources/VcadVision/Shared/Theme.swift:183-185 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/vcad-app/src/agent.rs:51— crates/vcad-app/src/agent.rs:51-60 | crates/vcad-mcp/src/tools/core.rs:165-167 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:867— apple/VcadApp/Sources/VcadApp/Document.swift:867-869 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:867-869 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:883— apple/VcadApp/Sources/VcadApp/Document.swift:883-885 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:883-885 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:653— apple/VcadApp/Sources/VcadApp/Document.swift:653-655 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:653-655 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) REDACTED:45— REDACTED:45-47 | crates/vcad-ecad-symbols/src/altium/mod.rs:462-464 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/FabricatePanel.swift:79— apple/VcadApp/Sources/VcadApp/FabricatePanel.swift:79-81 | apple/VcadApp/Sources/VcadApp/PcbFFI.swift:27-29 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Theme.swift:201— apple/VcadApp/Sources/VcadApp/Theme.swift:201-203 | apple/VcadVision/Sources/VcadVision/Shared/Theme.swift:201-203 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/UsdzExport.swift:25— apple/VcadApp/Sources/VcadApp/UsdzExport.swift:25-27 | apple/VcadVision/Sources/VcadVision/Shared/UsdzExport.swift:25-27 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/UsdzExport.swift:28— apple/VcadApp/Sources/VcadApp/UsdzExport.swift:28-30 | apple/VcadVision/Sources/VcadVision/Shared/UsdzExport.swift:28-30 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/vcad-ecad-pcb/src/spatial.rs:248— crates/vcad-ecad-pcb/src/spatial.rs:248-250 | crates/vcad-kernel-raytrace/src/trim.rs:983-985 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/vcad-kernel-sheet/src/edge_flange.rs:263— crates/vcad-kernel-sheet/src/edge_flange.rs:263-265 | crates/vcad-kernel/src/sheet_fold.rs:394-396 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:649— apple/VcadApp/Sources/VcadApp/Document.swift:649-651 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:649-651 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/vcad-parts/src/vacuum/mod.rs:639— crates/vcad-parts/src/vacuum/mod.rs:639-641 | crates/vcad-slicer/src/orient.rs:57-59 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1068— apple/VcadApp/Sources/VcadApp/Editor.swift:1068-1070 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1068-1070 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/SimController.swift:166— apple/VcadApp/Sources/VcadApp/SimController.swift:166-168 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:166-168 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:2580— apple/VcadApp/Sources/VcadApp/Editor.swift:2580-2582 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2580-2582 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:347— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:347-349 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:347-349 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/vcad-ecad-pcb/src/dfm.rs:453— crates/vcad-ecad-pcb/src/dfm.rs:453-455 | crates/vcad-ecad-pcb/src/router/diff_pair.rs:195-197 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×26
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-app/src/engine.rs:236— crates/vcad-app/src/engine.rs:236-275 | crates/vcad-cli/src/app.rs:745-783 | crates/vcad-cli/src/app.rs:786-824 | crates/vcad-cli/src/app.rs:827-868 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-cli/src/app.rs:315— crates/vcad-cli/src/app.rs:315-336 | crates/vcad-cli/src/app.rs:339-362 | crates/vcad-cli/src/app.rs:365-387 | crates/vcad-cli/src/app.rs:412-436 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-cli/src/ui/chat.rs:165— crates/vcad-cli/src/ui/chat.rs:165-459 | crates/vcad-cli/src/ui/command.rs:43-232 | crates/vcad-cli/src/ui/menu.rs:396-524 | crates/vcad-cli/src/ui/tree.rs:43-178 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-ecad-pcb/src/router/descent.rs:920— crates/vcad-ecad-pcb/src/router/descent.rs:920-1523 | crates/vcad-ecad-pcb/src/router/mod.rs:434-573 | crates/vcad-ecad-pcb/src/router/pair.rs:1492-1597 | crates/vcad-ecad-pcb/src/router/pair.rs:1605-1925 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-ecad-pcb/src/spatial.rs:304— crates/vcad-ecad-pcb/src/spatial.rs:304-322 | crates/vcad-kernel-drafting/src/section.rs:639-662 | crates/vcad-kernel-sketch/src/profile.rs:469-492 | crates/vcad-slicer/src/perimeter.rs:139-161 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-ecad-pcb/src/spatial.rs:579— crates/vcad-ecad-pcb/src/spatial.rs:579-627 | crates/vcad-ecad-symbols/src/kicad_write.rs:1099-1129 | crates/vcad-ffi/src/lib.rs:2169-2188 | mecheval/graders/src/pcb.rs:130-169 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-ecad-sim/src/circuit/adjoint.rs:170— crates/vcad-ecad-sim/src/circuit/adjoint.rs:170-211 | crates/vcad-ecad-sim/src/circuit/dc.rs:194-237 | crates/vcad-ecad-sim/src/circuit/devices.rs:559-641 | crates/vcad-ecad-sim/src/circuit/transient_adjoint.rs:407-452 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-eval/src/kinematics.rs:22— crates/vcad-eval/src/kinematics.rs:22-37 | crates/vcad-eval/src/placement.rs:68-77 | crates/vcad-ffi/src/lib.rs:820-830 | crates/vcad-loon/src/convert.rs:3235-3243 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-gdsii/src/bridge.rs:228— crates/vcad-gdsii/src/bridge.rs:228-242 | crates/vcad-kernel-raytrace/src/gpu/buffers.rs:1149-1165 | crates/vcad-process/src/bridge.rs:122-135 | crates/vcad-process/src/masks.rs:70-86 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-booleans/src/split.rs:340— crates/vcad-kernel-booleans/src/split.rs:340-852 | crates/vcad-kernel-booleans/src/split.rs:1350-1902 | crates/vcad-kernel-booleans/src/split.rs:2713-3165 | crates/vcad-kernel-booleans/src/split.rs:3456-3527 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-booleans/src/ssi.rs:1082— crates/vcad-kernel-booleans/src/ssi.rs:1082-1126 | crates/vcad-kernel-booleans/src/ssi.rs:1129-1154 | crates/vcad-kernel-booleans/src/trim.rs:863-890 | crates/vcad-kernel-fillet/src/closest_point.rs:81-120 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-fillet/src/chamfer.rs:37— crates/vcad-kernel-fillet/src/chamfer.rs:37-167 | crates/vcad-kernel-fillet/src/fillet_curved.rs:880-985 | crates/vcad-kernel-fillet/src/fillet_planar.rs:52-250 | crates/vcad-kernel-fillet/src/trim.rs:309-428 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-flow/src/adjoint.rs:129— crates/vcad-kernel-flow/src/adjoint.rs:129-361 | crates/vcad-kernel-flow/src/adjoint.rs:373-697 | crates/vcad-kernel-flow/src/solve.rs:172-575 | crates/vcad-kernel-flow/src/solve.rs:589-795 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-physics/src/colliders.rs:151— crates/vcad-kernel-physics/src/colliders.rs:151-173 | crates/vcad-kernel-physics/src/world.rs:269-717 | mecheval/graders/src/fit_physics.rs:558-592 | mecheval/graders/src/fit_physics.rs:600-639 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-qcd/src/analysis.rs:121— crates/vcad-kernel-qcd/src/analysis.rs:121-160 | crates/vcad-kernel-shell/src/lib.rs:921-980 | crates/vcad-kernel-tessellate/src/frozen.rs:726-754 | crates/vcad-render/src/callouts.rs:245-282 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:59— crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:59-84 | crates/vcad-kernel-raytrace/src/intersect/torus.rs:66-93 | crates/vcad-kernel-raytrace/src/trim.rs:781-799 | crates/vcad-kernel-raytrace/src/trim.rs:871-902 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-tessellate/src/lib.rs:833— crates/vcad-kernel-tessellate/src/lib.rs:833-920 | crates/vcad-kernel-tessellate/src/lib.rs:940-975 | crates/vcad-kernel-tessellate/src/lib.rs:1787-1968 | crates/vcad-kernel-tessellate/src/lib.rs:8723-8763 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-tessellate/src/lib.rs:978— crates/vcad-kernel-tessellate/src/lib.rs:978-1200 | crates/vcad-kernel-tessellate/src/lib.rs:1232-1323 | crates/vcad-kernel-tessellate/src/lib.rs:1432-1721 | crates/vcad-kernel-tessellate/src/lib.rs:8773-8893 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-kernel-tessellate/src/lib.rs:5309— crates/vcad-kernel-tessellate/src/lib.rs:5309-5403 | crates/vcad-kernel-tessellate/src/lib.rs:5419-5492 | crates/vcad-kernel-tessellate/src/lib.rs:5601-5799 | crates/vcad-kernel-tessellate/src/lib.rs:7428-7929 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/vcad-loon/src/convert.rs:20— crates/vcad-loon/src/convert.rs:20-167 | crates/vcad-loon/src/convert.rs:193-277 | crates/vcad-loon/src/convert.rs:367-621 | crates/vcad-loon/src/convert.rs:650-955 — 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) apple/VcadApp/Sources/VcadApp/AssemblyModel.swift:255— apple/VcadApp/Sources/VcadApp/AssemblyModel.swift:255-269 | apple/VcadApp/Sources/VcadApp/Editor.swift:779-794 | apple/VcadApp/Sources/VcadApp/PoseStudio.swift:151-165 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:779-794 — 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) apple/VcadApp/Sources/VcadApp/Document.swift:501— apple/VcadApp/Sources/VcadApp/Document.swift:501-516 | apple/VcadApp/Sources/VcadApp/Document.swift:518-556 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:501-516 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:518-556 — 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) apple/VcadApp/Sources/VcadApp/Editor.swift:853— apple/VcadApp/Sources/VcadApp/Editor.swift:853-871 | apple/VcadApp/Sources/VcadApp/Editor.swift:2925-2952 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:853-871 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2925-2952 — 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) apple/VcadApp/Sources/VcadApp/Kernel.swift:63— apple/VcadApp/Sources/VcadApp/Kernel.swift:63-82 | apple/VcadApp/Sources/VcadApp/Kernel.swift:93-219 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:63-82 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:93-219 — 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) apple/VcadApp/Sources/VcadApp/Kernel.swift:245— apple/VcadApp/Sources/VcadApp/Kernel.swift:245-284 | apple/VcadApp/Sources/VcadApp/Kernel.swift:300-379 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:245-284 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:300-379 — 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.
vcad_render::render_svg_impl (cognitive 143) crates/vcad-render/src/lib.rs:3009— vcad_render::render_svg_impl has cognitive complexity 143 (threshold 15). Drivers by points: if/else 34 (76 pts), loops 20 (38 pts), match/switch 7 (22 pts), boolean chains 7 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::pcb::render_pcb_svg_opts (cognitive 132) crates/vcad-render/src/pcb.rs:1097— vcad_render::pcb::render_pcb_svg_opts has cognitive complexity 132 (threshold 15). Drivers by points: if/else 45 (81 pts), boolean chains 31, loops 14 (20 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.
vcad_render::raster::rasterize (cognitive 82) crates/vcad-render/src/lib.rs:4318— vcad_render::raster::rasterize has cognitive complexity 82 (threshold 15). Drivers by points: loops 16 (43 pts), if/else 18 (35 pts), boolean chains 2, match/switch 2 (nesting depth added 44). 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.
vcad_render::callouts::detect (cognitive 67) crates/vcad-render/src/callouts.rs:82— vcad_render::callouts::detect has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (51 pts), loops 4 (9 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::raytrace::rasterize_rt_scene (cognitive 64) crates/vcad-render/src/lib.rs:5444— vcad_render::raytrace::rasterize_rt_scene has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 10 (26 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::raster::draw_annotations (cognitive 58) crates/vcad-render/src/lib.rs:4809— vcad_render::raster::draw_annotations has cognitive complexity 58 (threshold 15). Drivers by points: loops 11 (28 pts), if/else 13 (27 pts), boolean chains 3 (nesting depth added 31). 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.
vcad_render::build_artifacts (cognitive 54) crates/vcad-render/src/lib.rs:1831— vcad_render::build_artifacts has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 4 (8 pts), match/switch 3 (7 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::exact::candidate_circles (cognitive 32) crates/vcad-render/src/exact.rs:124— vcad_render::exact::candidate_circles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (9 pts), boolean chains 7 (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.
vcad_render::raster::draw_text (cognitive 31) crates/vcad-render/src/lib.rs:5207— vcad_render::raster::draw_text has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (18 pts), if/else 3 (13 pts) (nesting depth added 21). 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.
vcad_render::chain_segments (cognitive 27) crates/vcad-render/src/lib.rs:2563— vcad_render::chain_segments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (7 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.
vcad_render::run (cognitive 26) crates/vcad-render/src/main.rs:1371— vcad_render::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, match/switch 2 (4 pts), 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.
vcad_render::animate::plan_animation (cognitive 25) crates/vcad-render/src/animate.rs:209— vcad_render::animate::plan_animation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (5 pts), match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::callouts::plan (cognitive 25) crates/vcad-render/src/callouts.rs:525— vcad_render::callouts::plan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::raster::draw_edge (cognitive 25) crates/vcad-render/src/lib.rs:5290— vcad_render::raster::draw_edge has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (6 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.
vcad_render::raster::fill_triangle (cognitive 24) crates/vcad-render/src/lib.rs:4677— vcad_render::raster::fill_triangle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_render::callouts::group (cognitive 23) crates/vcad-render/src/callouts.rs:361— vcad_render::callouts::group has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4 (10 pts), boolean chains 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_render::exact::extract (cognitive 22) crates/vcad-render/src/exact.rs:307— vcad_render::exact::extract has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (6 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.
vcad_render::photoreal_gpu::rasterize (cognitive 20) crates/vcad-render/src/photoreal_gpu.rs:338— vcad_render::photoreal_gpu::rasterize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (5 pts), boolean chains 2, match/switch 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.
vcad_render::evaluate_assembly_instances (cognitive 19) crates/vcad-render/src/lib.rs:1354— vcad_render::evaluate_assembly_instances has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 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.
vcad_render::sheet::raster_sheet::render_sheet_jpeg_str (cognitive 19) crates/vcad-render/src/sheet.rs:471— vcad_render::sheet::raster_sheet::render_sheet_jpeg_str has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 6 (9 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.
vcad_render::clip_mesh_solid (cognitive 18) crates/vcad-render/src/lib.rs:592— vcad_render::clip_mesh_solid has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (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.
vcad_render::render_raster (cognitive 18) crates/vcad-render/src/main.rs:890— vcad_render::render_raster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 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.
vcad_render::render_one_uncached (cognitive 18) crates/vcad-render/src/main.rs:1195— vcad_render::render_one_uncached has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (7 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.
vcad_render::orient_normals (cognitive 17) crates/vcad-render/src/lib.rs:1612— vcad_render::orient_normals has cognitive complexity 17 (threshold 15). Drivers by points: loops 8 (9 pts), if/else 5 (8 pts) (nesting depth added 4). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×24
Edited copy of a member (9 corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:771— apple/VcadApp/Sources/VcadApp/Document.swift:771-779 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:771-779 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:578— crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:578-590 | crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1686-1696 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:4546— apple/VcadApp/Sources/VcadApp/Editor.swift:4546-4554 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4546-4554 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) apple/VcadApp/Sources/VcadApp/Shell.swift:895— apple/VcadApp/Sources/VcadApp/Shell.swift:895-903 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:895-903 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:2127— apple/VcadApp/Sources/VcadApp/Editor.swift:2127-2135 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2127-2135 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-geom/src/lib.rs:1230— crates/vcad-kernel-geom/src/lib.rs:1230-1238 | crates/vcad-kernel-geom/src/lib.rs:1241-1249 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-ecad-pcb/src/router/descent.rs:1713— crates/vcad-ecad-pcb/src/router/descent.rs:1713-1721 | crates/vcad-kernel-sheet/src/manufacturability.rs:482-492 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-step/src/assembly.rs:172— crates/vcad-kernel-step/src/assembly.rs:172-180 | crates/vcad-parts/src/vacuum/mod.rs:649-657 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:590— apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:590-598 | apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:600-608 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-cli/src/ui/command.rs:13— crates/vcad-cli/src/ui/command.rs:13-24 | crates/vcad-cli/src/ui/command.rs:250-258 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-topopt/src/analyze.rs:402— crates/vcad-kernel-topopt/src/analyze.rs:402-410 | crates/vcad-kernel-topopt/src/lib.rs:191-199 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-constraints/src/residual.rs:356— crates/vcad-kernel-constraints/src/residual.rs:356-364 | crates/vcad-kernel-constraints/src/symbolic.rs:585-593 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) REDACTED:769— REDACTED:769-777 | REDACTED:847-855 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-naming/src/lib.rs:694— crates/vcad-kernel-naming/src/lib.rs:694-702 | crates/vcad-kernel-naming/src/lib.rs:705-715 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-ffi/src/sketch.rs:256— crates/vcad-ffi/src/sketch.rs:256-265 | crates/vcad-ffi/src/sketch.rs:294-302 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-ecad-symbols/src/kicad_mod.rs:156— crates/vcad-ecad-symbols/src/kicad_mod.rs:156-164 | crates/vcad-ecad-symbols/src/kicad_sym.rs:127-135 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-cam/src/turning/geom.rs:46— crates/vcad-kernel-cam/src/turning/geom.rs:46-54 | crates/vcad-kernel-particle/src/wire3d.rs:636-645 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-thermal/src/adjoint.rs:386— crates/vcad-kernel-thermal/src/adjoint.rs:386-397 | crates/vcad-kernel-thermal/src/adjoint.rs:400-408 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-loon/src/params.rs:170— crates/vcad-loon/src/params.rs:170-178 | crates/vcad-loon/src/variants.rs:299-307 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-ecad-pcb/src/geometry.rs:59— crates/vcad-ecad-pcb/src/geometry.rs:59-67 | crates/vcad-ecad-pcb/src/router/auto.rs:3263-3271 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-assembly/src/pose.rs:73— crates/vcad-kernel-assembly/src/pose.rs:73-81 | crates/vcad-kernel-assembly/src/pose.rs:84-92 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-booleans/src/repair.rs:484— crates/vcad-kernel-booleans/src/repair.rs:484-495 | crates/vcad-kernel-booleans/src/sew.rs:393-401 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-app/src/document_api.rs:144— crates/vcad-app/src/document_api.rs:144-152 | crates/vcad-app/src/document_api.rs:199-207 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:1824— crates/vcad-kernel-wasm/src/lib.rs:1824-1834 | crates/vcad-site-wasm/src/lib.rs:158-166 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (16 lines × 2) crates/termview/src/braille.rs:52— crates/termview/src/braille.rs:52-67 | crates/vcad-cli/src/ui/viewport.rs:69-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/termview/src/braille.rs:52` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/vcad-cli/src/app.rs:752— crates/vcad-cli/src/app.rs:752-767 | crates/vcad-cli/src/app.rs:793-808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:752` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/vcad-kernel-sheet/src/font.rs:112— crates/vcad-kernel-sheet/src/font.rs:112-141 | crates/vcad-kernel-sheet/src/font.rs:143-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/font.rs:112` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) crates/vcad-kernel-sheet/src/font.rs:160— crates/vcad-kernel-sheet/src/font.rs:160-181 | crates/vcad-kernel-sheet/src/font.rs:241-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/font.rs:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) crates/vcad-kernel-urdf/src/writer.rs:133— crates/vcad-kernel-urdf/src/writer.rs:133-148 | crates/vcad-kernel-urdf/src/writer.rs:170-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-urdf/src/writer.rs:133` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/vcad-slicer-gcode/src/gcode.rs:223— crates/vcad-slicer-gcode/src/gcode.rs:223-238 | crates/vcad-slicer-gcode/src/gcode.rs:248-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-slicer-gcode/src/gcode.rs:241` calls `extrude_to` and `crates/vcad-slicer-gcode/src/gcode.rs:266` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) mecheval/graders/src/fit_physics.rs:144— mecheval/graders/src/fit_physics.rs:144-159 | mecheval/graders/src/fit_physics.rs:225-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mecheval/graders/src/fit_physics.rs:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:428— crates/vcad-ecad-pcb/src/router/sco.rs:428-443 | crates/vcad-ecad-pcb/src/router/sco.rs:612-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:428` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) crates/vcad-kernel-gpu/src/narrowphase.rs:178— crates/vcad-kernel-gpu/src/narrowphase.rs:178-193 | crates/vcad-kernel-gpu/src/wavefront_batch.rs:339-354 — 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) crates/vcad-ecad-pcb/src/router/complete.rs:1964— crates/vcad-ecad-pcb/src/router/complete.rs:1964-1979 | crates/vcad-ecad-pcb/src/router/maze.rs:1425-1440 — before extracting anything, compare `crates/vcad-ecad-pcb/src/router/complete.rs` and `crates/vcad-ecad-pcb/src/router/maze.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/vcad-kernel-cam/src/post/grbl.rs:189— crates/vcad-kernel-cam/src/post/grbl.rs:189-204 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:249-264 — before extracting anything, compare `crates/vcad-kernel-cam/src/post/grbl.rs` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/post/grbl.rs:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) apple/VcadApp/Sources/VcadApp/Document.swift:501— apple/VcadApp/Sources/VcadApp/Document.swift:501-516 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:501-516 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1432— apple/VcadApp/Sources/VcadApp/Editor.swift:1432-1447 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1432-1447 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3084— apple/VcadApp/Sources/VcadApp/Editor.swift:3084-3099 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3084-3099 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:130— apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:130-145 | apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift:130-145 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift` and `apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:450— apple/VcadApp/Sources/VcadApp/Shell.swift:450-465 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:450-465 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:603— apple/VcadApp/Sources/VcadApp/Shell.swift:603-618 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:603-618 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:693— apple/VcadApp/Sources/VcadApp/Shell.swift:693-708 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:693-708 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:1020— apple/VcadApp/Sources/VcadApp/Shell.swift:1020-1035 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:1020-1035 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3425— apple/VcadApp/Sources/VcadApp/Editor.swift:3425-3440 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3425-3440 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:3425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (16 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4159— apple/VcadApp/Sources/VcadApp/Editor.swift:4159-4174 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4159-4174 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1221— apple/VcadApp/Sources/VcadApp/Editor.swift:1221-1236 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1221-1236 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2671— apple/VcadApp/Sources/VcadApp/Editor.swift:2671-2686 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2671-2686 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2987— apple/VcadApp/Sources/VcadApp/Editor.swift:2987-3002 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2987-3002 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×23
Edited copy of a member (8 corresponding lines) crates/vcad-render/src/lib.rs:5118— crates/vcad-render/src/lib.rs:5118-5140 | crates/vcad-render/src/sheet.rs:412-428 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-app/src/tools.rs:869— crates/vcad-app/src/tools.rs:869-876 | crates/vcad-app/src/tools.rs:879-886 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:453— apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:453-460 | apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:628-635 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) docs/compression-math-survey/paper-draft-figures/make_figures.py:118— docs/compression-math-survey/paper-draft-figures/make_figures.py:118-125 | docs/compression-math-survey/paper-draft-figures/make_figures.py:168-175 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/PrintWorkbench.swift:276— apple/VcadApp/Sources/VcadApp/PrintWorkbench.swift:276-284 | apple/VcadApp/Sources/VcadApp/SheetMetalWorkbench.swift:68-75 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:657— apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:657-664 | apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:665-672 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:306— apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:306-313 | apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:316-325 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-particle/src/adjoint.rs:250— crates/vcad-kernel-particle/src/adjoint.rs:250-257 | crates/vcad-kernel-particle/src/field.rs:188-196 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-constraints/src/session.rs:573— crates/vcad-kernel-constraints/src/session.rs:573-580 | crates/vcad-kernel-constraints/src/session.rs:617-625 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-constraints/src/session.rs:890— crates/vcad-kernel-constraints/src/session.rs:890-897 | crates/vcad-render/src/lib.rs:2068-2075 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:290— apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:290-297 | apple/VcadApp/Sources/VcadApp/ReceiptStore.swift:73-80 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:184— crates/vcad-kernel-nurbs/src/lib.rs:184-193 | crates/vcad-kernel-nurbs/src/lib.rs:722-729 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-render/src/lib.rs:4203— crates/vcad-render/src/lib.rs:4203-4210 | crates/vcad-render/src/lib.rs:4255-4262 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-flow/src/model.rs:311— crates/vcad-kernel-flow/src/model.rs:311-318 | crates/vcad-kernel-thermal/src/model.rs:354-361 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-wasm/src/document_engine.rs:52— crates/vcad-kernel-wasm/src/document_engine.rs:52-59 | crates/vcad-kernel-wasm/src/document_engine.rs:113-120 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-enclosure/src/fit.rs:410— crates/vcad-kernel-enclosure/src/fit.rs:410-418 | crates/vcad-kernel-enclosure/src/pcb.rs:81-88 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/AgentInstallUI.swift:118— apple/VcadApp/Sources/VcadApp/AgentInstallUI.swift:118-125 | apple/VcadApp/Sources/VcadApp/ConnectClaude.swift:175-184 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) apple/VcadApp/Sources/VcadApp/LoonLoop.swift:174— apple/VcadApp/Sources/VcadApp/LoonLoop.swift:174-181 | apple/VcadApp/Sources/VcadApp/PoseStudio.swift:266-273 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-ecad-pcb/src/pour_synth.rs:69— crates/vcad-ecad-pcb/src/pour_synth.rs:69-77 | crates/vcad-ecad-pcb/src/pour_synth.rs:84-91 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-app/src/ecad_tools.rs:67— crates/vcad-app/src/ecad_tools.rs:67-74 | crates/vcad-atoms/src/fab.rs:245-253 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-parts/src/vacuum/mod.rs:979— crates/vcad-parts/src/vacuum/mod.rs:979-986 | crates/vcad-render/src/exact.rs:262-269 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-ecad-fabprep/src/verdict.rs:67— crates/vcad-ecad-fabprep/src/verdict.rs:67-74 | crates/vcad-ecad-pcb/src/router/flow/route.rs:650-657 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/vcad-kernel-drafting/src/types.rs:170— crates/vcad-kernel-drafting/src/types.rs:170-180 | crates/vcad-kernel-naming/src/lib.rs:503-510 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (15 lines × 2) crates/vcad-app/src/materializer.rs:674— crates/vcad-app/src/materializer.rs:674-688 | crates/vcad-app/src/materializer.rs:750-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/materializer.rs:674` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) crates/vcad-ecad-export/src/gerber.rs:945— crates/vcad-ecad-export/src/gerber.rs:945-959 | crates/vcad-ecad-export/src/gerber.rs:1021-1035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-export/src/gerber.rs:945` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/vcad-kernel-acoustics/src/receipt.rs:369— crates/vcad-kernel-acoustics/src/receipt.rs:369-383 | crates/vcad-kernel-particle/src/receipt.rs:520-534 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-particle/src/receipt.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:369` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/vcad-kernel-diff/src/lift.rs:337— crates/vcad-kernel-diff/src/lift.rs:337-351 | crates/vcad-kernel-diff/src/lift.rs:352-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/vcad-kernel-diff/src/lift.rs:374— crates/vcad-kernel-diff/src/lift.rs:374-388 | crates/vcad-kernel-diff/src/lift.rs:396-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:200— crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:200-214 | crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:236-250 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-fea/src/buckling.rs:491— crates/vcad-kernel-fea/src/buckling.rs:491-505 | crates/vcad-kernel-fea/src/modal.rs:252-266 — before extracting anything, compare `crates/vcad-kernel-fea/src/buckling.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/buckling.rs:491` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:1354— crates/vcad-kernel-sketch/src/extrude.rs:1354-1368 | crates/vcad-kernel-sketch/src/extrude.rs:1394-1408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:1394` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/vcad-kernel-urdf/src/writer.rs:200— crates/vcad-kernel-urdf/src/writer.rs:200-214 | crates/vcad-kernel-urdf/src/writer.rs:276-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:5706— crates/vcad-kernel-tessellate/src/lib.rs:5706-5720 | crates/vcad-kernel-tessellate/src/lib.rs:7773-7787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5706` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-tessellate/src/lib.rs:5703` calls `project` and `crates/vcad-kernel-tessellate/src/lib.rs:7770` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:5660— crates/vcad-kernel-tessellate/src/lib.rs:5660-5674 | crates/vcad-kernel-tessellate/src/lib.rs:7713-7727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5660` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/vcad-kernel-urdf/src/reader.rs:20— crates/vcad-kernel-urdf/src/reader.rs:20-34 | crates/vcad-kernel-urdf/src/reader.rs:147-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-urdf/src/reader.rs:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/vcad-ffi/src/topology.rs:581— crates/vcad-ffi/src/topology.rs:581-595 | crates/vcad-ffi/src/topology.rs:606-620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:748— apple/VcadApp/Sources/VcadApp/Editor.swift:748-762 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:748-762 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2687— apple/VcadApp/Sources/VcadApp/Editor.swift:2687-2701 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2687-2701 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3185— apple/VcadApp/Sources/VcadApp/Editor.swift:3185-3199 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3185-3199 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3858— apple/VcadApp/Sources/VcadApp/Editor.swift:3858-3872 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3858-3872 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/IntentBar.swift:204— apple/VcadApp/Sources/VcadApp/IntentBar.swift:204-218 | apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift:204-218 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/IntentBar.swift` and `apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 142 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 × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:553— apple/VcadApp/Sources/VcadApp/Shell.swift:553-567 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:553-567 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 × 2) apple/VcadApp/Sources/VcadApp/SimController.swift:126— apple/VcadApp/Sources/VcadApp/SimController.swift:126-140 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:126-140 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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 × 2) apple/VcadApp/Sources/VcadApp/SimController.swift:532— apple/VcadApp/Sources/VcadApp/SimController.swift:532-546 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:532-546 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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 × 2) apple/VcadApp/Sources/VcadApp/Document.swift:114— apple/VcadApp/Sources/VcadApp/Document.swift:114-128 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:114-128 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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 × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2289— apple/VcadApp/Sources/VcadApp/Editor.swift:2289-2303 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2289-2303 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×22
Edited copy of a member (6 corresponding lines) apple/VcadApp/Sources/VcadApp/AssemblyEdit.swift:108— apple/VcadApp/Sources/VcadApp/AssemblyEdit.swift:108-113 | apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:329-334 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:7224— crates/vcad-kernel-wasm/src/lib.rs:7224-7229 | crates/vcad-kernel-wasm/src/lib.rs:7244-7249 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:7605— crates/vcad-kernel-wasm/src/lib.rs:7605-7610 | crates/vcad-kernel-wasm/src/lib.rs:7955-7960 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:357— crates/vcad-kernel-nurbs/src/lib.rs:357-362 | crates/vcad-kernel-nurbs/src/lib.rs:365-370 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) apple/VcadApp/Sources/VcadApp/AssemblyEdit.swift:181— apple/VcadApp/Sources/VcadApp/AssemblyEdit.swift:181-186 | apple/VcadApp/Sources/VcadApp/AssemblyEdit.swift:294-299 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6594— crates/vcad-kernel-wasm/src/lib.rs:6594-6599 | crates/vcad-kernel-wasm/src/lib.rs:6616-6621 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-ecad-export/src/bom.rs:80— crates/vcad-ecad-export/src/bom.rs:80-85 | crates/vcad-ecad-export/src/pick_place.rs:51-56 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6631— crates/vcad-kernel-wasm/src/lib.rs:6631-6636 | crates/vcad-kernel-wasm/src/lib.rs:6646-6651 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:3063— crates/vcad-ecad-pcb/src/drc.rs:3063-3068 | crates/vcad-ecad-pcb/src/session.rs:997-1002 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:170— crates/vcad-ecad-pcb/src/drc.rs:170-175 | crates/vcad-ecad-pcb/src/router/auto.rs:412-418 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) apple/VcadApp/Sources/VcadApp/SketchSession.swift:340— apple/VcadApp/Sources/VcadApp/SketchSession.swift:340-345 | apple/VcadApp/Sources/VcadApp/SketchSession.swift:346-351 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-kernel-wasm/src/document_diff.rs:57— crates/vcad-kernel-wasm/src/document_diff.rs:57-62 | crates/vcad-kernel-wasm/src/document_diff.rs:67-73 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) apple/VcadApp/Sources/VcadApp/SketchSession.swift:334— apple/VcadApp/Sources/VcadApp/SketchSession.swift:334-339 | apple/VcadApp/Sources/VcadApp/SketchSession.swift:352-357 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-chat/src/executor.rs:478— crates/vcad-chat/src/executor.rs:478-484 | crates/vcad-render/src/web.rs:246-251 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) apple/VcadApp/Sources/VcadApp/AgentInstall.swift:89— apple/VcadApp/Sources/VcadApp/AgentInstall.swift:89-94 | apple/VcadApp/Sources/VcadApp/AppInstance.swift:169-175 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-mcp/src/tools/core.rs:598— crates/vcad-mcp/src/tools/core.rs:598-603 | crates/vcad-mcp/src/tools/instrument.rs:132-137 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-ffi/src/features.rs:246— crates/vcad-ffi/src/features.rs:246-252 | crates/vcad-parts/src/builder.rs:30-35 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-eval/src/optimize.rs:427— crates/vcad-eval/src/optimize.rs:427-432 | crates/vcad-parts/src/types.rs:235-240 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-ffi/src/recon.rs:863— crates/vcad-ffi/src/recon.rs:863-868 | crates/vcad-runtime/src/lib.rs:539-545 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-app/src/feature.rs:1169— crates/vcad-app/src/feature.rs:1169-1174 | crates/vcad-app/src/materializer.rs:2094-2099 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-app/src/feature.rs:1184— crates/vcad-app/src/feature.rs:1184-1189 | crates/vcad-app/src/materializer.rs:2109-2114 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/vcad-app/src/feature.rs:1191— crates/vcad-app/src/feature.rs:1191-1196 | crates/vcad-app/src/materializer.rs:2116-2121 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
vcad_kernel_fea::buckling::buckling_on_mesh (cognitive 136) crates/vcad-kernel-fea/src/buckling.rs:818— vcad_kernel_fea::buckling::buckling_on_mesh has cognitive complexity 136 (threshold 15). Drivers by points: loops 35 (66 pts), if/else 31 (62 pts), match/switch 4 (6 pts), boolean chains 2 (nesting depth added 64). 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.
vcad_kernel_fea::modal::brick_matrices (cognitive 96) crates/vcad-kernel-fea/src/modal.rs:135— vcad_kernel_fea::modal::brick_matrices has cognitive complexity 96 (threshold 15). Drivers by points: loops 20 (65 pts), if/else 8 (25 pts), match/switch 1 (6 pts) (nesting depth added 67). 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.
vcad_kernel_fea::adjoint::shape_gradient (cognitive 60) crates/vcad-kernel-fea/src/adjoint.rs:237— vcad_kernel_fea::adjoint::shape_gradient has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 10 (28 pts), boolean chains 2, match/switch 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_fea::graph::device_assembly (cognitive 46) crates/vcad-kernel-fea/src/graph.rs:138— vcad_kernel_fea::graph::device_assembly has cognitive complexity 46 (threshold 15). Drivers by points: loops 12 (25 pts), if/else 4 (14 pts), match/switch 1 (6 pts), boolean chains 1 (nesting depth added 28). 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.
vcad_kernel_fea::mesh::hex_fill_conforming (cognitive 39) crates/vcad-kernel-fea/src/mesh.rs:415— vcad_kernel_fea::mesh::hex_fill_conforming has cognitive complexity 39 (threshold 15). Drivers by points: loops 13 (24 pts), if/else 7 (13 pts), boolean chains 2 (nesting depth added 17). 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.
vcad_kernel_fea::modal::sym_eig (cognitive 35) crates/vcad-kernel-fea/src/modal.rs:310— vcad_kernel_fea::modal::sym_eig has cognitive complexity 35 (threshold 15). Drivers by points: loops 9 (24 pts), if/else 4 (11 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_fea::mesh::voxelize (cognitive 33) crates/vcad-kernel-fea/src/mesh.rs:120— vcad_kernel_fea::mesh::voxelize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 8 (16 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.
vcad_kernel_fea::mesh::wall_thickness (cognitive 33) crates/vcad-kernel-fea/src/mesh.rs:553— vcad_kernel_fea::mesh::wall_thickness has cognitive complexity 33 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 7 (16 pts) (nesting depth added 17). 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.
vcad_kernel_fea::modal::assemble (cognitive 33) crates/vcad-kernel-fea/src/modal.rs:378— vcad_kernel_fea::modal::assemble has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 7 (13 pts), boolean chains 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.
vcad_kernel_fea::buckling::pressure_face (cognitive 30) crates/vcad-kernel-fea/src/buckling.rs:1223— vcad_kernel_fea::buckling::pressure_face has cognitive complexity 30 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 2 (8 pts) (nesting depth added 19). 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.
vcad_kernel_fea::section::check_beam (cognitive 30) crates/vcad-kernel-fea/src/section.rs:638— vcad_kernel_fea::section::check_beam has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 3, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_fea::mesh::tet_fill (cognitive 28) crates/vcad-kernel-fea/src/mesh.rs:235— vcad_kernel_fea::mesh::tet_fill has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (14 pts), loops 5 (14 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.
vcad_kernel_fea::modal::lobpcg (cognitive 28) crates/vcad-kernel-fea/src/modal.rs:888— vcad_kernel_fea::modal::lobpcg has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 7 (13 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.
vcad_kernel_fea::solve::assemble_bc (cognitive 28) crates/vcad-kernel-fea/src/solve.rs:213— vcad_kernel_fea::solve::assemble_bc has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 7 (14 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.
vcad_kernel_fea::buckling::element (cognitive 24) crates/vcad-kernel-fea/src/buckling.rs:459— vcad_kernel_fea::buckling::element has cognitive complexity 24 (threshold 15). Drivers by points: loops 12 (24 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_fea::shell::check_shell (cognitive 23) crates/vcad-kernel-fea/src/shell.rs:452— vcad_kernel_fea::shell::check_shell has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_fea::modal::modal_on_mesh (cognitive 22) crates/vcad-kernel-fea/src/modal.rs:1177— vcad_kernel_fea::modal::modal_on_mesh has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (8 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.
vcad_kernel_fea::buckling::sphere_shell (cognitive 21) crates/vcad-kernel-fea/src/buckling.rs:1377— vcad_kernel_fea::buckling::sphere_shell has cognitive complexity 21 (threshold 15). Drivers by points: loops 9 (21 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_fea::mesh::build_hex (cognitive 19) crates/vcad-kernel-fea/src/mesh.rs:354— vcad_kernel_fea::mesh::build_hex has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (9 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.
vcad_kernel_fea::convergence::analyze_converged_fields_with (cognitive 17) crates/vcad-kernel-fea/src/convergence.rs:214— vcad_kernel_fea::convergence::analyze_converged_fields_with has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, 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.
vcad_kernel_fea::modal::m_orthonormalize (cognitive 17) crates/vcad-kernel-fea/src/modal.rs:768— vcad_kernel_fea::modal::m_orthonormalize has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (7 pts) (nesting depth added 8). 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.
Duplicated block (17 lines × 2) crates/vcad-ecad-pcb/src/drc.rs:2781— crates/vcad-ecad-pcb/src/drc.rs:2781-2797 | crates/vcad-ecad-pcb/src/drc.rs:2878-2894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/drc.rs:2781` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/vcad-kernel-em/src/planar.rs:474— crates/vcad-kernel-em/src/planar.rs:474-490 | crates/vcad-kernel-em/src/planar.rs:493-509 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:33— crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:33-49 | crates/vcad-kernel-raytrace/src/intersect/sphere.rs:22-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:29` calls `abs` and `crates/vcad-kernel-raytrace/src/intersect/sphere.rs:20` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:3077— crates/vcad-kernel-wasm/src/lib.rs:3077-3093 | crates/vcad-kernel-wasm/src/lib.rs:3261-3277 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-wasm/src/lib.rs:5640— crates/vcad-kernel-wasm/src/lib.rs:5640-5656 | crates/vcad-kernel-wasm/src/lib.rs:5672-5688 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-wasm/src/lib.rs:8296— crates/vcad-kernel-wasm/src/lib.rs:8296-8312 | crates/vcad-kernel-wasm/src/lib.rs:8486-8502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:8296` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/vcad-render/src/callouts.rs:59— crates/vcad-render/src/callouts.rs:59-75 | crates/vcad-render/src/exact.rs:103-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) crates/vcad-render/src/lib.rs:2364— crates/vcad-render/src/lib.rs:2364-2380 | crates/vcad-render/src/lib.rs:4688-4704 — both copies are in the same file, so extract the block into 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) crates/vcad-ecad-symbols/src/footprint.rs:1212— crates/vcad-ecad-symbols/src/footprint.rs:1212-1228 | crates/vcad-ecad-symbols/src/footprint.rs:1243-1259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) crates/vcad-render/src/animate.rs:553— crates/vcad-render/src/animate.rs:553-570 | crates/vcad-render/src/animate.rs:657-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/animate.rs:553` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4008— apple/VcadApp/Sources/VcadApp/Editor.swift:4008-4024 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4008-4024 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:4073— apple/VcadApp/Sources/VcadApp/Editor.swift:4073-4089 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4073-4089 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) apple/VcadApp/Sources/VcadApp/Theme.swift:113— apple/VcadApp/Sources/VcadApp/Theme.swift:113-129 | apple/VcadVision/Sources/VcadVision/Shared/Theme.swift:113-129 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Theme.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Theme.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 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) apple/VcadApp/Sources/VcadApp/VisionShell.swift:154— apple/VcadApp/Sources/VcadApp/VisionShell.swift:154-170 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:154-170 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/VisionShell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 201 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) apple/VcadApp/Sources/VcadApp/VisionShell.swift:195— apple/VcadApp/Sources/VcadApp/VisionShell.swift:195-211 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:195-211 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/VisionShell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 201 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) apple/VcadApp/Sources/VcadApp/SimPanel.swift:219— apple/VcadApp/Sources/VcadApp/SimPanel.swift:219-235 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:219-235 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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) apple/VcadApp/Sources/VcadApp/Document.swift:417— apple/VcadApp/Sources/VcadApp/Document.swift:417-433 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:417-433 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3120— apple/VcadApp/Sources/VcadApp/Editor.swift:3120-3136 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3120-3136 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:87— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:87-103 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:87-103 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 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) apple/VcadApp/Sources/VcadApp/Materials.swift:18— apple/VcadApp/Sources/VcadApp/Materials.swift:18-34 | apple/VcadVision/Sources/VcadVision/Shared/Materials.swift:18-34 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Materials.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Materials.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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) apple/VcadApp/Sources/VcadApp/SimController.swift:409— apple/VcadApp/Sources/VcadApp/SimController.swift:409-425 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:409-425 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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.
vcad::input::handle_key (cyclomatic 98) crates/vcad-cli/src/input.rs:651— vcad::input::handle_key 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.
vcad::route_file (cyclomatic 59) crates/vcad-cli/src/main.rs:1736— vcad::route_file 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.
vcad::run_command (cyclomatic 37) crates/vcad-cli/src/main.rs:827— vcad::run_command 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.
vcad::ui::chat::draw_chat (cyclomatic 36) crates/vcad-cli/src/ui/chat.rs:165— vcad::ui::chat::draw_chat 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.
vcad::input::handle_mouse (cyclomatic 35) crates/vcad-cli/src/input.rs:345— vcad::input::handle_mouse 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.
vcad::slice_file (cyclomatic 25) crates/vcad-cli/src/main.rs:3562— vcad::slice_file 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.
vcad::ui::command::render_palette (cyclomatic 24) crates/vcad-cli/src/ui/command.rs:37— vcad::ui::command::render_palette 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.
vcad::app::run_loop (cyclomatic 23) crates/vcad-cli/src/app.rs:1465— vcad::app::run_loop 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.
vcad::ui::tree::render_sidebar (cyclomatic 23) crates/vcad-cli/src/ui/tree.rs:35— vcad::ui::tree::render_sidebar 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.
vcad::input::handle_tool_input_key (cyclomatic 22) crates/vcad-cli/src/input.rs:560— vcad::input::handle_tool_input_key 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.
vcad::anchor_track_ends (cyclomatic 22) crates/vcad-cli/src/main.rs:4403— vcad::anchor_track_ends 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.
vcad::stitch_to_planes (cyclomatic 22) crates/vcad-cli/src/main.rs:4642— vcad::stitch_to_planes 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.
vcad::ui::toolbar::draw_toolbar (cyclomatic 20) crates/vcad-cli/src/ui/toolbar.rs:364— vcad::ui::toolbar::draw_toolbar 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.
vcad::input::hit_test (cyclomatic 19) crates/vcad-cli/src/input.rs:73— vcad::input::hit_test 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.
vcad::ui::viewport::render_viewport_braille (cyclomatic 19) crates/vcad-cli/src/ui/viewport.rs:43— vcad::ui::viewport::render_viewport_braille 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.
vcad::ui::welcome::render_card (cyclomatic 18) crates/vcad-cli/src/ui/welcome.rs:40— vcad::ui::welcome::render_card 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.
vcad::plan_bga_escapes (cyclomatic 17) crates/vcad-cli/src/main.rs:1512— vcad::plan_bga_escapes 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.
vcad::floating_floor_area (cyclomatic 17) crates/vcad-cli/src/main.rs:2442— vcad::floating_floor_area 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.
vcad::trim_leaf_copper (cyclomatic 16) crates/vcad-cli/src/main.rs:4961— vcad::trim_leaf_copper 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.
vcad::ui::menu::draw_open_menu (cyclomatic 16) crates/vcad-cli/src/ui/menu.rs:396— vcad::ui::menu::draw_open_menu has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TooManyMethods: EditorModel apple/VcadApp/Sources/VcadApp/Editor.swift:290— TooManyMethods — 378 methods, declared across 16 files: VcadApp/Editor.swift (228), VcadApp/DirectManipulation.swift (35), VcadApp/AssemblyModel.swift (31), VcadApp/PoseStudio.swift (18), +12 more file(s). The bar is 30 methods; this is 348 over it, 12.60× 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: EditorModel apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:290— TooManyMethods — 218 methods. The bar is 30 methods; this is 188 over it, 7.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.
TooManyMethods: Solid crates/vcad-kernel/src/lib.rs:382— TooManyMethods — 98 methods, declared across 3 files: REDACTED (96), src/faces.rs (1), src/sweep_rotate.rs (1). The bar is 30 methods; this is 68 over it, 3.27× 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: Engine packages/engine/src/index.ts:1351— TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SketchSession apple/VcadApp/Sources/VcadApp/SketchSession.swift:264— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ElectronicsWorkspace apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:17— TooManyMethods — 70 methods, declared across 3 files: VcadApp/ElectronicsWorkspace.swift (56), VcadApp/ElectronicsSchematicLayer.swift (13), VcadApp/ElectronicsView.swift (1). The bar is 30 methods; this is 40 over it, 2.33× 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: DocumentApi crates/vcad-app/src/document_api.rs:119— TooManyMethods — 64 methods, declared across 4 files: src/document_api.rs (52), src/command.rs (8), src/delta.rs (3), src/history.rs (1). The bar is 30 methods; this is 34 over it, 2.13× 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: Solid crates/vcad-kernel-wasm/src/lib.rs:1055— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Solid packages/kernel-wasm/vcad_kernel_wasm.js:1135— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.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: PhysicsWorld crates/vcad-kernel-physics/src/world.rs:138— 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: ConvertCtx crates/vcad-loon/src/convert.rs:1122— 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: SketchSession crates/vcad-kernel-constraints/src/session.rs:305— 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: WasmDocumentEngine crates/vcad-kernel-wasm/src/document_engine.rs:24— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.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: WasmDocumentEngine packages/kernel-wasm/vcad_kernel_wasm.js:2252— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.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: Sketch2D crates/vcad-kernel-constraints/src/sketch.rs:16— TooManyMethods — 38 methods, declared across 2 files: src/sketch.rs (36), src/export.rs (2). The bar is 30 methods; this is 8 over it, 1.27× 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: CNCController apple/VcadApp/Sources/VcadApp/CNC.swift:127— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: App crates/vcad-cli/src/app.rs:102— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Simulation crates/vcad-kernel-photonics/src/sim.rs:131— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReleaseWindowController apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:105— TooManyMethods — 35 methods, declared across 2 files: VcadApp/ReleasedDesktop.swift (34), VcadApp/GizmoView.swift (1). The bar is 30 methods; this is 5 over it, 1.17× 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: RobotEnv crates/vcad-kernel-physics/src/gym.rs:241— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×20
Edited copy of a member (11 corresponding lines) crates/vcad-cli/src/tui/sketch_mode.rs:92— crates/vcad-cli/src/tui/sketch_mode.rs:92-122 | crates/vcad-kernel-wasm/src/sketch_session.rs:185-233 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-ecad-symbols/src/kicad_write.rs:1153— crates/vcad-ecad-symbols/src/kicad_write.rs:1153-1163 | crates/vcad-ecad-symbols/src/kicad_write.rs:1165-1177 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) apple/VcadApp/Sources/VcadApp/CNCWorkspace.swift:276— apple/VcadApp/Sources/VcadApp/CNCWorkspace.swift:276-287 | apple/VcadApp/Sources/VcadApp/CNCWorkspace.swift:383-393 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6095— crates/vcad-kernel-wasm/src/lib.rs:6095-6105 | crates/vcad-kernel-wasm/src/lib.rs:6296-6308 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel/src/lib.rs:2463— crates/vcad-kernel/src/lib.rs:2463-2473 | crates/vcad-kernel/src/lib.rs:2479-2491 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-cli/src/main.rs:5085— crates/vcad-cli/src/main.rs:5085-5095 | crates/vcad-kernel-sheet/src/poly2d.rs:93-107 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-ecad-sim/src/circuit/devices.rs:665— crates/vcad-ecad-sim/src/circuit/devices.rs:665-675 | crates/vcad-ecad-sim/src/circuit/devices.rs:678-688 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-urdf/src/reader.rs:684— crates/vcad-kernel-urdf/src/reader.rs:684-694 | crates/vcad-kernel-urdf/src/reader.rs:1159-1176 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-ecad-sim/src/circuit/ac.rs:188— crates/vcad-ecad-sim/src/circuit/ac.rs:188-198 | crates/vcad-ecad-sim/src/circuit/devices.rs:373-383 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:754— crates/vcad-kernel-wasm/src/lib.rs:754-764 | crates/vcad-kernel-wasm/src/lib.rs:850-860 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-cam/src/dropcutter/ball.rs:124— crates/vcad-kernel-cam/src/dropcutter/ball.rs:124-134 | crates/vcad-kernel-cam/src/dropcutter/bull.rs:238-256 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-assembly/src/mate_check.rs:158— crates/vcad-kernel-assembly/src/mate_check.rs:158-168 | crates/vcad-kernel-assembly/src/mate_check.rs:246-256 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) apple/VcadApp/Sources/VcadApp/DocumentExport.swift:167— apple/VcadApp/Sources/VcadApp/DocumentExport.swift:167-177 | apple/VcadApp/Sources/VcadApp/DrawingWorkspace.swift:602-612 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel/src/lib.rs:1766— crates/vcad-kernel/src/lib.rs:1766-1780 | crates/vcad-kernel/src/lib.rs:1792-1802 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:3524— crates/vcad-ecad-pcb/src/drc.rs:3524-3534 | crates/vcad-ecad-pcb/src/drc.rs:3621-3631 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-ecad-pcb/src/impedance.rs:128— crates/vcad-ecad-pcb/src/impedance.rs:128-138 | crates/vcad-ecad-symbols/src/kicad_write.rs:135-148 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-eval/src/cache.rs:352— crates/vcad-eval/src/cache.rs:352-362 | crates/vcad-eval/src/cache.rs:363-373 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-acoustics/src/instrument.rs:172— crates/vcad-kernel-acoustics/src/instrument.rs:172-182 | crates/vcad-kernel-acoustics/src/strike.rs:95-105 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-dfm/src/rules/mod.rs:89— crates/vcad-kernel-dfm/src/rules/mod.rs:89-99 | crates/vcad-kernel-dfm/src/rules/mod.rs:102-112 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:3921— crates/vcad-kernel-wasm/src/lib.rs:3921-3936 | crates/vcad-kernel-wasm/src/lib.rs:4011-4021 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
vcad_kernel_fillet::revolved::extract_profile (cognitive 88) crates/vcad-kernel-fillet/src/revolved.rs:174— vcad_kernel_fillet::revolved::extract_profile has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (62 pts), loops 10 (14 pts), boolean chains 6, match/switch 3 (6 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_fillet::blend_loft::loft_blend_edge_keyed (cognitive 84) crates/vcad-kernel-fillet/src/blend_loft.rs:113— vcad_kernel_fillet::blend_loft::loft_blend_edge_keyed has cognitive complexity 84 (threshold 15). Drivers by points: if/else 26 (55 pts), loops 10 (20 pts), boolean chains 9 (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.
vcad_kernel_fillet::fillet_curved::plan_convex_junction_blends (cognitive 55) crates/vcad-kernel-fillet/src/fillet_curved.rs:483— vcad_kernel_fillet::fillet_curved::plan_convex_junction_blends has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 9 (23 pts), loops 5 (7 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.
vcad_kernel_fillet::fillet_curved::fillet_edges_detailed_inner (cognitive 50) crates/vcad-kernel-fillet/src/fillet_curved.rs:139— vcad_kernel_fillet::fillet_curved::fillet_edges_detailed_inner has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (41 pts), match/switch 2 (5 pts), loops 4 (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.
vcad_kernel_fillet::fillet_subset::is_plane_plane_chain_set (cognitive 46) crates/vcad-kernel-fillet/src/fillet_subset.rs:110— vcad_kernel_fillet::fillet_subset::is_plane_plane_chain_set has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 5 (8 pts), match/switch 2 (5 pts), boolean chains 2 (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.
vcad_kernel_fillet::blend_loft::resolve_edge_query (cognitive 44) crates/vcad-kernel-fillet/src/blend_loft.rs:450— vcad_kernel_fillet::blend_loft::resolve_edge_query has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 3 (6 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_fillet::fillet_subset::fillet_plane_chain_edges (cognitive 43) crates/vcad-kernel-fillet/src/fillet_subset.rs:268— vcad_kernel_fillet::fillet_subset::fillet_plane_chain_edges has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 7 (8 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.
vcad_kernel_fillet::revolved::build_revolved (cognitive 41) crates/vcad-kernel-fillet/src/revolved.rs:623— vcad_kernel_fillet::revolved::build_revolved has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 16). Of this number, 40 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.
vcad_kernel_fillet::trim::build_vertex_faces (cognitive 34) crates/vcad-kernel-fillet/src/trim.rs:298— vcad_kernel_fillet::trim::build_vertex_faces has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2 (3 pts), match/switch 1 (3 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.
vcad_kernel_fillet::fillet_planar::fillet_all_edges_checked (cognitive 27) crates/vcad-kernel-fillet/src/fillet_planar.rs:49— vcad_kernel_fillet::fillet_planar::fillet_all_edges_checked has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3, 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.
vcad_kernel_fillet::revolved::blend_corners (cognitive 26) crates/vcad-kernel-fillet/src/revolved.rs:505— vcad_kernel_fillet::revolved::blend_corners has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (5 pts), loops 3, 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.
vcad_kernel_fillet::fillet_curved::snap_trims_at_junctions (cognitive 25) crates/vcad-kernel-fillet/src/fillet_curved.rs:771— vcad_kernel_fillet::fillet_curved::snap_trims_at_junctions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (8 pts), match/switch 1 (3 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.
vcad_kernel_fillet::blend_loft::apply_edge_blend (cognitive 23) crates/vcad-kernel-fillet/src/blend_loft.rs:582— vcad_kernel_fillet::blend_loft::apply_edge_blend has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 2, 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.
vcad_kernel_fillet::rolling_ball::chord_length_params (cognitive 21) crates/vcad-kernel-fillet/src/rolling_ball.rs:289— vcad_kernel_fillet::rolling_ball::chord_length_params has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5 (10 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.
vcad_kernel_fillet::trim::compute_trim_vertices_with_setbacks (cognitive 21) crates/vcad-kernel-fillet/src/trim.rs:76— vcad_kernel_fillet::trim::compute_trim_vertices_with_setbacks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 2 (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.
vcad_kernel_fillet::fillet_curved::build_cylinder_bridge_quads (cognitive 20) crates/vcad-kernel-fillet/src/fillet_curved.rs:872— vcad_kernel_fillet::fillet_curved::build_cylinder_bridge_quads has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_fillet::rolling_ball::gauss_solve (cognitive 18) crates/vcad-kernel-fillet/src/rolling_ball.rs:430— vcad_kernel_fillet::rolling_ball::gauss_solve has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 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.
vcad_kernel_fillet::chamfer::chamfer_all_edges_checked (cognitive 16) crates/vcad-kernel-fillet/src/chamfer.rs:34— vcad_kernel_fillet::chamfer::chamfer_all_edges_checked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_fillet::closest_point::closest_point_uv (cognitive 16) crates/vcad-kernel-fillet/src/closest_point.rs:11— vcad_kernel_fillet::closest_point::closest_point_uv 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.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×18
Edited copy of a member (5 corresponding lines) crates/vcad-kernel-assembly/src/pose.rs:96— crates/vcad-kernel-assembly/src/pose.rs:96-101 | crates/vcad-kernel-fea/src/buckling.rs:309-313 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:410— apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:410-414 | apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:415-419 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-ecad-pcb/src/router/complete.rs:1955— crates/vcad-ecad-pcb/src/router/complete.rs:1955-1959 | crates/vcad-ecad-pcb/src/router/maze.rs:1247-1251 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/PcbFFI.swift:74— apple/VcadApp/Sources/VcadApp/PcbFFI.swift:74-78 | apple/VcadApp/Sources/VcadApp/PcbFFI.swift:80-84 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/IntentBar.swift:119— apple/VcadApp/Sources/VcadApp/IntentBar.swift:119-123 | apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift:119-123 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:1555— crates/vcad-ecad-pcb/src/drc.rs:1555-1559 | crates/vcad-ecad-pcb/src/drc.rs:1562-1566 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:559— apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:559-563 | apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:755-759 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/SketchInference.swift:132— apple/VcadApp/Sources/VcadApp/SketchInference.swift:132-136 | apple/VcadApp/Sources/VcadApp/SketchSession.swift:1584-1589 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6449— crates/vcad-kernel-wasm/src/lib.rs:6449-6453 | crates/vcad-kernel-wasm/src/lib.rs:6474-6482 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6571— crates/vcad-kernel-wasm/src/lib.rs:6571-6575 | crates/vcad-kernel-wasm/src/lib.rs:6583-6587 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/NavigationViews.swift:287— apple/VcadApp/Sources/VcadApp/NavigationViews.swift:287-291 | apple/VcadApp/Sources/VcadApp/NavigationViews.swift:534-538 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:955— crates/vcad-kernel-nurbs/src/lib.rs:955-959 | crates/vcad-kernel-nurbs/src/lib.rs:961-965 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-kernel-physics/src/diff.rs:1016— crates/vcad-kernel-physics/src/diff.rs:1016-1020 | crates/vcad-kernel-physics/src/diff.rs:1094-1098 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-ecad-pcb/src/component_mesh.rs:262— crates/vcad-ecad-pcb/src/component_mesh.rs:262-266 | crates/vcad-ecad-pcb/src/component_mesh.rs:269-276 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-kernel-geom/src/lib.rs:431— crates/vcad-kernel-geom/src/lib.rs:431-437 | crates/vcad-kernel-geom/src/lib.rs:447-451 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-kernel-wasm/src/expressions.rs:154— crates/vcad-kernel-wasm/src/expressions.rs:154-159 | crates/vcad-kernel-wasm/src/lib.rs:535-539 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) apple/VcadApp/Sources/VcadApp/AnalysisFFI.swift:30— apple/VcadApp/Sources/VcadApp/AnalysisFFI.swift:30-34 | apple/VcadApp/Sources/VcadApp/DocumentExport.swift:41-45 — These two members are one piece of code written twice and then edited apart: 5 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 (5 corresponding lines) crates/vcad-ecad-pcb/src/dfm.rs:162— crates/vcad-ecad-pcb/src/dfm.rs:162-166 | crates/vcad-kernel-dfm/src/rules/mod.rs:81-86 — These two members are one piece of code written twice and then edited apart: 5 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.
vcad_ffi::drafting::compose (cognitive 178) crates/vcad-ffi/src/drafting.rs:464— vcad_ffi::drafting::compose has cognitive complexity 178 (threshold 15). Drivers by points: if/else 57 (116 pts), loops 19 (36 pts), match/switch 7 (14 pts), boolean chains 12 (nesting depth added 83). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ffi::topology::analyze (cognitive 81) crates/vcad-ffi/src/topology.rs:109— vcad_ffi::topology::analyze has cognitive complexity 81 (threshold 15). Drivers by points: if/else 20 (61 pts), loops 7 (17 pts), boolean chains 3 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ffi::cam_job::job (cognitive 70) crates/vcad-ffi/src/cam_job.rs:361— vcad_ffi::cam_job::job has cognitive complexity 70 (threshold 15). Drivers by points: if/else 29 (50 pts), loops 5 (9 pts), match/switch 3 (6 pts), boolean chains 5 (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.
vcad_ffi::recon::program_document (cognitive 56) crates/vcad-ffi/src/recon.rs:390— vcad_ffi::recon::program_document has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 6 (12 pts), match/switch 4 (9 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ffi::cam::generate (cognitive 35) crates/vcad-ffi/src/cam.rs:69— vcad_ffi::cam::generate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5, match/switch 2 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ffi::fea::cell_field (cognitive 35) crates/vcad-ffi/src/fea.rs:312— vcad_ffi::fea::cell_field has cognitive complexity 35 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 5 (16 pts), boolean chains 2 (nesting depth added 19). 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.
vcad_ffi::sound::call_with_scene (cognitive 28) crates/vcad-ffi/src/sound.rs:59— vcad_ffi::sound::call_with_scene has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 7 (22 pts), boolean chains 2, if/else 1 (2 pts), loops 1 (2 pts) (nesting depth added 17). 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.
vcad_ffi::clearance::check (cognitive 26) crates/vcad-ffi/src/clearance.rs:126— vcad_ffi::clearance::check has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, match/switch 2 (4 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.
vcad_ffi::train::run_training (cognitive 23) crates/vcad-ffi/src/train.rs:502— vcad_ffi::train::run_training has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, 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.
vcad_ffi::cam_job::simulate (cognitive 22) crates/vcad-ffi/src/cam_job.rs:694— vcad_ffi::cam_job::simulate has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 4 (7 pts), match/switch 1 (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.
vcad_ffi::gym::build_env (cognitive 20) crates/vcad-ffi/src/gym.rs:382— vcad_ffi::gym::build_env has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ffi::vcad_scene_raytrace_gpu (cognitive 19) crates/vcad-ffi/src/lib.rs:1173— vcad_ffi::vcad_scene_raytrace_gpu has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
vcad_ffi::fea::prepare (cognitive 19) crates/vcad-ffi/src/fea.rs:400— vcad_ffi::fea::prepare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 pts), match/switch 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.
vcad_ffi::schematic::simulate (cognitive 19) crates/vcad-ffi/src/schematic.rs:56— vcad_ffi::schematic::simulate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 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.
vcad_ffi::train::vcad_train_start (cognitive 18) crates/vcad-ffi/src/train.rs:672— vcad_ffi::train::vcad_train_start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 3, 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.
vcad_ffi::mcp::vcad_mcp_app_start (cognitive 17) crates/vcad-ffi/src/mcp.rs:287— vcad_ffi::mcp::vcad_mcp_app_start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), match/switch 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.
vcad_ffi::dfm::check_document (cognitive 16) crates/vcad-ffi/src/dfm.rs:142— vcad_ffi::dfm::check_document has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (7 pts), loops 4 (5 pts), if/else 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_dfm::rules::hobby_mill::r7_threads_and_gears (cognitive 61) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1759— vcad_kernel_dfm::rules::hobby_mill::r7_threads_and_gears has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 8 (16 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_dfm::rules::hobby_mill::link_loops (cognitive 53) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:596— vcad_kernel_dfm::rules::hobby_mill::link_loops has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 8 (14 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_dfm::rules::hobby_mill::r5_min_wall (cognitive 53) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1535— vcad_kernel_dfm::rules::hobby_mill::r5_min_wall has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 5 (8 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.
vcad_kernel_dfm::rules::cnc::run (cognitive 48) crates/vcad-kernel-dfm/src/rules/cnc.rs:33— vcad_kernel_dfm::rules::cnc::run has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (40 pts), loops 3 (6 pts), match/switch 1 (2 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.
vcad_kernel_dfm::rules::hobby_mill::union_segments (cognitive 46) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:463— vcad_kernel_dfm::rules::hobby_mill::union_segments has cognitive complexity 46 (threshold 15). Drivers by points: loops 12 (27 pts), if/else 6 (19 pts) (nesting depth added 28). 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.
vcad_kernel_dfm::geom::setups::plan (cognitive 44) crates/vcad-kernel-dfm/src/geom/setups.rs:126— vcad_kernel_dfm::geom::setups::plan has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 6 (9 pts), match/switch 1 (2 pts), boolean chains 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.
vcad_kernel_dfm::rules::cnc::thin_walls (cognitive 39) crates/vcad-kernel-dfm/src/rules/cnc.rs:422— vcad_kernel_dfm::rules::cnc::thin_walls has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_dfm::rules::casting::run (cognitive 34) crates/vcad-kernel-dfm/src/rules/casting.rs:15— vcad_kernel_dfm::rules::casting::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (4 pts), boolean chains 1 (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.
vcad_kernel_dfm::rules::fdm::run (cognitive 30) crates/vcad-kernel-dfm/src/rules/fdm.rs:11— vcad_kernel_dfm::rules::fdm::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_dfm::rules::mold::run (cognitive 28) crates/vcad-kernel-dfm/src/rules/mold.rs:16— vcad_kernel_dfm::rules::mold::run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_dfm::rules::cnc::internal_radii (cognitive 21) crates/vcad-kernel-dfm/src/rules/cnc.rs:331— vcad_kernel_dfm::rules::cnc::internal_radii has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 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.
vcad_kernel_dfm::rules::hobby_mill::r1_corner_radius (cognitive 21) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1048— vcad_kernel_dfm::rules::hobby_mill::r1_corner_radius has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (8 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.
vcad_kernel_dfm::rules::hobby_mill::r3_hole_diameters (cognitive 21) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1318— vcad_kernel_dfm::rules::hobby_mill::r3_hole_diameters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 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.
vcad_kernel_dfm::rules::hobby_mill::r2_reachability (cognitive 20) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1205— vcad_kernel_dfm::rules::hobby_mill::r2_reachability has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (6 pts), boolean chains 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.
vcad_kernel_dfm::rules::sheet::run (cognitive 20) crates/vcad-kernel-dfm/src/rules/sheet.rs:17— vcad_kernel_dfm::rules::sheet::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (2 pts) (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.
vcad_kernel_dfm::rules::hobby_mill::r4_plate_stock (cognitive 17) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1435— vcad_kernel_dfm::rules::hobby_mill::r4_plate_stock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
vcad_kernel_dfm::rules::hobby_mill::concave_runs (cognitive 16) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1154— vcad_kernel_dfm::rules::hobby_mill::concave_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 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.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×17
Edited copy of a member (7 corresponding lines) crates/vcad-ecad-pcb/src/router/grid.rs:61— crates/vcad-ecad-pcb/src/router/grid.rs:61-70 | crates/vcad-ecad-pcb/src/router/grid.rs:76-89 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-fea/src/adjoint.rs:497— crates/vcad-kernel-fea/src/adjoint.rs:497-503 | crates/vcad-kernel-fea/src/buckling.rs:353-359 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6433— crates/vcad-kernel-wasm/src/lib.rs:6433-6439 | crates/vcad-kernel-wasm/src/lib.rs:7194-7201 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsTools.swift:113— apple/VcadApp/Sources/VcadApp/ElectronicsTools.swift:113-122 | apple/VcadApp/Sources/VcadApp/ElectronicsTools.swift:163-169 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:399— apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:399-405 | apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:181-189 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) apple/VcadApp/Sources/VcadApp/ContactShadow.swift:170— apple/VcadApp/Sources/VcadApp/ContactShadow.swift:170-177 | apple/VcadApp/Sources/VcadApp/FieldOverlay.swift:167-173 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-ecad-pcb/src/impedance.rs:225— crates/vcad-ecad-pcb/src/impedance.rs:225-231 | crates/vcad-ecad-pcb/src/impedance.rs:235-248 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:7119— crates/vcad-kernel-wasm/src/lib.rs:7119-7125 | crates/vcad-kernel-wasm/src/lib.rs:7268-7275 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2707— apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2707-2713 | apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2726-2732 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/termview/src/rasterize.rs:26— crates/termview/src/rasterize.rs:26-32 | crates/vcad-kernel-magnetostatic/src/vec3.rs:68-74 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) apple/VcadApp/Sources/VcadApp/AssemblyPanel.swift:300— apple/VcadApp/Sources/VcadApp/AssemblyPanel.swift:300-307 | apple/VcadApp/Sources/VcadApp/FeatureTreeParameters.swift:66-72 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-photonics/src/design.rs:146— crates/vcad-kernel-photonics/src/design.rs:146-152 | crates/vcad-kernel-photonics/src/design.rs:155-162 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-app/src/feature.rs:1176— crates/vcad-app/src/feature.rs:1176-1182 | crates/vcad-app/src/materializer.rs:2101-2107 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:4477— crates/vcad-kernel-wasm/src/lib.rs:4477-4483 | crates/vcad-kernel-wasm/src/lib.rs:4519-4532 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-eval/src/kinematics.rs:92— crates/vcad-eval/src/kinematics.rs:92-99 | crates/vcad-kernel/src/faces.rs:557-563 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-neutronics/src/geometry.rs:105— crates/vcad-kernel-neutronics/src/geometry.rs:105-111 | crates/vcad-kernel-photon-dose/src/capture.rs:200-206 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:1795— crates/vcad-kernel-wasm/src/lib.rs:1795-1802 | crates/vcad-site-wasm/src/lib.rs:137-143 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×17
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-sheet/src/dxf.rs:122— crates/vcad-kernel-sheet/src/dxf.rs:122-134 | crates/vcad-kernel-sheet/src/dxf.rs:136-155 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-eval/src/step_doc.rs:246— crates/vcad-eval/src/step_doc.rs:246-259 | crates/vcad-parts/src/vacuum/mod.rs:598-610 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-ecad-symbols/src/kicad_write.rs:2535— crates/vcad-ecad-symbols/src/kicad_write.rs:2535-2548 | crates/vcad-ecad-symbols/src/kicad_write.rs:2742-2754 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-em/src/axisym.rs:354— crates/vcad-kernel-em/src/axisym.rs:354-367 | crates/vcad-kernel-em/src/planar.rs:236-248 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:144— crates/vcad-kernel-nurbs/src/lib.rs:144-160 | crates/vcad-kernel-step/src/entities/surfaces.rs:1120-1132 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-eval/src/thermal_extract.rs:772— crates/vcad-eval/src/thermal_extract.rs:772-784 | crates/vcad-printcheck/src/mesh.rs:100-112 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-cli/src/ui/tree.rs:19— crates/vcad-cli/src/ui/tree.rs:19-33 | crates/vcad-cli/src/ui/tree.rs:204-216 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-neutronics/src/materials.rs:531— crates/vcad-kernel-neutronics/src/materials.rs:531-543 | crates/vcad-kernel-photon-dose/src/materials.rs:232-246 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-ffi/src/import.rs:96— crates/vcad-ffi/src/import.rs:96-108 | crates/vcad-ffi/src/import.rs:239-251 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-sketch/src/profile.rs:417— crates/vcad-kernel-sketch/src/profile.rs:417-433 | crates/vcad-slicer/src/path.rs:30-42 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-booleans/src/classify.rs:1617— crates/vcad-kernel-booleans/src/classify.rs:1617-1629 | crates/vcad-kernel-booleans/src/classify.rs:1636-1651 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-ffi/src/recon.rs:721— crates/vcad-ffi/src/recon.rs:721-733 | crates/vcad-ffi/src/recon.rs:875-887 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-constraints/src/session.rs:50— crates/vcad-kernel-constraints/src/session.rs:50-66 | crates/vcad-kernel-particle/src/wire3d.rs:649-661 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-app/src/context.rs:219— crates/vcad-app/src/context.rs:219-231 | crates/vcad-app/src/context.rs:233-245 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel/src/lib.rs:2072— crates/vcad-kernel/src/lib.rs:2072-2084 | crates/vcad-kernel/src/lib.rs:2091-2103 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-tolerance/src/gdt.rs:389— crates/vcad-kernel-tolerance/src/gdt.rs:389-401 | crates/vcad-kernel-tolerance/src/gdt.rs:418-431 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:5337— crates/vcad-kernel-wasm/src/lib.rs:5337-5349 | crates/vcad-slicer/src/lib.rs:72-84 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×17
Edited copy of a member (10 corresponding lines) crates/vcad-ecad-fabprep/src/verdict.rs:506— crates/vcad-ecad-fabprep/src/verdict.rs:506-516 | crates/vcad-ecad-pcb/src/router/flow/realize.rs:226-235 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:48— apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:48-58 | apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:648-657 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-ecad-pcb/src/router/complete.rs:245— crates/vcad-ecad-pcb/src/router/complete.rs:245-254 | crates/vcad-ecad-pcb/src/router/legalize.rs:244-254 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:774— crates/vcad-kernel-wasm/src/lib.rs:774-783 | crates/vcad-kernel-wasm/src/lib.rs:869-878 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:525— apple/VcadApp/Sources/VcadApp/GlassChrome.swift:525-535 | apple/VcadApp/Sources/VcadApp/GlassChrome.swift:959-968 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-ffi/src/clearance.rs:34— crates/vcad-ffi/src/clearance.rs:34-43 | crates/vcad-kernel-shell/src/lib.rs:890-900 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-ffi/src/lib.rs:768— crates/vcad-ffi/src/lib.rs:768-780 | crates/vcad-ffi/src/lib.rs:866-875 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-kernel-cam/src/tool.rs:74— crates/vcad-kernel-cam/src/tool.rs:74-83 | crates/vcad-kernel-cam/src/tool.rs:100-109 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:1667— crates/vcad-ecad-pcb/src/drc.rs:1667-1676 | crates/vcad-ecad-pcb/src/drc.rs:1708-1717 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-ecad-symbols/src/kicad_pcb.rs:36— crates/vcad-ecad-symbols/src/kicad_pcb.rs:36-45 | crates/vcad-ecad-symbols/src/kicad_sch.rs:34-43 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-kernel/src/lib.rs:2427— crates/vcad-kernel/src/lib.rs:2427-2436 | crates/vcad-kernel/src/lib.rs:2447-2456 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-cli/src/app.rs:919— crates/vcad-cli/src/app.rs:919-928 | crates/vcad-cli/src/app.rs:932-941 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-kernel-tessellate/src/lib.rs:246— crates/vcad-kernel-tessellate/src/lib.rs:246-255 | crates/vcad-kernel-tessellate/src/lib.rs:439-448 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-chat/src/executor.rs:488— crates/vcad-chat/src/executor.rs:488-497 | crates/vcad-loon/src/convert.rs:3146-3159 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-kernel-fea/src/modal.rs:827— crates/vcad-kernel-fea/src/modal.rs:827-836 | crates/vcad-kernel-fea/src/modal.rs:845-855 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-ffi/src/mcp.rs:84— crates/vcad-ffi/src/mcp.rs:84-93 | crates/vcad-mcp/src/tasks.rs:55-66 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/vcad-mcp/src/tools/docs.rs:27— crates/vcad-mcp/src/tools/docs.rs:27-36 | crates/vcad-mcp/src/tools/proof.rs:73-82 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 3) crates/vcad-cli/src/app.rs:980— crates/vcad-cli/src/app.rs:980-986 | crates/vcad-cli/src/app.rs:987-993 | crates/vcad-cli/src/app.rs:994-1000 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:980` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 3) crates/vcad-cli/src/main.rs:1520— crates/vcad-cli/src/main.rs:1520-1526 | crates/vcad-cli/src/main.rs:2201-2207 | crates/vcad-cli/src/main.rs:5003-5009 — 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) crates/vcad-ecad-pcb/src/router/sco.rs:287— crates/vcad-ecad-pcb/src/router/sco.rs:287-293 | crates/vcad-ecad-pcb/src/router/sco.rs:313-319 | crates/vcad-ecad-pcb/src/router/sco.rs:551-557 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-pcb/src/router/sco.rs:320` calls `include` and `crates/vcad-ecad-pcb/src/router/sco.rs:558` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) crates/vcad-ffi/src/lib.rs:400— crates/vcad-ffi/src/lib.rs:400-406 | crates/vcad-ffi/src/lib.rs:482-488 | crates/vcad-ffi/src/lib.rs:551-557 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/vcad-ir/src/vcode.rs:1463— crates/vcad-ir/src/vcode.rs:1463-1469 | crates/vcad-ir/src/vcode.rs:1490-1496 | crates/vcad-ir/src/vcode.rs:1519-1525 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1463` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ir/src/vcode.rs:1517` calls `get`, `parse_f64`, `transpose` and `crates/vcad-ir/src/vcode.rs:1488` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) crates/vcad-kernel-acoustics/src/optimize.rs:70— crates/vcad-kernel-acoustics/src/optimize.rs:70-76 | crates/vcad-kernel-optics/src/optimize.rs:74-80 | crates/vcad-kernel-particle/src/optimize.rs:73-79 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-optics/src/optimize.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/vcad-kernel-flow/src/gpu.rs:341— crates/vcad-kernel-flow/src/gpu.rs:341-347 | crates/vcad-kernel-gpu/src/narrowphase.rs:179-185 | crates/vcad-kernel-gpu/src/wavefront_batch.rs:340-346 — 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) crates/vcad-kernel-tessellate/src/frozen.rs:290— crates/vcad-kernel-tessellate/src/frozen.rs:290-296 | crates/vcad-kernel-tessellate/src/frozen.rs:337-343 | crates/vcad-kernel-tessellate/src/frozen.rs:363-369 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-tessellate/src/frozen.rs:362` calls `cos`, `sin` and `crates/vcad-kernel-tessellate/src/frozen.rs:289` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) crates/vcad-kernel/src/sheet_json.rs:377— crates/vcad-kernel/src/sheet_json.rs:377-383 | crates/vcad-kernel/src/sheet_json.rs:603-609 | crates/vcad-kernel/src/sheet_json.rs:1309-1315 — 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) crates/vcad-kernel-booleans/src/bbox.rs:342— crates/vcad-kernel-booleans/src/bbox.rs:342-348 | crates/vcad-kernel-booleans/src/bbox.rs:399-405 | crates/vcad-kernel-booleans/src/bbox.rs:409-415 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/bbox.rs:342` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/vcad-kernel-cam/src/toolpath.rs:258— crates/vcad-kernel-cam/src/toolpath.rs:258-264 | crates/vcad-kernel-cam/src/toolpath.rs:266-272 | crates/vcad-kernel-cam/src/toolpath.rs:275-281 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 3) crates/vcad-kernel-booleans/src/freeze.rs:263— crates/vcad-kernel-booleans/src/freeze.rs:263-269 | crates/vcad-kernel-booleans/src/freeze.rs:500-506 | crates/vcad-kernel-booleans/src/repair.rs:271-277 — 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) crates/vcad-kernel-sketch/src/revolve.rs:423— crates/vcad-kernel-sketch/src/revolve.rs:423-429 | crates/vcad-kernel-sketch/src/revolve.rs:572-578 | crates/vcad-kernel-sketch/src/revolve.rs:624-630 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/revolve.rs:423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/vcad-torture/src/lib.rs:409— crates/vcad-torture/src/lib.rs:409-415 | crates/vcad-torture/src/lib.rs:427-433 | crates/vcad-torture/src/lib.rs:443-449 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-torture/src/lib.rs:409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-torture/src/lib.rs:407` calls `tangent_cases` and `crates/vcad-torture/src/lib.rs:425` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) crates/vcad-eval/src/sheet_build.rs:69— crates/vcad-eval/src/sheet_build.rs:69-75 | crates/vcad-eval/src/sheet_build.rs:93-99 | crates/vcad-eval/src/sheet_build.rs:113-119 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/sheet_build.rs:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/vcad-kernel-flow/src/adjoint.rs:333— crates/vcad-kernel-flow/src/adjoint.rs:333-339 | crates/vcad-kernel-flow/src/model.rs:442-448 | crates/vcad-kernel-flow/src/solve.rs:686-692 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×15
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-fea/src/mesh.rs:784— crates/vcad-kernel-fea/src/mesh.rs:784-797 | crates/vcad-kernel-topopt/src/domain.rs:173-187 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-ecad-pcb/src/router/claims_ir.rs:303— crates/vcad-ecad-pcb/src/router/claims_ir.rs:303-316 | crates/vcad-ecad-pcb/src/router/claims_ir.rs:398-411 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-atoms/src/homogenize.rs:382— crates/vcad-kernel-atoms/src/homogenize.rs:382-395 | crates/vcad-kernel-atoms/src/inverse.rs:48-61 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-booleans/src/split.rs:2526— crates/vcad-kernel-booleans/src/split.rs:2526-2540 | crates/vcad-kernel-photonics/src/material.rs:132-145 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:6740— crates/vcad-kernel-wasm/src/lib.rs:6740-6753 | crates/vcad-kernel-wasm/src/lib.rs:6774-6790 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-cam/src/turning/envelope.rs:59— crates/vcad-kernel-cam/src/turning/envelope.rs:59-72 | crates/vcad-kernel-raytrace/src/intersect/torus.rs:243-259 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:2099— crates/vcad-kernel-wasm/src/lib.rs:2099-2118 | crates/vcad-kernel-wasm/src/lib.rs:2130-2143 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-cli/src/ui/toolbar.rs:589— crates/vcad-cli/src/ui/toolbar.rs:589-602 | crates/vcad-cli/src/ui/toolbar.rs:605-622 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-step/src/entities/mod.rs:123— crates/vcad-kernel-step/src/entities/mod.rs:123-136 | crates/vcad-kernel-step/src/entities/mod.rs:138-151 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-ffi/src/err.rs:74— crates/vcad-ffi/src/err.rs:74-93 | crates/vcad-ffi/src/gym.rs:758-771 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-em/src/axisym.rs:333— crates/vcad-kernel-em/src/axisym.rs:333-346 | crates/vcad-kernel-em/src/planar.rs:203-221 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-app/src/keybinding.rs:228— crates/vcad-app/src/keybinding.rs:228-241 | crates/vcad-app/src/keybinding.rs:260-273 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:328— crates/vcad-kernel-nurbs/src/lib.rs:328-354 | crates/vcad-kernel-nurbs/src/lib.rs:777-790 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-embroidery/src/hoop.rs:34— crates/vcad-embroidery/src/hoop.rs:34-47 | crates/vcad-embroidery/src/hoop.rs:50-70 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/vcad-embroidery-dst/src/writer.rs:298— crates/vcad-embroidery-dst/src/writer.rs:298-311 | crates/vcad-embroidery/src/stats.rs:116-129 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (20 lines × 2) crates/vcad-embroidery-dst/src/writer.rs:75— crates/vcad-embroidery-dst/src/writer.rs:75-94 | crates/vcad-embroidery-dst/src/writer.rs:113-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-embroidery-dst/src/writer.rs:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:259— crates/vcad-kernel-booleans/src/classify.rs:259-278 | crates/vcad-kernel-booleans/src/classify.rs:467-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/vcad-kernel-sketch/src/revolve.rs:245— crates/vcad-kernel-sketch/src/revolve.rs:245-264 | crates/vcad-kernel-sketch/src/revolve.rs:270-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/revolve.rs:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:1085— crates/vcad-kernel-wasm/src/lib.rs:1085-1104 | crates/vcad-kernel-wasm/src/lib.rs:5179-5198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:10334— crates/vcad-kernel-wasm/src/lib.rs:10334-10353 | crates/vcad-kernel-wasm/src/lib.rs:10438-10457 — both copies are in the same file, so extract the block into 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) apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:75— apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:75-94 | apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift:75-94 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift` and `apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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) apple/VcadApp/Sources/VcadApp/Sim.swift:676— apple/VcadApp/Sources/VcadApp/Sim.swift:676-695 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:676-695 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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) apple/VcadApp/Sources/VcadApp/Sim.swift:702— apple/VcadApp/Sources/VcadApp/Sim.swift:702-721 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:702-721 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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) apple/VcadApp/Sources/VcadApp/SimController.swift:501— apple/VcadApp/Sources/VcadApp/SimController.swift:501-520 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:501-520 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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) apple/VcadApp/Sources/VcadApp/Editor.swift:4098— apple/VcadApp/Sources/VcadApp/Editor.swift:4098-4117 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4098-4117 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:2933— apple/VcadApp/Sources/VcadApp/Editor.swift:2933-2952 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2933-2952 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:2933` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (20 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4698— apple/VcadApp/Sources/VcadApp/Editor.swift:4698-4717 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4698-4717 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (20 lines × 2) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:322— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:322-341 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:322-341 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 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) apple/VcadApp/Sources/VcadApp/Document.swift:807— apple/VcadApp/Sources/VcadApp/Document.swift:807-826 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:807-826 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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) apple/VcadApp/Sources/VcadApp/SimPanel.swift:116— apple/VcadApp/Sources/VcadApp/SimPanel.swift:116-135 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:116-135 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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.
vcad_eval::cavity_extract::extract_cavity (cyclomatic 105) crates/vcad-eval/src/cavity_extract.rs:687— vcad_eval::cavity_extract::extract_cavity has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_eval::evaluate::evaluate_op_timed (cyclomatic 100) crates/vcad-eval/src/evaluate.rs:1120— vcad_eval::evaluate::evaluate_op_timed has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_eval::evaluate::evaluate_inner (cyclomatic 90) crates/vcad-eval/src/evaluate.rs:131— vcad_eval::evaluate::evaluate_inner has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_eval::antenna_extract::extract_antenna_spec (cyclomatic 70) crates/vcad-eval/src/antenna_extract.rs:338— vcad_eval::antenna_extract::extract_antenna_spec has cyclomatic complexity 70 (threshold 15). Of this number, 69 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.
vcad_eval::optimize::optimize_document (cyclomatic 38) crates/vcad-eval/src/optimize.rs:1565— vcad_eval::optimize::optimize_document 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.
vcad_eval::sim_extract::em::extract_axisym_mag_spec_from_scene (cyclomatic 37) crates/vcad-eval/src/sim_extract/em.rs:493— vcad_eval::sim_extract::em::extract_axisym_mag_spec_from_scene 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.
vcad_eval::pcb_preview::pcb_preview_meshes (cyclomatic 32) crates/vcad-eval/src/pcb_preview.rs:151— vcad_eval::pcb_preview::pcb_preview_meshes 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.
vcad_eval::thermal_extract::extract_thermal_spec_from_scene (cyclomatic 32) crates/vcad-eval/src/thermal_extract.rs:1168— vcad_eval::thermal_extract::extract_thermal_spec_from_scene 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.
vcad_eval::sim_extract::tolerance::extract_stackup_spec_from_scene (cyclomatic 20) crates/vcad-eval/src/sim_extract/tolerance.rs:351— vcad_eval::sim_extract::tolerance::extract_stackup_spec_from_scene 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.
vcad_eval::sim_extract::chamber_cavity (cyclomatic 19) crates/vcad-eval/src/sim_extract.rs:651— vcad_eval::sim_extract::chamber_cavity 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.
vcad_eval::evaluate::evaluate_text_extrude (cyclomatic 18) crates/vcad-eval/src/evaluate.rs:2390— vcad_eval::evaluate::evaluate_text_extrude 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: vcad_eval::evaluate::op_name (cyclomatic 43) 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.
vcad_eval::sim_extract::em::rev_section (cyclomatic 18) crates/vcad-eval/src/sim_extract/em.rs:262— vcad_eval::sim_extract::em::rev_section 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.
vcad_eval::sensitivity::document_sensitivities (cyclomatic 17) crates/vcad-eval/src/sensitivity.rs:472— vcad_eval::sensitivity::document_sensitivities 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.
vcad_eval::sim_extract::extract_device_spec_from_scene (cyclomatic 17) crates/vcad-eval/src/sim_extract.rs:902— vcad_eval::sim_extract::extract_device_spec_from_scene 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.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×14
Edited copy of a member (15 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:2095— apple/VcadApp/Sources/VcadApp/Editor.swift:2095-2109 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2095-2109 — 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) crates/vcad-kernel-sketch/src/extrude.rs:1351— crates/vcad-kernel-sketch/src/extrude.rs:1351-1368 | crates/vcad-kernel-sketch/src/extrude.rs:1382-1408 — 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) crates/vcad-render/src/lib.rs:4180— crates/vcad-render/src/lib.rs:4180-4198 | crates/vcad-render/src/lib.rs:4216-4230 — 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) crates/vcad-ecad-pcb/src/pour_synth.rs:528— crates/vcad-ecad-pcb/src/pour_synth.rs:528-542 | crates/vcad-ecad-pcb/src/pour_synth.rs:550-564 — 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) crates/vcad-cli/src/main.rs:1377— crates/vcad-cli/src/main.rs:1377-1391 | crates/vcad-render/src/main.rs:1062-1076 — 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) crates/vcad-kernel-booleans/src/cyl_band.rs:133— crates/vcad-kernel-booleans/src/cyl_band.rs:133-149 | crates/vcad-kernel-neutronics/src/dose.rs:45-59 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) REDACTED:1083— REDACTED:1083-1097 | REDACTED:1104-1119 — 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) crates/vcad-parts/src/vacuum/flanges.rs:272— crates/vcad-parts/src/vacuum/flanges.rs:272-289 | crates/vcad-parts/src/vacuum/flanges.rs:708-722 — 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) crates/vcad-kernel-antenna/src/geometry.rs:117— crates/vcad-kernel-antenna/src/geometry.rs:117-131 | crates/vcad-kernel-antenna/src/geometry.rs:141-157 — 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) crates/vcad-kernel-em/src/planar.rs:722— crates/vcad-kernel-em/src/planar.rs:722-738 | crates/vcad-kernel-em/src/planar.rs:740-754 — 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) crates/vcad-eval/src/evaluate.rs:2829— crates/vcad-eval/src/evaluate.rs:2829-2843 | crates/vcad-eval/src/evaluate.rs:2918-2933 — 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) crates/vcad-ecad-symbols/src/kicad_board.rs:23— crates/vcad-ecad-symbols/src/kicad_board.rs:23-37 | crates/vcad-loon/src/convert.rs:959-973 — 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) crates/vcad-kernel-cam/src/post/grbl.rs:260— crates/vcad-kernel-cam/src/post/grbl.rs:260-274 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:326-343 — 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) crates/vcad-ecad-symbols/src/footprint.rs:227— crates/vcad-ecad-symbols/src/footprint.rs:227-241 | crates/vcad-ecad-symbols/src/builtin.rs:112-126 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×14
Edited copy of a member (12 corresponding lines) crates/vcad-render/src/photoreal.rs:792— crates/vcad-render/src/photoreal.rs:792-814 | crates/vcad-render/src/photoreal_gpu.rs:344-470 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) apple/VcadApp/Sources/VcadApp/SketchInference.swift:288— apple/VcadApp/Sources/VcadApp/SketchInference.swift:288-299 | apple/VcadApp/Sources/VcadApp/SketchInference.swift:314-327 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-ecad-sim/src/circuit/ac.rs:98— crates/vcad-ecad-sim/src/circuit/ac.rs:98-109 | crates/vcad-kernel-antenna/src/complex.rs:103-114 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-eval/src/sim_extract.rs:301— crates/vcad-eval/src/sim_extract.rs:301-313 | crates/vcad-eval/src/thermal_extract.rs:527-538 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-kernel-fea/src/buckling.rs:315— crates/vcad-kernel-fea/src/buckling.rs:315-326 | crates/vcad-kernel-fea/src/solve.rs:538-550 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-ecad-pcb/src/session.rs:570— crates/vcad-ecad-pcb/src/session.rs:570-592 | crates/vcad-ecad-pcb/src/session.rs:624-635 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-kernel-booleans/src/mesh/csg.rs:211— crates/vcad-kernel-booleans/src/mesh/csg.rs:211-222 | crates/vcad-kernel/src/faces.rs:620-634 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:1108— crates/vcad-kernel-wasm/src/lib.rs:1108-1121 | crates/vcad-kernel-wasm/src/lib.rs:1125-1136 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-ecad-pcb/src/dfm.rs:502— crates/vcad-ecad-pcb/src/dfm.rs:502-513 | crates/vcad-ecad-pcb/src/router/escape.rs:86-100 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-runtime/src/history.rs:113— crates/vcad-runtime/src/history.rs:113-124 | crates/vcad-runtime/src/history.rs:127-138 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-kernel-step/src/entities/curves.rs:90— crates/vcad-kernel-step/src/entities/curves.rs:90-105 | crates/vcad-kernel-step/src/entities/topology.rs:110-121 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) apple/VcadApp/Sources/VcadApp/DocumentExport.swift:204— apple/VcadApp/Sources/VcadApp/DocumentExport.swift:204-215 | apple/VcadApp/Sources/VcadApp/PhotoImport.swift:389-400 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/vcad-kernel-booleans/src/split.rs:5758— crates/vcad-kernel-booleans/src/split.rs:5758-5769 | crates/vcad-kernel-booleans/src/ssi.rs:323-334 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/termview/src/buffer.rs:60— crates/termview/src/buffer.rs:60-71 | crates/termview/src/buffer.rs:80-91 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (9 lines × 3) crates/vcad-cli/src/main.rs:1472— crates/vcad-cli/src/main.rs:1472-1480 | crates/vcad-cli/src/main.rs:3393-3401 | crates/vcad-cli/src/main.rs:3586-3594 — 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) crates/vcad-ecad-package/src/derive.rs:102— crates/vcad-ecad-package/src/derive.rs:102-110 | crates/vcad-ecad-symbols/src/builtin.rs:16-24 | crates/vcad-ecad-symbols/src/footprint.rs:62-70 — before extracting anything, compare `crates/vcad-ecad-symbols/src/builtin.rs` and `crates/vcad-ecad-symbols/src/footprint.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) crates/vcad-eval/src/cavity_extract.rs:326— crates/vcad-eval/src/cavity_extract.rs:326-334 | crates/vcad-eval/src/sim_extract.rs:353-362 | crates/vcad-eval/src/thermal_extract.rs:572-580 — before extracting anything, compare `crates/vcad-eval/src/cavity_extract.rs` and `crates/vcad-eval/src/sim_extract.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/cavity_extract.rs:326` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) crates/vcad-kernel-acoustics/src/optimize.rs:83— crates/vcad-kernel-acoustics/src/optimize.rs:83-91 | crates/vcad-kernel-optics/src/optimize.rs:95-103 | crates/vcad-kernel-particle/src/optimize.rs:86-94 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-optics/src/optimize.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/vcad-kernel-booleans/src/split.rs:803— crates/vcad-kernel-booleans/src/split.rs:803-811 | crates/vcad-kernel-booleans/src/split.rs:3127-3135 | crates/vcad-kernel-booleans/src/split.rs:3487-3495 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:803` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) crates/vcad-kernel-fea/src/mesh.rs:129— crates/vcad-kernel-fea/src/mesh.rs:129-137 | crates/vcad-kernel-fea/src/mesh.rs:562-570 | crates/vcad-kernel-topopt/src/domain.rs:91-99 — before extracting anything, compare `crates/vcad-kernel-fea/src/mesh.rs` and `crates/vcad-kernel-topopt/src/domain.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-fea/src/mesh.rs:561` calls `clamp` and `crates/vcad-kernel-fea/src/mesh.rs:128` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) crates/vcad-kernel-features/src/lib.rs:176— crates/vcad-kernel-features/src/lib.rs:176-184 | mecheval/graders/src/fillets.rs:53-61 | mecheval/graders/src/holes.rs:78-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:5257— crates/vcad-kernel-tessellate/src/lib.rs:5257-5265 | crates/vcad-kernel-tessellate/src/lib.rs:5289-5297 | crates/vcad-kernel-tessellate/src/lib.rs:6195-6203 — 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) crates/vcad-kernel-thermal/src/adjoint.rs:268— crates/vcad-kernel-thermal/src/adjoint.rs:268-276 | crates/vcad-kernel-thermal/src/graph.rs:239-247 | crates/vcad-kernel-thermal/src/solve.rs:721-729 — 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 (9 lines × 3) crates/vcad-kernel-diff/src/adjoint.rs:301— crates/vcad-kernel-diff/src/adjoint.rs:301-309 | crates/vcad-kernel-diff/src/seam.rs:389-397 | crates/vcad-kernel-diff/src/second_order.rs:200-208 — before extracting anything, compare `crates/vcad-kernel-diff/src/adjoint.rs` and `crates/vcad-kernel-diff/src/seam.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/adjoint.rs:301` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/vcad-ir/src/file_io.rs:642— crates/vcad-ir/src/file_io.rs:642-650 | crates/vcad-ir/src/file_io.rs:653-661 | crates/vcad-ir/src/file_io.rs:664-672 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/file_io.rs:642` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ir/src/file_io.rs:649` calls `to_string` and `crates/vcad-ir/src/file_io.rs:638` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) crates/vcad-ecad-symbols/src/footprint.rs:2241— crates/vcad-ecad-symbols/src/footprint.rs:2241-2249 | crates/vcad-ecad-symbols/src/footprint.rs:2258-2266 | crates/vcad-ecad-symbols/src/footprint.rs:2275-2283 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/footprint.rs:2241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) crates/vcad-app/src/migrate.rs:504— crates/vcad-app/src/migrate.rs:504-512 | crates/vcad-app/src/migrate.rs:570-578 | crates/vcad-app/src/migrate.rs:587-595 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/migrate.rs:504` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) crates/vcad-kernel-dfm/src/rules/casting.rs:67— crates/vcad-kernel-dfm/src/rules/casting.rs:67-75 | crates/vcad-kernel-dfm/src/rules/mold.rs:91-99 | crates/vcad-kernel-dfm/src/rules/sheet.rs:57-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/rules/casting.rs:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/vcad-app/src/materializer.rs:677— crates/vcad-app/src/materializer.rs:677-688 | crates/vcad-app/src/materializer.rs:718-723 | crates/vcad-app/src/materializer.rs:753-764 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/materializer.rs:677` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) crates/vcad-kernel-booleans/src/mesh/mod.rs:178— crates/vcad-kernel-booleans/src/mesh/mod.rs:178-183 | crates/vcad-kernel-fillet/src/topology.rs:184-189 | crates/vcad-kernel-shell/src/lib.rs:1336-1341 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/mod.rs` and `crates/vcad-kernel-shell/src/lib.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 (6 lines × 3) crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:199— crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:199-204 | crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:235-240 | crates/vcad-kernel-drafting/src/section.rs:616-621 — 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) crates/vcad-kernel-drafting/src/edge_extract.rs:457— crates/vcad-kernel-drafting/src/edge_extract.rs:457-462 | crates/vcad-kernel-drafting/src/hidden_line.rs:430-436 | crates/vcad-kernel-raytrace/src/trim.rs:919-925 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/edge_extract.rs:457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/vcad-kernel-sketch/src/extrude.rs:1207— crates/vcad-kernel-sketch/src/extrude.rs:1207-1212 | crates/vcad-kernel-sweep/src/loft.rs:184-189 | crates/vcad-kernel-sweep/src/sweep.rs:285-290 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/loft.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 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 (6 lines × 3) crates/vcad-kernel-stocksim/src/verify.rs:296— crates/vcad-kernel-stocksim/src/verify.rs:296-301 | crates/vcad-kernel-tessellate/src/clearance.rs:499-504 | mecheval/graders/src/fit.rs:244-250 — before extracting anything, compare `crates/vcad-kernel-stocksim/src/verify.rs` and `crates/vcad-kernel-tessellate/src/clearance.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-stocksim/src/verify.rs:296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:4584— crates/vcad-kernel-tessellate/src/lib.rs:4584-4589 | crates/vcad-kernel-tessellate/src/lib.rs:7071-7076 | crates/vcad-kernel-tessellate/src/lib.rs:7269-7274 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:4584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/vcad-kernel-wasm/src/lib.rs:5956— crates/vcad-kernel-wasm/src/lib.rs:5956-5961 | crates/vcad-kernel-wasm/src/lib.rs:5990-5995 | crates/vcad-kernel-wasm/src/lib.rs:6023-6028 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:5956` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/vcad-kernel-wasm/src/lib.rs:9342— crates/vcad-kernel-wasm/src/lib.rs:9342-9348 | crates/vcad-kernel-wasm/src/lib.rs:9558-9563 | crates/vcad-kernel-wasm/src/lib.rs:9663-9669 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:9342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) crates/vcad-kernel-sheet/src/poly2d.rs:114— crates/vcad-kernel-sheet/src/poly2d.rs:114-119 | crates/vcad-kernel-sheet/src/unfold.rs:365-370 | crates/vcad-kernel/src/sheet_json.rs:866-871 — 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) crates/vcad-kernel-step/src/entities/curves.rs:113— crates/vcad-kernel-step/src/entities/curves.rs:113-118 | crates/vcad-kernel-step/src/entities/surfaces.rs:134-139 | crates/vcad-kernel-step/src/entities/surfaces.rs:193-198 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-step/src/entities/curves.rs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/vcad-cli/src/repl.rs:143— crates/vcad-cli/src/repl.rs:143-148 | crates/vcad-cli/src/repl.rs:157-162 | crates/vcad-cli/src/repl.rs:170-175 — 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) crates/vcad-ir/src/resolve.rs:363— crates/vcad-ir/src/resolve.rs:363-368 | crates/vcad-ir/src/resolve.rs:404-409 | crates/vcad-ir/src/resolve.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/resolve.rs:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ir/src/resolve.rs:472` calls `strip_prefix` and `crates/vcad-ir/src/resolve.rs:360` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) crates/vcad-ecad-symbols/src/kicad_write.rs:937— crates/vcad-ecad-symbols/src/kicad_write.rs:937-942 | crates/vcad-ecad-symbols/src/kicad_write.rs:972-977 | crates/vcad-ecad-symbols/src/kicad_write.rs:986-991 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/kicad_write.rs:937` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X2 · Cancellation propagation· Async function without AbortSignal · ×14
Async function without AbortSignal: buildBoard www/public/kit/gallery.js:656— `buildBoard` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: __wbg_init packages/kernel-wasm/vcad_kernel_wasm.js:11830— `__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchAndPrimeKernelWasm packages/app/src/lib/bootstrap.ts:159— `fetchAndPrimeKernelWasm` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: loadCompressedField packages/app/src/lib/compressed-field.ts:93— `loadCompressedField` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: loadFieldStack packages/app/src/lib/compressed-field.ts:183— `loadFieldStack` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: discoverPrinters packages/app/src/lib/print-relay.ts:51— `discoverPrinters` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: connectPrinter packages/app/src/lib/print-relay.ts:58— `connectPrinter` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: getPrinterStatus packages/app/src/lib/print-relay.ts:75— `getPrinterStatus` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: sendPrint packages/app/src/lib/print-relay.ts:82— `sendPrint` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: controlPrinter packages/app/src/lib/print-relay.ts:108— `controlPrinter` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchBuffer packages/app/src/lib/urdf-meshes.ts:28— `fetchBuffer` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: check packages/app/src/hooks/useAppUpdate.ts:50— `check` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: wake packages/app/public/launch/launch.js:473— `wake` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: listen apple/VcadApp/scripts/vcad-app-mcp.mjs:86— `listen` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
vcad_kernel_particle::bem::solve (cognitive 67) crates/vcad-kernel-particle/src/bem.rs:389— vcad_kernel_particle::bem::solve has cognitive complexity 67 (threshold 15). Drivers by points: loops 15 (29 pts), if/else 18 (28 pts), boolean chains 7, 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.
vcad_kernel_particle::poisson::solve_with_chamber (cognitive 49) crates/vcad-kernel-particle/src/poisson.rs:167— vcad_kernel_particle::poisson::solve_with_chamber has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 10 (19 pts), boolean chains 1, match/switch 1 (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.
vcad_kernel_particle::optimize::maximize_hybrid (cognitive 38) crates/vcad-kernel-particle/src/optimize.rs:332— vcad_kernel_particle::optimize::maximize_hybrid has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 5 (13 pts), boolean chains 2, 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.
vcad_kernel_particle::chain::trace_ion (cognitive 37) crates/vcad-kernel-particle/src/chain.rs:571— vcad_kernel_particle::chain::trace_ion has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 5 (7 pts), boolean chains 2, match/switch 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.
vcad_kernel_particle::adjoint::adjoint_poisson (cognitive 35) crates/vcad-kernel-particle/src/adjoint.rs:482— vcad_kernel_particle::adjoint::adjoint_poisson has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 6 (13 pts), boolean chains 1 (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.
vcad_kernel_particle::electrode_opt::optimize_electrodes (cognitive 35) crates/vcad-kernel-particle/src/electrode_opt.rs:196— vcad_kernel_particle::electrode_opt::optimize_electrodes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (22 pts), loops 4 (5 pts), match/switch 2 (5 pts), boolean chains 3 (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.
vcad_kernel_particle::chain::run_from (cognitive 33) crates/vcad-kernel-particle/src/chain.rs:1009— vcad_kernel_particle::chain::run_from has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 5 (7 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.
vcad_kernel_particle::optimize::maximize (cognitive 24) crates/vcad-kernel-particle/src/optimize.rs:54— vcad_kernel_particle::optimize::maximize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (9 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.
vcad_kernel_particle::space_charge::solve_grounded_source (cognitive 24) crates/vcad-kernel-particle/src/space_charge.rs:164— vcad_kernel_particle::space_charge::solve_grounded_source has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_particle::adjoint::yield_gradient (cognitive 23) crates/vcad-kernel-particle/src/adjoint.rs:93— vcad_kernel_particle::adjoint::yield_gradient has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 2 (7 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_particle::chain::predict (cognitive 21) crates/vcad-kernel-particle/src/chain.rs:1409— vcad_kernel_particle::chain::predict has cognitive complexity 21 (threshold 15). Drivers by points: loops 9 (12 pts), if/else 6, match/switch 1 (3 pts) (nesting depth added 5). 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.
vcad_kernel_particle::receipt::compare (cognitive 21) crates/vcad-kernel-particle/src/receipt.rs:374— vcad_kernel_particle::receipt::compare has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), loops 2, 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.
vcad_kernel_particle::optimize::maximize_with_gradient (cognitive 18) crates/vcad-kernel-particle/src/optimize.rs:157— vcad_kernel_particle::optimize::maximize_with_gradient has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 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.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×13
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-em/src/axisym.rs:858— crates/vcad-kernel-em/src/axisym.rs:858-879 | crates/vcad-kernel-em/src/axisym.rs:888-908 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) apple/VcadApp/Sources/VcadApp/AgentInstall.swift:146— apple/VcadApp/Sources/VcadApp/AgentInstall.swift:146-161 | apple/VcadApp/Sources/VcadApp/ConnectClaude.swift:49-64 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:8059— crates/vcad-kernel-wasm/src/lib.rs:8059-8074 | crates/vcad-kernel-wasm/src/lib.rs:8086-8102 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-wasm/src/document_engine.rs:466— crates/vcad-kernel-wasm/src/document_engine.rs:466-481 | crates/vcad-kernel-wasm/src/document_engine.rs:486-509 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-ffi/src/engine.rs:217— crates/vcad-ffi/src/engine.rs:217-236 | crates/vcad-ffi/src/engine.rs:276-291 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-ecad-symbols/src/footprint.rs:565— crates/vcad-ecad-symbols/src/footprint.rs:565-580 | crates/vcad-ecad-symbols/src/footprint.rs:585-603 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-diff/src/mass.rs:165— crates/vcad-kernel-diff/src/mass.rs:165-180 | crates/vcad-kernel-diff/src/seam.rs:469-484 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-ffi/src/gym.rs:1070— crates/vcad-ffi/src/gym.rs:1070-1090 | crates/vcad-ffi/src/lib.rs:1325-1340 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-physics/src/diff.rs:152— crates/vcad-kernel-physics/src/diff.rs:152-167 | crates/vcad-kernel-physics/src/diff.rs:172-187 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:2914— crates/vcad-kernel-wasm/src/lib.rs:2914-2929 | crates/vcad-kernel-wasm/src/lib.rs:2949-2964 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:477— crates/vcad-kernel-nurbs/src/lib.rs:477-492 | crates/vcad-kernel-nurbs/src/lib.rs:983-998 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-ecad-symbols/src/builtin.rs:29— crates/vcad-ecad-symbols/src/builtin.rs:29-44 | crates/vcad-ecad-symbols/src/footprint.rs:100-123 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/vcad-ir/src/file_io.rs:466— crates/vcad-ir/src/file_io.rs:466-481 | crates/vcad-ir/src/file_io.rs:484-501 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 2) crates/vcad-kernel-raytrace/src/trim.rs:815— crates/vcad-kernel-raytrace/src/trim.rs:815-832 | crates/vcad-kernel-raytrace/src/trim.rs:849-866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/trim.rs:815` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/vcad-render/src/animate.rs:598— crates/vcad-render/src/animate.rs:598-615 | crates/vcad-render/src/animate.rs:696-713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/animate.rs:598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/vcad-kernel-booleans/src/split.rs:3129— crates/vcad-kernel-booleans/src/split.rs:3129-3146 | crates/vcad-kernel-booleans/src/split.rs:3489-3506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:3129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/vcad-ecad-pcb/src/router/length_match.rs:325— crates/vcad-ecad-pcb/src/router/length_match.rs:325-342 | crates/vcad-ecad-pcb/src/router/length_match.rs:852-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/length_match.rs:325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:404— apple/VcadApp/Sources/VcadApp/Editor.swift:404-421 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:404-421 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:971— apple/VcadApp/Sources/VcadApp/Editor.swift:971-988 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:971-988 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:2003— apple/VcadApp/Sources/VcadApp/Editor.swift:2003-2020 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2003-2020 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:2771— apple/VcadApp/Sources/VcadApp/Editor.swift:2771-2788 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2771-2788 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:2771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) apple/VcadApp/Sources/VcadApp/Sim.swift:617— apple/VcadApp/Sources/VcadApp/Sim.swift:617-634 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:617-634 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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) apple/VcadApp/Sources/VcadApp/VisionShell.swift:172— apple/VcadApp/Sources/VcadApp/VisionShell.swift:172-189 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:172-189 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/VisionShell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 201 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) apple/VcadApp/Sources/VcadApp/Document.swift:310— apple/VcadApp/Sources/VcadApp/Document.swift:310-327 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:310-327 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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) apple/VcadApp/Sources/VcadApp/Editor.swift:1357— apple/VcadApp/Sources/VcadApp/Editor.swift:1357-1374 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1357-1374 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1622— apple/VcadApp/Sources/VcadApp/Editor.swift:1622-1639 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1622-1639 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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.
Sync-over-async blocking REDACTED:78— `writeFileSync` in `callback to createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/engine/src/wasm-singleton.ts:191— `fs.readFileSync` in `loadAndInit` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/resvg-loader.ts:33— `readFileSync` in `loadWasm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/session.ts:488— `writeFileSync` in `saveDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/session.ts:498— `writeFileSync` in `saveDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/session.ts:632— `readFileSync` in `loadDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/session.ts:728— `readFileSync` in `loadDocumentFromPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/verify.ts:188— `existsSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/verify.ts:209— `mkdtempSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/verify.ts:212— `writeFileSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/mcp/src/tools/verify.ts:263— `rmSync` in `verifyPart` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/training/src/multimodal.ts:81— `fs.mkdirSync` in `generateImageIRPairs` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/training/src/multimodal.ts:124— `fs.writeFileSync` in `generateImageIRPairs` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
vcad_ecad_symbols::footprint::match_family (cyclomatic 83) crates/vcad-ecad-symbols/src/footprint.rs:1757— vcad_ecad_symbols::footprint::match_family has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_ecad_symbols::altium::build_pcb (cyclomatic 48) crates/vcad-ecad-symbols/src/altium/mod.rs:468— vcad_ecad_symbols::altium::build_pcb 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.
vcad_ecad_symbols::eagle_brd::parse_eagle_brd (cyclomatic 33) crates/vcad-ecad-symbols/src/eagle_brd.rs:19— vcad_ecad_symbols::eagle_brd::parse_eagle_brd 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.
vcad_ecad_symbols::footprint::match_power_family (cyclomatic 33) crates/vcad-ecad-symbols/src/footprint.rs:1665— vcad_ecad_symbols::footprint::match_power_family 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.
vcad_ecad_symbols::kicad_write::write_library_body (cyclomatic 25) crates/vcad-ecad-symbols/src/kicad_write.rs:649— vcad_ecad_symbols::kicad_write::write_library_body has cyclomatic complexity 25 (threshold 15). Of this number, 21 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.
vcad_ecad_symbols::kicad_write::auto_layout (cyclomatic 25) crates/vcad-ecad-symbols/src/kicad_write.rs:1854— vcad_ecad_symbols::kicad_write::auto_layout has cyclomatic complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_ecad_symbols::kicad_sch::reconstruct_nets (cyclomatic 17) crates/vcad-ecad-symbols/src/kicad_sch.rs:268— vcad_ecad_symbols::kicad_sch::reconstruct_nets 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_ecad_symbols::kicad_sym::parse_symbol (cyclomatic 17) crates/vcad-ecad-symbols/src/kicad_sym.rs:238— vcad_ecad_symbols::kicad_sym::parse_symbol 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.
vcad_ecad_symbols::kicad_write::net_stubs (cyclomatic 17) crates/vcad-ecad-symbols/src/kicad_write.rs:2086— vcad_ecad_symbols::kicad_write::net_stubs 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.
vcad_ecad_symbols::kicad_board::place_footprint (cyclomatic 16) crates/vcad-ecad-symbols/src/kicad_board.rs:133— vcad_ecad_symbols::kicad_board::place_footprint 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.
vcad_ecad_symbols::kicad_pcb::parse_footprint (cyclomatic 16) crates/vcad-ecad-symbols/src/kicad_pcb.rs:1020— vcad_ecad_symbols::kicad_pcb::parse_footprint 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: vcad_ecad_symbols::kicad_pcb::parse_layer (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
vcad_ecad_symbols::kicad_write::flip_sx (cyclomatic 16) crates/vcad-ecad-symbols/src/kicad_write.rs:798— vcad_ecad_symbols::kicad_write::flip_sx 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.
vcad_app::materializer::materialize_doc_extras (cognitive 104) crates/vcad-app/src/materializer.rs:556— vcad_app::materializer::materialize_doc_extras has cognitive complexity 104 (threshold 15). Drivers by points: if/else 53 (104 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_app::migrate::migrate_node (cognitive 81) crates/vcad-app/src/migrate.rs:336— vcad_app::migrate::migrate_node has cognitive complexity 81 (threshold 15). Drivers by points: if/else 33 (70 pts), loops 4 (7 pts), match/switch 3 (4 pts) (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.
vcad_app::migrate::migrate_assembly (cognitive 61) crates/vcad-app/src/migrate.rs:1062— vcad_app::migrate::migrate_assembly has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (50 pts), match/switch 2 (6 pts), loops 3 (5 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_app::materializer::materialize_feature (cognitive 50) crates/vcad-app/src/materializer.rs:606— vcad_app::materializer::materialize_feature has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (33 pts), match/switch 7 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_app::migrate::migrate_v1_mapped (cognitive 44) crates/vcad-app/src/migrate.rs:83— vcad_app::migrate::migrate_v1_mapped has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 4 (7 pts), boolean chains 2 (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.
vcad_app::doc_edits::lower (cognitive 41) crates/vcad-app/src/doc_edits.rs:28— vcad_app::doc_edits::lower has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 4 (7 pts), loops 2 (5 pts), boolean chains 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.
vcad_app::ecad_tools::sync_schematic_data (cognitive 41) crates/vcad-app/src/ecad_tools.rs:184— vcad_app::ecad_tools::sync_schematic_data has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 6 (9 pts), match/switch 1 (4 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.
vcad_app::tools::lower_update (cognitive 36) crates/vcad-app/src/tools.rs:333— vcad_app::tools::lower_update has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (7 pts), match/switch 4 (7 pts), boolean chains 6 (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.
vcad_app::materializer::materialize (cognitive 24) crates/vcad-app/src/materializer.rs:294— vcad_app::materializer::materialize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (4 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.
vcad_app::doc_edits::move_footprint (cognitive 21) crates/vcad-app/src/doc_edits.rs:423— vcad_app::doc_edits::move_footprint has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (5 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.
vcad_app::migrate::remap_bindings (cognitive 18) crates/vcad-app/src/migrate.rs:241— vcad_app::migrate::remap_bindings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (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.
vcad_app::tools::lower (cognitive 18) crates/vcad-app/src/tools.rs:24— vcad_app::tools::lower has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (9 pts), match/switch 3 (5 pts), loops 1 (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.
Duplicated block (23 lines × 2) crates/vcad-kernel-cam/src/post/grbl.rs:221— crates/vcad-kernel-cam/src/post/grbl.rs:221-243 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:282-304 — before extracting anything, compare `crates/vcad-kernel-cam/src/post/grbl.rs` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 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) crates/vcad-kernel-em/src/ac.rs:201— crates/vcad-kernel-em/src/ac.rs:201-223 | crates/vcad-kernel-em/src/grid.rs:479-501 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/ac.rs:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:842— crates/vcad-kernel-tessellate/src/lib.rs:842-864 | crates/vcad-kernel-tessellate/src/lib.rs:948-970 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-flow/src/adjoint.rs:268— crates/vcad-kernel-flow/src/adjoint.rs:268-290 | crates/vcad-kernel-flow/src/solve.rs:404-426 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:268` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) crates/vcad-kernel-flow/src/gpu.rs:203— crates/vcad-kernel-flow/src/gpu.rs:203-225 | crates/vcad-kernel-gpu/src/wavefront.rs:181-205 — before extracting anything, compare `crates/vcad-kernel-flow/src/gpu.rs` and `crates/vcad-kernel-gpu/src/wavefront.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/gpu.rs:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1393— apple/VcadApp/Sources/VcadApp/Editor.swift:1393-1415 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1393-1415 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 lines × 2) apple/VcadApp/Sources/VcadApp/Sim.swift:433— apple/VcadApp/Sources/VcadApp/Sim.swift:433-455 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:433-455 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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 lines × 2) apple/VcadApp/Sources/VcadApp/Sim.swift:546— apple/VcadApp/Sources/VcadApp/Sim.swift:546-568 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:546-568 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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 lines × 2) apple/VcadApp/Sources/VcadApp/SimController.swift:229— apple/VcadApp/Sources/VcadApp/SimController.swift:229-251 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:229-251 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2518— apple/VcadApp/Sources/VcadApp/Editor.swift:2518-2540 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2518-2540 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2704— apple/VcadApp/Sources/VcadApp/Editor.swift:2704-2726 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2704-2726 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 lines × 2) apple/VcadApp/Sources/VcadApp/Sim.swift:571— apple/VcadApp/Sources/VcadApp/Sim.swift:571-593 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:571-593 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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.
Off the main sequence: @vcad/ir — @vcad/ir: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: VcadUpdate — VcadUpdate: 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: vcad-crdt — vcad-crdt: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: vcad-embroidery — vcad-embroidery: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: vcad-i18n — vcad-i18n: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: vcad-printcheck — vcad-printcheck: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: vcad-receipt — vcad-receipt: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 20 project(s), so it's rigid to change.
Off the main sequence: vcad-termview — vcad-termview: 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: vcad-ir — vcad-ir: abstractness 0.01, instability 0.05, distance 0.94 — zone of pain — concrete and depended on by 38 project(s), so it's rigid to change.
Off the main sequence: vcad-ecad-schematic — vcad-ecad-schematic: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: vcad-parts — vcad-parts: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: vcad-slicer-gcode — vcad-slicer-gcode: abstractness 0.00, instability 0.29, distance 0.71 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
vcad_kernel_sheet::flatten::detect_bend (cognitive 114) crates/vcad-kernel-sheet/src/flatten.rs:873— vcad_kernel_sheet::flatten::detect_bend has cognitive complexity 114 (threshold 15). Drivers by points: if/else 27 (83 pts), loops 8 (20 pts), boolean chains 11 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_sheet::poly2d::boolean (cognitive 111) crates/vcad-kernel-sheet/src/poly2d.rs:431— vcad_kernel_sheet::poly2d::boolean has cognitive complexity 111 (threshold 15). Drivers by points: if/else 22 (55 pts), loops 24 (42 pts), boolean chains 8, match/switch 3 (6 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_sheet::flatten::flatten_solid (cognitive 45) crates/vcad-kernel-sheet/src/flatten.rs:496— vcad_kernel_sheet::flatten::flatten_solid has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 8 (10 pts), boolean chains 3, 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.
vcad_kernel_sheet::manufacturability::check_manufacturability (cognitive 37) crates/vcad-kernel-sheet/src/manufacturability.rs:333— vcad_kernel_sheet::manufacturability::check_manufacturability has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 5 (8 pts), boolean chains 2, match/switch 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.
vcad_kernel_sheet::flatten::assemble (cognitive 36) crates/vcad-kernel-sheet/src/flatten.rs:1099— vcad_kernel_sheet::flatten::assemble has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 7 (11 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_sheet::nesting::nest_rectangles (cognitive 33) crates/vcad-kernel-sheet/src/nesting.rs:112— vcad_kernel_sheet::nesting::nest_rectangles has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (9 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.
vcad_kernel_sheet::flatten::weld (cognitive 25) crates/vcad-kernel-sheet/src/flatten.rs:257— vcad_kernel_sheet::flatten::weld has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 5 (11 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.
vcad_kernel_sheet::flatten::cluster_planes (cognitive 24) crates/vcad-kernel-sheet/src/flatten.rs:360— vcad_kernel_sheet::flatten::cluster_planes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (10 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.
vcad_kernel_sheet::flatten::boundary_loops (cognitive 23) crates/vcad-kernel-sheet/src/flatten.rs:412— vcad_kernel_sheet::flatten::boundary_loops has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (7 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.
vcad_kernel_sheet::nesting::bottom_left (cognitive 20) crates/vcad-kernel-sheet/src/nesting.rs:242— vcad_kernel_sheet::nesting::bottom_left has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 3 (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.
vcad_kernel_sheet::poly2d::splits_from (cognitive 20) crates/vcad-kernel-sheet/src/poly2d.rs:268— vcad_kernel_sheet::poly2d::splits_from has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (10 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
mecheval_grader::suite_c::solve_ik (cognitive 58) mecheval/graders/src/suite_c.rs:478— mecheval_grader::suite_c::solve_ik has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 9 (17 pts), match/switch 2 (3 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.
mecheval_grader::anti_cheese::enforce (cognitive 53) mecheval/graders/src/anti_cheese.rs:42— mecheval_grader::anti_cheese::enforce has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (49 pts), boolean chains 2, match/switch 1 (2 pts) (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.
mecheval_grader::grader::check_step_roundtrip (cognitive 32) mecheval/graders/src/grader.rs:724— mecheval_grader::grader::check_step_roundtrip has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 4 (10 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mecheval_grader::pcb::check_decoupling_proximity (cognitive 32) mecheval/graders/src/pcb.rs:386— mecheval_grader::pcb::check_decoupling_proximity has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (6 pts), match/switch 2 (5 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.
mecheval_grader::holes::find_z_holes (cognitive 26) mecheval/graders/src/holes.rs:60— mecheval_grader::holes::find_z_holes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mecheval_grader::suite_c::check_task_success (cognitive 24) mecheval/graders/src/suite_c.rs:288— mecheval_grader::suite_c::check_task_success has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 5, 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.
mecheval_grader::fillets::find_non_z_cylinders (cognitive 23) mecheval/graders/src/fillets.rs:42— mecheval_grader::fillets::find_non_z_cylinders has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mecheval_grader::fit_physics::find_contacts_with_epa_depth (cognitive 22) mecheval/graders/src/fit_physics.rs:444— mecheval_grader::fit_physics::find_contacts_with_epa_depth has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (4 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.
mecheval_grader::grader::grade (cognitive 20) mecheval/graders/src/grader.rs:49— mecheval_grader::grader::grade has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 8, boolean chains 1, loops 1 (nesting depth added 5). 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.
mecheval_grader::fit::check_contact_area (cognitive 17) mecheval/graders/src/fit.rs:317— mecheval_grader::fit::check_contact_area has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mecheval_grader::suite_c::gauss_solve (cognitive 16) mecheval/graders/src/suite_c.rs:640— mecheval_grader::suite_c::gauss_solve has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 2 (5 pts) (nesting depth added 8). 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.
vcad_kernel_drafting::features::detect_circles (cognitive 50) crates/vcad-kernel-drafting/src/features.rs:51— vcad_kernel_drafting::features::detect_circles has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 10 (13 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_drafting::section::weld_endpoints (cognitive 36) crates/vcad-kernel-drafting/src/section.rs:175— vcad_kernel_drafting::section::weld_endpoints has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (22 pts), if/else 2 (14 pts) (nesting depth added 28). 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.
vcad_kernel_drafting::section::offset_section_mesh (cognitive 32) crates/vcad-kernel-drafting/src/section.rs:863— vcad_kernel_drafting::section::offset_section_mesh has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (11 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.
vcad_kernel_drafting::dxf::sheet_to_dxf (cognitive 31) crates/vcad-kernel-drafting/src/dxf.rs:192— vcad_kernel_drafting::dxf::sheet_to_dxf has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 8 (10 pts), boolean chains 2, match/switch 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.
vcad_kernel_drafting::section::clip_polyline_to_strip (cognitive 27) crates/vcad-kernel-drafting/src/section.rs:805— vcad_kernel_drafting::section::clip_polyline_to_strip has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_drafting::section::chain_segments (cognitive 25) crates/vcad-kernel-drafting/src/section.rs:222— vcad_kernel_drafting::section::chain_segments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_drafting::section::intersect_triangle_with_plane (cognitive 23) crates/vcad-kernel-drafting/src/section.rs:32— vcad_kernel_drafting::section::intersect_triangle_with_plane has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 11 (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.
vcad_kernel_drafting::hidden_line::merge_collinear::subtract (cognitive 21) crates/vcad-kernel-drafting/src/hidden_line.rs:159— vcad_kernel_drafting::hidden_line::merge_collinear::subtract has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_drafting::pdf::emit_class (cognitive 19) crates/vcad-kernel-drafting/src/pdf.rs:62— vcad_kernel_drafting::pdf::emit_class has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_drafting::detail::clip_edge_to_rect (cognitive 16) crates/vcad-kernel-drafting/src/detail.rs:171— vcad_kernel_drafting::detail::clip_edge_to_rect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), 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.
vcad_kernel_drafting::section::clip_line_to_polygon (cognitive 16) crates/vcad-kernel-drafting/src/section.rs:432— vcad_kernel_drafting::section::clip_line_to_polygon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (19 lines × 2) crates/vcad-cli/src/ui/chat.rs:381— crates/vcad-cli/src/ui/chat.rs:381-399 | crates/vcad-cli/src/ui/command.rs:165-183 — before extracting anything, compare `crates/vcad-cli/src/ui/chat.rs` and `crates/vcad-cli/src/ui/command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 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 lines × 2) crates/vcad-ir/src/vcode.rs:361— crates/vcad-ir/src/vcode.rs:361-379 | crates/vcad-ir/src/vcode.rs:384-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:361` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crates/vcad-kernel-fillet/src/chamfer.rs:149— crates/vcad-kernel-fillet/src/chamfer.rs:149-167 | crates/vcad-kernel-fillet/src/fillet_planar.rs:232-250 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_planar.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/chamfer.rs:149` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:52— crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:52-70 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:128-146 — before extracting anything, compare `crates/vcad-kernel-raytrace/src/intersect/bilinear.rs` and `crates/vcad-kernel-raytrace/src/intersect/bspline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `surface` to `&BilinearSurface` in one and `&dyn Surface` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:750— crates/vcad-ecad-pcb/src/router/sco.rs:750-768 | crates/vcad-ecad-pcb/src/router/sco.rs:773-791 — both copies are in the same file, so extract the block into 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3581— apple/VcadApp/Sources/VcadApp/Editor.swift:3581-3599 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3581-3599 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/VisionShell.swift:134— apple/VcadApp/Sources/VcadApp/VisionShell.swift:134-152 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:134-152 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/VisionShell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 201 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) apple/VcadApp/Sources/VcadApp/SimPanel.swift:78— apple/VcadApp/Sources/VcadApp/SimPanel.swift:78-96 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:78-96 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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) apple/VcadApp/Sources/VcadApp/Kernel.swift:64— apple/VcadApp/Sources/VcadApp/Kernel.swift:64-82 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:64-82 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Kernel.swift:64` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) apple/VcadApp/Sources/VcadApp/Document.swift:784— apple/VcadApp/Sources/VcadApp/Document.swift:784-802 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:784-802 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3243— apple/VcadApp/Sources/VcadApp/Editor.swift:3243-3261 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3243-3261 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) crates/vcad-app/src/materializer.rs:1181— crates/vcad-app/src/materializer.rs:1181-1191 | crates/vcad-app/src/materializer.rs:1286-1296 | crates/vcad-app/src/materializer.rs:1410-1420 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/materializer.rs:1181` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) crates/vcad-cli/src/app.rs:443— crates/vcad-cli/src/app.rs:443-454 | crates/vcad-cli/src/app.rs:482-492 | crates/vcad-cli/src/app.rs:519-529 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/vcad-kernel-booleans/src/mesh/mod.rs:120— crates/vcad-kernel-booleans/src/mesh/mod.rs:120-130 | crates/vcad-kernel-drafting/src/section.rs:129-139 | crates/vcad-kernel-shell/src/lib.rs:1278-1288 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/mod.rs` and `crates/vcad-kernel-shell/src/lib.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/mod.rs:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/vcad-kernel-geom/src/lib.rs:408— crates/vcad-kernel-geom/src/lib.rs:408-418 | crates/vcad-kernel-geom/src/lib.rs:591-601 | crates/vcad-kernel-geom/src/lib.rs:950-960 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-geom/src/lib.rs:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-geom/src/lib.rs:962` calls `from_f64` and `crates/vcad-kernel-geom/src/lib.rs:420` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) crates/vcad-kernel-step/src/pmi.rs:127— crates/vcad-kernel-step/src/pmi.rs:127-140 | crates/vcad-kernel-step/src/pmi.rs:147-157 | crates/vcad-kernel-step/src/pmi.rs:165-175 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-step/src/pmi.rs:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:1994— crates/vcad-kernel-tessellate/src/lib.rs:1994-2004 | crates/vcad-kernel-tessellate/src/lib.rs:8811-8821 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:410-420 — before extracting anything, compare `crates/vcad-kernel-tessellate/src/lib.rs` and `crates/vcad-kernel-tessellate/src/mesh_ray.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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) crates/vcad-kernel-urdf/src/writer.rs:216— crates/vcad-kernel-urdf/src/writer.rs:216-226 | crates/vcad-kernel-urdf/src/writer.rs:239-254 | crates/vcad-kernel-urdf/src/writer.rs:294-304 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-urdf/src/writer.rs:239` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) crates/vcad-ir/src/vcode.rs:2536— crates/vcad-ir/src/vcode.rs:2536-2546 | crates/vcad-ir/src/vcode.rs:2553-2565 | crates/vcad-ir/src/vcode.rs:2713-2725 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:2536` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) mecheval/graders/src/suite_c.rs:123— mecheval/graders/src/suite_c.rs:123-134 | mecheval/graders/src/suite_c.rs:196-206 | mecheval/graders/src/suite_c.rs:327-339 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mecheval/graders/src/suite_c.rs:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/vcad-cli/src/app.rs:575— crates/vcad-cli/src/app.rs:575-585 | crates/vcad-cli/src/app.rs:613-623 | crates/vcad-cli/src/app.rs:652-662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:575` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2676— apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2676-2686 | apple/VcadApp/Sources/VcadApp/VisionShell.swift:101-111 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:101-111 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift` and `apple/VcadApp/Sources/VcadApp/VisionShell.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2676` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apple/VcadApp/Sources/VcadApp/VisionShell.swift:98` calls `Text`, `font`, `foregroundStyle` and `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2675` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) crates/vcad-ecad-pcb/src/router/pair.rs:92— crates/vcad-ecad-pcb/src/router/pair.rs:92-100 | crates/vcad-ecad-pcb/src/router/si_claims.rs:249-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/vcad-ecad-pcb/src/router/sco.rs:310— crates/vcad-ecad-pcb/src/router/sco.rs:310-317 | crates/vcad-ecad-pcb/src/router/sco.rs:547-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/sco.rs:310` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-pcb/src/router/sco.rs:320` calls `include` and `crates/vcad-ecad-pcb/src/router/sco.rs:558` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) crates/vcad-eval/src/sim_extract.rs:305— crates/vcad-eval/src/sim_extract.rs:305-313 | crates/vcad-eval/src/thermal_extract.rs:531-538 — before extracting anything, compare `crates/vcad-eval/src/sim_extract.rs` and `crates/vcad-eval/src/thermal_extract.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/sim_extract.rs:305` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) crates/vcad-ir/src/gear.rs:362— crates/vcad-ir/src/gear.rs:362-369 | crates/vcad-parts/src/builder.rs:164-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/gear.rs:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/vcad-kernel-cam/src/dropcutter/ball.rs:101— crates/vcad-kernel-cam/src/dropcutter/ball.rs:101-109 | crates/vcad-kernel-cam/src/dropcutter/bull.rs:212-219 — 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–9 lines × 2) crates/vcad-kernel-drafting/src/section.rs:477— crates/vcad-kernel-drafting/src/section.rs:477-485 | crates/vcad-kernel-drafting/src/section.rs:493-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/section.rs:477` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) crates/vcad-kernel-flow/src/adjoint.rs:146— crates/vcad-kernel-flow/src/adjoint.rs:146-153 | crates/vcad-kernel-flow/src/solve.rs:192-200 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/vcad-kernel-particle/src/wire3d.rs:594— crates/vcad-kernel-particle/src/wire3d.rs:594-601 | crates/vcad-kernel-tessellate/src/clearance.rs:451-459 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-particle/src/wire3d.rs:594` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) crates/vcad-kernel-raytrace/src/cpu.rs:106— crates/vcad-kernel-raytrace/src/cpu.rs:106-114 | crates/vcad-kernel-raytrace/src/cpu.rs:541-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/cpu.rs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) crates/vcad-mcp/src/server.rs:1122— crates/vcad-mcp/src/server.rs:1122-1129 | crates/vcad-mcp/src/server.rs:1134-1142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-mcp/src/server.rs:1122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/vcad-kernel-acoustics/src/instrument.rs:271— crates/vcad-kernel-acoustics/src/instrument.rs:271-279 | crates/vcad-kernel-fea/src/mesh.rs:465-472 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/instrument.rs:271` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) crates/vcad-kernel-booleans/src/classify.rs:486— crates/vcad-kernel-booleans/src/classify.rs:486-490 | crates/vcad-kernel-booleans/src/split.rs:2773-2777 | crates/vcad-kernel-booleans/src/split.rs:3776-3780 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:486` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 3) crates/vcad-kernel-booleans/src/split.rs:1876— crates/vcad-kernel-booleans/src/split.rs:1876-1881 | crates/vcad-kernel-booleans/src/split.rs:5104-5108 | crates/vcad-kernel-booleans/src/split.rs:6324-6329 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1876` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 3) crates/vcad-kernel-shell/src/lib.rs:910— crates/vcad-kernel-shell/src/lib.rs:910-914 | crates/vcad-kernel-step/src/reader.rs:129-133 | crates/vcad-kernel-tessellate/src/lib.rs:2907-2911 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-shell/src/lib.rs:910` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) crates/vcad-kernel-sketch/src/extrude.rs:262— crates/vcad-kernel-sketch/src/extrude.rs:262-279 | crates/vcad-kernel-sketch/src/extrude.rs:627-631 | crates/vcad-kernel-sketch/src/revolve.rs:183-187 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-sketch/src/revolve.rs:180` calls `clone` and `crates/vcad-kernel-sketch/src/extrude.rs:260` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) crates/vcad-ecad-pcb/src/router/complete.rs:1981— crates/vcad-ecad-pcb/src/router/complete.rs:1981-1985 | crates/vcad-ecad-pcb/src/router/maze.rs:1454-1458 | crates/vcad-ecad-pcb/src/spatial.rs:215-219 — before extracting anything, compare `crates/vcad-ecad-pcb/src/router/complete.rs` and `crates/vcad-ecad-pcb/src/router/maze.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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) crates/vcad-app/src/feature.rs:572— crates/vcad-app/src/feature.rs:572-576 | crates/vcad-app/src/feature.rs:591-595 | crates/vcad-app/src/feature.rs:602-606 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/feature.rs:572` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-app/src/feature.rs:589` calls `insert`, `into`, `F64` and `crates/vcad-app/src/feature.rs:570` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) crates/vcad-kernel-booleans/src/mesh/csg.rs:101— crates/vcad-kernel-booleans/src/mesh/csg.rs:101-105 | crates/vcad-kernel-booleans/src/split.rs:1036-1040 | crates/vcad-kernel-fillet/src/topology.rs:106-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/csg.rs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) crates/vcad-kernel-stocksim/src/subtract.rs:259— crates/vcad-kernel-stocksim/src/subtract.rs:259-263 | crates/vcad-kernel/src/turning_profile.rs:466-470 | mecheval/graders/src/fit.rs:280-284 — 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 (5 lines × 3) crates/vcad-kernel-stocksim/src/verify.rs:263— crates/vcad-kernel-stocksim/src/verify.rs:263-267 | crates/vcad-kernel-tessellate/src/clearance.rs:416-420 | crates/vcad-kernel-tessellate/src/clearance.rs:758-762 — before extracting anything, compare `crates/vcad-kernel-stocksim/src/verify.rs` and `crates/vcad-kernel-tessellate/src/clearance.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-stocksim/src/verify.rs:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:5223— crates/vcad-kernel-tessellate/src/lib.rs:5223-5227 | crates/vcad-kernel-tessellate/src/lib.rs:5235-5239 | crates/vcad-kernel-tessellate/src/lib.rs:5245-5249 — 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) apple/VcadApp/Sources/VcadApp/GizmoView.swift:51— apple/VcadApp/Sources/VcadApp/GizmoView.swift:51-55 | apple/VcadApp/Sources/VcadApp/SceneAssets.swift:51-55 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:51-55 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/GizmoView.swift:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `widthPx` to `Float` in one and `Float = 1.5` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
vcad_ffi::drafting::compose (cyclomatic 93) crates/vcad-ffi/src/drafting.rs:464— vcad_ffi::drafting::compose has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_ffi::cam_job::job (cyclomatic 41) crates/vcad-ffi/src/cam_job.rs:361— vcad_ffi::cam_job::job 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.
vcad_ffi::topology::analyze (cyclomatic 28) crates/vcad-ffi/src/topology.rs:109— vcad_ffi::topology::analyze 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.
vcad_ffi::cam::generate (cyclomatic 26) crates/vcad-ffi/src/cam.rs:69— vcad_ffi::cam::generate 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.
vcad_ffi::recon::program_document (cyclomatic 24) crates/vcad-ffi/src/recon.rs:390— vcad_ffi::recon::program_document 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.
vcad_ffi::train::vcad_train_start (cyclomatic 19) crates/vcad-ffi/src/train.rs:672— vcad_ffi::train::vcad_train_start 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.
vcad_ffi::fea::cell_field (cyclomatic 17) crates/vcad-ffi/src/fea.rs:312— vcad_ffi::fea::cell_field has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_ffi::clearance::check (cyclomatic 16) crates/vcad-ffi/src/clearance.rs:126— vcad_ffi::clearance::check 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.
vcad_ffi::sound::call_with_scene (cyclomatic 16) crates/vcad-ffi/src/sound.rs:59— vcad_ffi::sound::call_with_scene 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.
vcad_ffi::train::run_training (cyclomatic 16) crates/vcad-ffi/src/train.rs:502— vcad_ffi::train::run_training 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.
vcad_app::migrate::migrate_node (cyclomatic 67) crates/vcad-app/src/migrate.rs:336— vcad_app::migrate::migrate_node has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_app::materializer::materialize_doc_extras (cyclomatic 54) crates/vcad-app/src/materializer.rs:556— vcad_app::materializer::materialize_doc_extras 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.
vcad_app::materializer::materialize_feature (cyclomatic 49) crates/vcad-app/src/materializer.rs:606— vcad_app::materializer::materialize_feature has cyclomatic complexity 49 (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.
vcad_app::doc_edits::lower (cyclomatic 42) crates/vcad-app/src/doc_edits.rs:28— vcad_app::doc_edits::lower has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
vcad_app::evaluate::evaluate_node (cyclomatic 35) crates/vcad-app/src/evaluate.rs:61— vcad_app::evaluate::evaluate_node 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.
vcad_app::migrate::migrate_assembly (cyclomatic 33) crates/vcad-app/src/migrate.rs:1062— vcad_app::migrate::migrate_assembly 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.
vcad_app::materializer::materialize (cyclomatic 24) crates/vcad-app/src/materializer.rs:294— vcad_app::materializer::materialize 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.
vcad_app::tools::lower_update (cyclomatic 24) crates/vcad-app/src/tools.rs:333— vcad_app::tools::lower_update has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
vcad_app::migrate::migrate_v1_mapped (cyclomatic 23) crates/vcad-app/src/migrate.rs:83— vcad_app::migrate::migrate_v1_mapped 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.
vcad_app::ecad_tools::sync_schematic_data (cyclomatic 21) crates/vcad-app/src/ecad_tools.rs:184— vcad_app::ecad_tools::sync_schematic_data 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.
vcad_kernel_thermal::solve::build (cognitive 195) crates/vcad-kernel-thermal/src/solve.rs:551— vcad_kernel_thermal::solve::build has cognitive complexity 195 (threshold 15). Drivers by points: if/else 29 (87 pts), loops 30 (78 pts), match/switch 5 (25 pts), boolean chains 5 (nesting depth added 126). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_thermal::adjoint::smooth_max_gradient (cognitive 66) crates/vcad-kernel-thermal/src/adjoint.rs:145— vcad_kernel_thermal::adjoint::smooth_max_gradient has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 9 (16 pts), match/switch 3 (8 pts), boolean chains 5 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_thermal::transient::solve_transient_schedule (cognitive 57) crates/vcad-kernel-thermal/src/transient.rs:226— vcad_kernel_thermal::transient::solve_transient_schedule has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 8 (20 pts), boolean chains 6 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_thermal::graph::assemble (cognitive 56) crates/vcad-kernel-thermal/src/graph.rs:216— vcad_kernel_thermal::graph::assemble has cognitive complexity 56 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 9 (15 pts), match/switch 4 (10 pts), boolean chains 5 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_thermal::solve::check_grounding (cognitive 35) crates/vcad-kernel-thermal/src/solve.rs:991— vcad_kernel_thermal::solve::check_grounding has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_thermal::solve::solve_field (cognitive 30) crates/vcad-kernel-thermal/src/solve.rs:1110— vcad_kernel_thermal::solve::solve_field has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (8 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.
vcad_kernel_thermal::receipt::predicted_claims (cognitive 25) crates/vcad-kernel-thermal/src/receipt.rs:195— vcad_kernel_thermal::receipt::predicted_claims has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3, boolean chains 2, 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.
vcad_kernel_thermal::thermocouple::reduce_log (cognitive 23) crates/vcad-kernel-thermal/src/thermocouple.rs:81— vcad_kernel_thermal::thermocouple::reduce_log has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, match/switch 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
vcad_kernel_thermal::solve::assemble_solution (cognitive 21) crates/vcad-kernel-thermal/src/solve.rs:1385— vcad_kernel_thermal::solve::assemble_solution has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 6 (7 pts), match/switch 1 (2 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.
vcad_kernel_thermal::receipt::compare (cognitive 18) crates/vcad-kernel-thermal/src/receipt.rs:420— vcad_kernel_thermal::receipt::compare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
vcad_ir::resolve::apply_to_op (cognitive 95) crates/vcad-ir/src/resolve.rs:201— vcad_ir::resolve::apply_to_op has cognitive complexity 95 (threshold 15). Drivers by points: if/else 47 (76 pts), match/switch 10 (19 pts) (nesting depth added 38). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_ir::vcode::parse_geometry_opcode (cognitive 79) crates/vcad-ir/src/vcode.rs:1786— vcad_ir::vcode::parse_geometry_opcode has cognitive complexity 79 (threshold 15). Drivers by points: if/else 31 (69 pts), match/switch 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 43). 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.
vcad_ir::vcode::format_scene_settings (cognitive 53) crates/vcad-ir/src/vcode.rs:458— vcad_ir::vcode::format_scene_settings has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 5 (13 pts), loops 2 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ir::vcode::to_vcode (cognitive 51) crates/vcad-ir/src/vcode.rs:135— vcad_ir::vcode::to_vcode has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 7 (17 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ir::to_loon::op_to_loon (cognitive 46) crates/vcad-ir/src/to_loon.rs:193— vcad_ir::to_loon::op_to_loon has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 8 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 20). 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.
vcad_ir::to_loon::document_to_loon_checked (cognitive 30) crates/vcad-ir/src/to_loon.rs:17— vcad_ir::to_loon::document_to_loon_checked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (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.
vcad_ir::vcode::split_line_respecting_quotes (cognitive 25) crates/vcad-ir/src/vcode.rs:892— vcad_ir::vcode::split_line_respecting_quotes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (9 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.
vcad_ir::parameters::resolve_parameters (cognitive 21) crates/vcad-ir/src/parameters.rs:371— vcad_ir::parameters::resolve_parameters has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (7 pts), match/switch 3 (5 pts) (nesting depth added 9). Of this number, 17 points are the body's own statements and 4 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.
vcad_ir::vcode::parse_joint (cognitive 19) crates/vcad-ir/src/vcode.rs:1082— vcad_ir::vcode::parse_joint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), 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.
vcad_ir::vcode::from_vcode (cognitive 18) crates/vcad-ir/src/vcode.rs:716— vcad_ir::vcode::from_vcode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, 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.
vcad_loon::split_top_level (cognitive 67) crates/vcad-loon/src/lib.rs:251— vcad_loon::split_top_level has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 6 (16 pts), boolean chains 8, match/switch 1 (4 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_loon::recover::recover (cognitive 34) crates/vcad-loon/src/recover.rs:69— vcad_loon::recover::recover has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (10 pts), match/switch 2 (3 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.
vcad_loon::variants::parse_variant (cognitive 33) crates/vcad-loon/src/variants.rs:498— vcad_loon::variants::parse_variant has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (8 pts), match/switch 2 (4 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.
vcad_loon::convert::convert_assembly (cognitive 31) crates/vcad-loon/src/convert.rs:367— vcad_loon::convert::convert_assembly has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 8 (13 pts), if/else 8 (12 pts), boolean chains 3, 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.
vcad_loon::convert::value_to_document_in (cognitive 28) crates/vcad-loon/src/convert.rs:17— vcad_loon::convert::value_to_document_in has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, loops 3 (6 pts), match/switch 2 (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.
vcad_loon::fastener::plan (cognitive 26) crates/vcad-loon/src/fastener.rs:306— vcad_loon::fastener::plan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 3 (4 pts), boolean chains 3, loops 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
vcad_loon::rootnames::capture_expr (cognitive 19) crates/vcad-loon/src/rootnames.rs:26— vcad_loon::rootnames::capture_expr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (3 pts), loops 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.
vcad_loon::recover::extract (cognitive 17) crates/vcad-loon/src/recover.rs:331— vcad_loon::recover::extract has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (5 pts) (nesting depth added 8). 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.
vcad_loon::variants::parse_table (cognitive 17) crates/vcad-loon/src/variants.rs:433— vcad_loon::variants::parse_table has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), match/switch 1 (3 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.
vcad_loon::variants::parse (cognitive 16) crates/vcad-loon/src/variants.rs:390— vcad_loon::variants::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2, 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.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×10
Edited copy of a member (17 corresponding lines) crates/vcad-kernel-raytrace/src/gpu/buffers.rs:580— crates/vcad-kernel-raytrace/src/gpu/buffers.rs:580-603 | crates/vcad-kernel-raytrace/src/gpu/buffers.rs:1340-1356 — 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) crates/vcad-ecad-pcb/src/session.rs:262— crates/vcad-ecad-pcb/src/session.rs:262-278 | crates/vcad-kernel-booleans/src/trim.rs:690-708 — 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) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:904— apple/VcadApp/Sources/VcadApp/GlassChrome.swift:904-923 | apple/VcadApp/Sources/VcadApp/SketchViews.swift:128-144 — 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) crates/vcad-ecad-symbols/src/footprint.rs:1506— crates/vcad-ecad-symbols/src/footprint.rs:1506-1522 | crates/vcad-ecad-symbols/src/footprint.rs:1527-1549 — 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) crates/vcad-ffi/src/drafting.rs:260— crates/vcad-ffi/src/drafting.rs:260-277 | crates/vcad-kernel-drafting/src/dimension/placement.rs:88-104 — 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) crates/vcad-ecad-sim/src/impedance.rs:88— crates/vcad-ecad-sim/src/impedance.rs:88-104 | crates/vcad-ecad-sim/src/impedance.rs:123-139 — 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) crates/vcad-ffi/src/gym.rs:578— crates/vcad-ffi/src/gym.rs:578-596 | crates/vcad-ffi/src/gym.rs:676-692 — 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) crates/vcad-kernel-wasm/src/lib.rs:181— crates/vcad-kernel-wasm/src/lib.rs:181-197 | crates/vcad-kernel-wasm/src/lib.rs:213-229 — 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) mecheval/graders/src/eval.rs:75— mecheval/graders/src/eval.rs:75-91 | mecheval/graders/src/eval.rs:94-110 — 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) crates/vcad-slicer-gcode/src/gcode.rs:343— crates/vcad-slicer-gcode/src/gcode.rs:343-359 | crates/vcad-slicer-gcode/src/gcode.rs:361-377 — 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 (21 corresponding lines) · ×10
Edited copy of a member (21 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:3425— apple/VcadApp/Sources/VcadApp/Editor.swift:3425-3445 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3425-3445 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-app/src/keybinding.rs:82— crates/vcad-app/src/keybinding.rs:82-102 | crates/vcad-app/src/keybinding.rs:105-125 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-kernel-booleans/src/no_crossing.rs:232— crates/vcad-kernel-booleans/src/no_crossing.rs:232-252 | crates/vcad-kernel-booleans/src/no_crossing.rs:449-474 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) mecheval/graders/src/pcb.rs:76— mecheval/graders/src/pcb.rs:76-96 | mecheval/graders/src/pcb.rs:101-127 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-kernel-sheet/src/unfold.rs:128— crates/vcad-kernel-sheet/src/unfold.rs:128-148 | crates/vcad-kernel-sheet/src/unfold.rs:156-178 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-kernel-fea/src/buckling.rs:224— crates/vcad-kernel-fea/src/buckling.rs:224-244 | crates/vcad-kernel-tessellate/src/clearance.rs:788-808 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-ffi/src/import.rs:213— crates/vcad-ffi/src/import.rs:213-233 | crates/vcad-ffi/src/lib.rs:3614-3634 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-ecad-pcb/src/component_mesh.rs:489— crates/vcad-ecad-pcb/src/component_mesh.rs:489-509 | crates/vcad-ecad-pcb/src/component_mesh.rs:512-534 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-slicer-gcode/src/gcode.rs:222— crates/vcad-slicer-gcode/src/gcode.rs:222-245 | crates/vcad-slicer-gcode/src/gcode.rs:247-267 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/vcad-eval/src/evaluate.rs:4081— crates/vcad-eval/src/evaluate.rs:4081-4101 | crates/vcad-eval/src/evaluate.rs:4111-4135 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 3) crates/vcad-app/src/migrate.rs:511— crates/vcad-app/src/migrate.rs:511-518 | crates/vcad-app/src/migrate.rs:594-601 | crates/vcad-app/src/migrate.rs:650-657 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-app/src/migrate.rs:602` calls `insert`, `to_string`, `F64` and `crates/vcad-app/src/migrate.rs:658` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) crates/vcad-ir/src/vcode.rs:2445— crates/vcad-ir/src/vcode.rs:2445-2452 | crates/vcad-ir/src/vcode.rs:2457-2464 | crates/vcad-ir/src/vcode.rs:2469-2476 — 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) crates/vcad-kernel-acoustics/src/optimize.rs:108— crates/vcad-kernel-acoustics/src/optimize.rs:108-115 | crates/vcad-kernel-particle/src/optimize.rs:115-122 | crates/vcad-kernel-particle/src/optimize.rs:386-393 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-particle/src/optimize.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/vcad-kernel-booleans/src/classify.rs:593— crates/vcad-kernel-booleans/src/classify.rs:593-600 | crates/vcad-kernel-booleans/src/classify.rs:819-826 | crates/vcad-kernel-booleans/src/classify.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:593` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 3) crates/vcad-kernel-booleans/src/cyl_band.rs:1313— crates/vcad-kernel-booleans/src/cyl_band.rs:1313-1320 | crates/vcad-kernel-booleans/src/cyl_band.rs:2545-2552 | crates/vcad-kernel-booleans/src/split.rs:3477-3484 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/cyl_band.rs:1313` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/vcad-kernel-dfm/src/rules/casting.rs:64— crates/vcad-kernel-dfm/src/rules/casting.rs:64-73 | crates/vcad-kernel-dfm/src/rules/mold.rs:55-62 | crates/vcad-kernel-dfm/src/rules/sheet.rs:54-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/rules/casting.rs:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:1021— crates/vcad-kernel-tessellate/src/lib.rs:1021-1028 | crates/vcad-kernel-tessellate/src/lib.rs:1257-1264 | crates/vcad-kernel-tessellate/src/lib.rs:1488-1495 — 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) crates/vcad-kernel-tessellate/src/lib.rs:2644— crates/vcad-kernel-tessellate/src/lib.rs:2644-2651 | crates/vcad-kernel-tessellate/src/lib.rs:4709-4716 | crates/vcad-kernel-tessellate/src/lib.rs:5022-5029 — 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) crates/vcad-kernel-assembly/src/mate_check.rs:161— crates/vcad-kernel-assembly/src/mate_check.rs:161-168 | crates/vcad-kernel-assembly/src/mate_check.rs:249-256 | crates/vcad-kernel-assembly/src/mate_check.rs:349-356 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-assembly/src/mate_check.rs:161` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:320— apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:320-327 | apple/VcadApp/Sources/VcadApp/Document.swift:842-849 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:842-849 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
vcad_ir::resolve::apply_to_op (cyclomatic 89) crates/vcad-ir/src/resolve.rs:201— vcad_ir::resolve::apply_to_op 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.
vcad_ir::to_loon::op_to_loon (cyclomatic 69) crates/vcad-ir/src/to_loon.rs:193— vcad_ir::to_loon::op_to_loon has cyclomatic complexity 69 (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.
vcad_ir::vcode::parse_geometry_opcode (cyclomatic 61) crates/vcad-ir/src/vcode.rs:1786— vcad_ir::vcode::parse_geometry_opcode 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.
vcad_ir::vcode::format_op (cyclomatic 43) crates/vcad-ir/src/vcode.rs:2385— vcad_ir::vcode::format_op has cyclomatic complexity 43 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
vcad_ir::vcode::format_scene_settings (cyclomatic 41) crates/vcad-ir/src/vcode.rs:458— vcad_ir::vcode::format_scene_settings 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.
vcad_ir::expr_parser::call_builtin (cyclomatic 26) crates/vcad-ir/src/expr_parser.rs:553— vcad_ir::expr_parser::call_builtin 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.
vcad_ir::vcode::from_vcode (cyclomatic 25) crates/vcad-ir/src/vcode.rs:716— vcad_ir::vcode::from_vcode 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.
vcad_ir::vcode::to_vcode (cyclomatic 24) crates/vcad-ir/src/vcode.rs:135— vcad_ir::vcode::to_vcode 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.
vcad_ir::expr_parser::eval (cyclomatic 16) crates/vcad-ir/src/expr_parser.rs:496— vcad_ir::expr_parser::eval 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.
vcad_render::pcb::render_pcb_svg_opts (cyclomatic 82) crates/vcad-render/src/pcb.rs:1097— vcad_render::pcb::render_pcb_svg_opts 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.
vcad_render::render_svg_impl (cyclomatic 70) crates/vcad-render/src/lib.rs:3009— vcad_render::render_svg_impl 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.
vcad_render::raster::rasterize (cyclomatic 36) crates/vcad-render/src/lib.rs:4318— vcad_render::raster::rasterize has cyclomatic complexity 36 (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: vcad_render::raster::glyph5x7 (cyclomatic 47) 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.
vcad_render::raytrace::rasterize_rt_scene (cyclomatic 28) crates/vcad-render/src/lib.rs:5444— vcad_render::raytrace::rasterize_rt_scene 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. This is NOT this file's highest cyclomatic complexity: vcad_render::raster::glyph5x7 (cyclomatic 47) 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.
vcad_render::build_artifacts (cyclomatic 26) crates/vcad-render/src/lib.rs:1831— vcad_render::build_artifacts 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: vcad_render::raster::glyph5x7 (cyclomatic 47) 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.
vcad_render::callouts::detect (cyclomatic 26) crates/vcad-render/src/callouts.rs:82— vcad_render::callouts::detect 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.
vcad_render::raster::draw_annotations (cyclomatic 26) crates/vcad-render/src/lib.rs:4809— vcad_render::raster::draw_annotations has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: vcad_render::raster::glyph5x7 (cyclomatic 47) 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.
vcad_render::exact::candidate_circles (cyclomatic 22) crates/vcad-render/src/exact.rs:124— vcad_render::exact::candidate_circles 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.
vcad_render::run (cyclomatic 21) crates/vcad-render/src/main.rs:1371— vcad_render::run 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.
vcad_kernel_fillet::revolved::extract_profile (cyclomatic 46) crates/vcad-kernel-fillet/src/revolved.rs:174— vcad_kernel_fillet::revolved::extract_profile 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.
vcad_kernel_fillet::blend_loft::loft_blend_edge_keyed (cyclomatic 40) crates/vcad-kernel-fillet/src/blend_loft.rs:113— vcad_kernel_fillet::blend_loft::loft_blend_edge_keyed 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.
vcad_kernel_fillet::fillet_curved::plan_convex_junction_blends (cyclomatic 28) crates/vcad-kernel-fillet/src/fillet_curved.rs:483— vcad_kernel_fillet::fillet_curved::plan_convex_junction_blends 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.
vcad_kernel_fillet::fillet_subset::is_plane_plane_chain_set (cyclomatic 23) crates/vcad-kernel-fillet/src/fillet_subset.rs:110— vcad_kernel_fillet::fillet_subset::is_plane_plane_chain_set 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.
vcad_kernel_fillet::fillet_curved::fillet_edges_detailed_inner (cyclomatic 22) crates/vcad-kernel-fillet/src/fillet_curved.rs:139— vcad_kernel_fillet::fillet_curved::fillet_edges_detailed_inner 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.
vcad_kernel_fillet::revolved::build_revolved (cyclomatic 22) crates/vcad-kernel-fillet/src/revolved.rs:623— vcad_kernel_fillet::revolved::build_revolved has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_fillet::fillet_subset::fillet_plane_chain_edges (cyclomatic 21) crates/vcad-kernel-fillet/src/fillet_subset.rs:268— vcad_kernel_fillet::fillet_subset::fillet_plane_chain_edges 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.
vcad_kernel_fillet::blend_loft::resolve_edge_query (cyclomatic 19) crates/vcad-kernel-fillet/src/blend_loft.rs:450— vcad_kernel_fillet::blend_loft::resolve_edge_query 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.
vcad_kernel_fillet::revolved::blend_corners (cyclomatic 16) crates/vcad-kernel-fillet/src/revolved.rs:505— vcad_kernel_fillet::revolved::blend_corners 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.
vcad_kernel_acoustics::helmholtz::solve_driven (cognitive 93) crates/vcad-kernel-acoustics/src/helmholtz.rs:189— vcad_kernel_acoustics::helmholtz::solve_driven has cognitive complexity 93 (threshold 15). Drivers by points: if/else 20 (50 pts), match/switch 7 (25 pts), loops 7 (10 pts), boolean chains 8 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_acoustics::instrument::modal (cognitive 44) crates/vcad-kernel-acoustics/src/instrument.rs:325— vcad_kernel_acoustics::instrument::modal has cognitive complexity 44 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 8 (17 pts), match/switch 1 (nesting depth added 24). 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.
vcad_kernel_acoustics::instrument::tune_bar (cognitive 44) crates/vcad-kernel-acoustics/src/instrument.rs:775— vcad_kernel_acoustics::instrument::tune_bar has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 6, loops 3 (6 pts), match/switch 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_acoustics::instrument::jacobi_vectors (cognitive 35) crates/vcad-kernel-acoustics/src/instrument.rs:491— vcad_kernel_acoustics::instrument::jacobi_vectors has cognitive complexity 35 (threshold 15). Drivers by points: loops 9 (24 pts), if/else 4 (11 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_acoustics::instrument::lowest_modes (cognitive 34) crates/vcad-kernel-acoustics/src/instrument.rs:545— vcad_kernel_acoustics::instrument::lowest_modes has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (30 pts), if/else 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 20). 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.
vcad_kernel_acoustics::strike::jacobi_eigenvalues (cognitive 25) crates/vcad-kernel-acoustics/src/strike.rs:260— vcad_kernel_acoustics::strike::jacobi_eigenvalues has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (19 pts), if/else 2 (6 pts) (nesting depth added 16). 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.
vcad_kernel_acoustics::optimize::maximize (cognitive 24) crates/vcad-kernel-acoustics/src/optimize.rs:51— vcad_kernel_acoustics::optimize::maximize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (9 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.
vcad_kernel_acoustics::receipt::compare (cognitive 18) crates/vcad-kernel-acoustics/src/receipt.rs:257— vcad_kernel_acoustics::receipt::compare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
vcad_kernel_acoustics::linalg::solve_block_tridiag (cognitive 17) crates/vcad-kernel-acoustics/src/linalg.rs:123— vcad_kernel_acoustics::linalg::solve_block_tridiag has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 1 (3 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.
vcad_kernel_step::reconstruct::plan_edge_merges (cognitive 88) crates/vcad-kernel-step/src/reconstruct.rs:102— vcad_kernel_step::reconstruct::plan_edge_merges has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (66 pts), loops 9 (13 pts), boolean chains 5, match/switch 2 (4 pts) (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.
vcad_kernel_step::pmi::extract_pmi (cognitive 68) crates/vcad-kernel-step/src/pmi.rs:92— vcad_kernel_step::pmi::extract_pmi has cognitive complexity 68 (threshold 15). Drivers by points: if/else 12 (42 pts), loops 12 (25 pts), boolean chains 1 (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.
vcad_kernel_step::entities::surfaces::parse_bspline_surface (cognitive 47) crates/vcad-kernel-step/src/entities/surfaces.rs:286— vcad_kernel_step::entities::surfaces::parse_bspline_surface has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 8 (16 pts), boolean chains 4, match/switch 3 (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.
vcad_kernel_step::assembly::solid_occurrences (cognitive 31) crates/vcad-kernel-step/src/assembly.rs:198— vcad_kernel_step::assembly::solid_occurrences has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 7 (11 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_step::reconstruct::validate_loop_consecutiveness (cognitive 24) crates/vcad-kernel-step/src/reconstruct.rs:554— vcad_kernel_step::reconstruct::validate_loop_consecutiveness has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 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.
vcad_kernel_step::reconstruct::circle_fit (cognitive 21) crates/vcad-kernel-step/src/reconstruct.rs:365— vcad_kernel_step::reconstruct::circle_fit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, loops 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.
vcad_kernel_step::reader::length_unit_mm (cognitive 19) crates/vcad-kernel-step/src/reader.rs:436— vcad_kernel_step::reader::length_unit_mm has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (13 pts), loops 2 (3 pts), if/else 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_step::entities::surfaces::revolve_line (cognitive 18) crates/vcad-kernel-step/src/entities/surfaces.rs:722— vcad_kernel_step::entities::surfaces::revolve_line has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
vcad_kernel_step::entities::curves::parse_bspline_curve_any (cognitive 16) crates/vcad-kernel-step/src/entities/curves.rs:149— vcad_kernel_step::entities::curves::parse_bspline_curve_any has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
vcad_ecad_sim::circuit::transient_adjoint::transient_sensitivities (cognitive 48) crates/vcad-ecad-sim/src/circuit/transient_adjoint.rs:145— vcad_ecad_sim::circuit::transient_adjoint::transient_sensitivities has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 8 (13 pts), match/switch 5 (13 pts), boolean chains 1 (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.
vcad_ecad_sim::circuit::adjoint::ac_sensitivities (cognitive 46) crates/vcad-ecad-sim/src/circuit/adjoint.rs:255— vcad_ecad_sim::circuit::adjoint::ac_sensitivities has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 7 (14 pts), match/switch 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_sim::circuit::netlist::circuit_from_netlist (cognitive 41) crates/vcad-ecad-sim/src/circuit/netlist.rs:377— vcad_ecad_sim::circuit::netlist::circuit_from_netlist has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 5 (11 pts), loops 6 (7 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.
vcad_ecad_sim::circuit::ac::build_and_solve (cognitive 35) crates/vcad-ecad-sim/src/circuit/ac.rs:271— vcad_ecad_sim::circuit::ac::build_and_solve has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 2 (3 pts), boolean chains 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.
vcad_ecad_sim::circuit::netlist::parse_si_value (cognitive 29) crates/vcad-ecad-sim/src/circuit/netlist.rs:122— vcad_ecad_sim::circuit::netlist::parse_si_value has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, loops 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.
vcad_ecad_sim::circuit::ac::solve_dense_c (cognitive 26) crates/vcad-ecad-sim/src/circuit/ac.rs:134— vcad_ecad_sim::circuit::ac::solve_dense_c has cognitive complexity 26 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 5 (11 pts) (nesting depth added 14). 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.
vcad_ecad_sim::circuit::dc::operating_point (cognitive 26) crates/vcad-ecad-sim/src/circuit/dc.rs:75— vcad_ecad_sim::circuit::dc::operating_point has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 5 (10 pts), match/switch 1 (2 pts) (nesting depth added 14). 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.
vcad_ecad_sim::circuit::linalg::solve_dense (cognitive 26) crates/vcad-ecad-sim/src/circuit/linalg.rs:13— vcad_ecad_sim::circuit::linalg::solve_dense has cognitive complexity 26 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 5 (11 pts) (nesting depth added 14). 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.
vcad_ecad_sim::airgap::airgap_solve (cognitive 21) crates/vcad-ecad-sim/src/airgap.rs:238— vcad_ecad_sim::airgap::airgap_solve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, match/switch 5, 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.
vcad_kernel_wasm::sample_fields_to_vertices (cognitive 48) crates/vcad-kernel-wasm/src/lib.rs:9786— vcad_kernel_wasm::sample_fields_to_vertices has cognitive complexity 48 (threshold 15). Drivers by points: if/else 4 (23 pts), loops 7 (23 pts), boolean chains 2 (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.
vcad_kernel_wasm::em_simulate (cognitive 39) crates/vcad-kernel-wasm/src/lib.rs:10289— vcad_kernel_wasm::em_simulate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (30 pts), loops 2 (4 pts), match/switch 2 (3 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.
vcad_kernel_wasm::photonics_simulate (cognitive 33) crates/vcad-kernel-wasm/src/lib.rs:10925— vcad_kernel_wasm::photonics_simulate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 8, loops 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
vcad_kernel_wasm::evaluate_node (cognitive 29) crates/vcad-kernel-wasm/src/lib.rs:4823— vcad_kernel_wasm::evaluate_node has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_wasm::scene_to_js (cognitive 24) crates/vcad-kernel-wasm/src/lib.rs:7617— vcad_kernel_wasm::scene_to_js has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (6 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.
vcad_kernel_wasm::embroidery_wasm::sketch_profile_to_path2d (cognitive 20) crates/vcad-kernel-wasm/src/lib.rs:8257— vcad_kernel_wasm::embroidery_wasm::sketch_profile_to_path2d has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (vcad_kernel_wasm::embroidery_wasm::sketch_segments_to_path2d) 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.
vcad_kernel_wasm::embroidery_wasm::digitize_text (cognitive 20) crates/vcad-kernel-wasm/src/lib.rs:8320— vcad_kernel_wasm::embroidery_wasm::digitize_text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (6 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.
vcad_kernel_wasm::embroidery_wasm::sketch_segments_to_path2d (cognitive 20) crates/vcad-kernel-wasm/src/lib.rs:8451— vcad_kernel_wasm::embroidery_wasm::sketch_segments_to_path2d has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (vcad_kernel_wasm::embroidery_wasm::sketch_profile_to_path2d) 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.
vcad_kernel_wasm::circuit_sim::circuit_from_schematic_wasm (cognitive 17) crates/vcad-kernel-wasm/src/circuit_sim.rs:1012— vcad_kernel_wasm::circuit_sim::circuit_from_schematic_wasm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4, match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×9
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×9
Edited copy of a member (24 corresponding lines) crates/vcad-ecad-symbols/src/kicad_board.rs:40— crates/vcad-ecad-symbols/src/kicad_board.rs:40-72 | crates/vcad-ecad-symbols/src/kicad_board.rs:76-99 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:9955— crates/vcad-kernel-wasm/src/lib.rs:9955-9978 | crates/vcad-kernel-wasm/src/lib.rs:9996-10019 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-kernel-em/src/planar.rs:253— crates/vcad-kernel-em/src/planar.rs:253-276 | crates/vcad-kernel-em/src/planar.rs:280-303 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-kernel-raytrace/src/bvh.rs:157— crates/vcad-kernel-raytrace/src/bvh.rs:157-186 | crates/vcad-kernel-raytrace/src/bvh.rs:188-211 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-ffi/src/lib.rs:347— crates/vcad-ffi/src/lib.rs:347-384 | crates/vcad-ffi/src/lib.rs:445-468 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:4030— crates/vcad-kernel-wasm/src/lib.rs:4030-4073 | crates/vcad-kernel-wasm/src/lib.rs:4087-4110 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-ffi/src/lib.rs:1427— crates/vcad-ffi/src/lib.rs:1427-1450 | crates/vcad-ffi/src/lib.rs:1463-1489 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-kernel-step/src/entities/geometry.rs:118— crates/vcad-kernel-step/src/entities/geometry.rs:118-141 | crates/vcad-kernel-step/src/entities/geometry.rs:146-176 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) crates/vcad-kernel-urdf/src/writer.rs:125— crates/vcad-kernel-urdf/src/writer.rs:125-148 | crates/vcad-kernel-urdf/src/writer.rs:154-185 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (10 lines × 3) crates/vcad-cli/src/app.rs:771— crates/vcad-cli/src/app.rs:771-780 | crates/vcad-cli/src/app.rs:812-821 | crates/vcad-cli/src/app.rs:855-865 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:771` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/vcad-eval/src/kinematics.rs:155— crates/vcad-eval/src/kinematics.rs:155-164 | crates/vcad-eval/src/kinematics.rs:181-190 | crates/vcad-eval/src/kinematics.rs:204-213 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/kinematics.rs:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/vcad-eval/src/validate.rs:93— crates/vcad-eval/src/validate.rs:93-102 | crates/vcad-ir/src/lib.rs:1538-1547 | crates/vcad-ir/src/lib.rs:1590-1599 — 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 (10 lines × 3) crates/vcad-ffi/src/engine.rs:100— crates/vcad-ffi/src/engine.rs:100-109 | crates/vcad-ffi/src/engine.rs:160-169 | crates/vcad-ffi/src/engine.rs:331-340 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/engine.rs:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/vcad-ffi/src/lib.rs:790— crates/vcad-ffi/src/lib.rs:790-799 | crates/vcad-ffi/src/lib.rs:886-895 | crates/vcad-ffi/src/lib.rs:912-921 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:790` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/vcad-kernel-wasm/src/lib.rs:5549— crates/vcad-kernel-wasm/src/lib.rs:5549-5558 | crates/vcad-kernel-wasm/src/lib.rs:5640-5649 | crates/vcad-kernel-wasm/src/lib.rs:5672-5681 — 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) crates/vcad-kernel-wasm/src/lib.rs:9330— crates/vcad-kernel-wasm/src/lib.rs:9330-9339 | crates/vcad-kernel-wasm/src/lib.rs:9456-9465 | crates/vcad-kernel-wasm/src/lib.rs:9648-9657 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:9330` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-wasm/src/lib.rs:9645` calls `from_str`, `map_err` and `crates/vcad-kernel-wasm/src/lib.rs:9328` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) crates/vcad-kernel-fea/src/buckling.rs:1657— crates/vcad-kernel-fea/src/buckling.rs:1657-1666 | crates/vcad-kernel-fea/src/section.rs:882-891 | crates/vcad-kernel-fea/src/shell.rs:747-756 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/buckling.rs:1657` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-fea/src/buckling.rs:1667` calls `load_factor` and `crates/vcad-kernel-fea/src/section.rs:892` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) crates/vcad-ir/src/vcode.rs:1589— crates/vcad-ir/src/vcode.rs:1589-1598 | crates/vcad-ir/src/vcode.rs:1612-1621 | crates/vcad-ir/src/vcode.rs:1635-1644 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1589` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/vcad-ecad-pcb/src/dfm.rs:517— crates/vcad-ecad-pcb/src/dfm.rs:517-525 | crates/vcad-ecad-pcb/src/drc.rs:1448-1457 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/dfm.rs:517` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-dfm/src/geom/probe.rs:351— crates/vcad-kernel-dfm/src/geom/probe.rs:351-359 | crates/vcad-kernel-raytrace/src/intersect/triangle.rs:63-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-dfm/src/rules/casting.rs:34— crates/vcad-kernel-dfm/src/rules/casting.rs:34-42 | crates/vcad-kernel-dfm/src/rules/mold.rs:26-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/rules/casting.rs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-fea/src/buckling.rs:441— crates/vcad-kernel-fea/src/buckling.rs:441-450 | crates/vcad-kernel-fea/src/modal.rs:207-215 — before extracting anything, compare `crates/vcad-kernel-fea/src/buckling.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-fea/src/graph.rs:331— crates/vcad-kernel-fea/src/graph.rs:331-340 | crates/vcad-kernel-thermal/src/graph.rs:384-392 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/graph.rs:331` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-sheet/src/poly2d.rs:111— crates/vcad-kernel-sheet/src/poly2d.rs:111-120 | crates/vcad-kernel-sheet/src/unfold.rs:362-370 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:1019— crates/vcad-kernel-tessellate/src/lib.rs:1019-1028 | crates/vcad-kernel-tessellate/src/lib.rs:1256-1264 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-wasm/src/circuit_sim.rs:853— crates/vcad-kernel-wasm/src/circuit_sim.rs:853-862 | crates/vcad-kernel-wasm/src/circuit_sim.rs:903-911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/circuit_sim.rs:853` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:5473— crates/vcad-kernel-wasm/src/lib.rs:5473-5482 | crates/vcad-kernel-wasm/src/lib.rs:5502-5510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
vcad_kernel_fea::buckling::buckling_on_mesh (cyclomatic 71) crates/vcad-kernel-fea/src/buckling.rs:818— vcad_kernel_fea::buckling::buckling_on_mesh has cyclomatic complexity 71 (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.
vcad_kernel_fea::adjoint::shape_gradient (cyclomatic 28) crates/vcad-kernel-fea/src/adjoint.rs:237— vcad_kernel_fea::adjoint::shape_gradient 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.
vcad_kernel_fea::modal::brick_matrices (cyclomatic 27) crates/vcad-kernel-fea/src/modal.rs:135— vcad_kernel_fea::modal::brick_matrices has cyclomatic complexity 27 (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.
vcad_kernel_fea::mesh::hex_fill_conforming (cyclomatic 23) crates/vcad-kernel-fea/src/mesh.rs:415— vcad_kernel_fea::mesh::hex_fill_conforming has cyclomatic complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_fea::section::check_beam (cyclomatic 22) crates/vcad-kernel-fea/src/section.rs:638— vcad_kernel_fea::section::check_beam 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.
vcad_kernel_fea::graph::device_assembly (cyclomatic 19) crates/vcad-kernel-fea/src/graph.rs:138— vcad_kernel_fea::graph::device_assembly has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_fea::mesh::wall_thickness (cyclomatic 17) crates/vcad-kernel-fea/src/mesh.rs:553— vcad_kernel_fea::mesh::wall_thickness has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_fea::mesh::voxelize (cyclomatic 16) crates/vcad-kernel-fea/src/mesh.rs:120— vcad_kernel_fea::mesh::voxelize 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.
vcad_loon::split_top_level (cyclomatic 33) crates/vcad-loon/src/lib.rs:251— vcad_loon::split_top_level 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.
vcad_loon::convert::value_to_document_in (cyclomatic 27) crates/vcad-loon/src/convert.rs:17— vcad_loon::convert::value_to_document_in has cyclomatic complexity 27 (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.
vcad_loon::convert::convert_ecad_value (cyclomatic 26) crates/vcad-loon/src/convert.rs:650— vcad_loon::convert::convert_ecad_value has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
vcad_loon::convert::convert_assembly (cyclomatic 24) crates/vcad-loon/src/convert.rs:367— vcad_loon::convert::convert_assembly 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.
vcad_loon::fastener::plan (cyclomatic 23) crates/vcad-loon/src/fastener.rs:306— vcad_loon::fastener::plan 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.
vcad_loon::recover::recover (cyclomatic 21) crates/vcad-loon/src/recover.rs:69— vcad_loon::recover::recover 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.
vcad_loon::convert::merge_value_into_doc (cyclomatic 20) crates/vcad-loon/src/convert.rs:193— vcad_loon::convert::merge_value_into_doc has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
vcad_loon::variants::parse_variant (cyclomatic 17) crates/vcad-loon/src/variants.rs:498— vcad_loon::variants::parse_variant 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.
vcad_ecad_fabprep::run_fab_prep (cognitive 60) crates/vcad-ecad-fabprep/src/lib.rs:403— vcad_ecad_fabprep::run_fab_prep has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (46 pts), boolean chains 8, match/switch 2 (4 pts), loops 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.
vcad_ecad_fabprep::render::fab_notes (cognitive 31) crates/vcad-ecad-fabprep/src/render.rs:236— vcad_ecad_fabprep::render::fab_notes has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 5 (10 pts), boolean chains 1 (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.
vcad_ecad_fabprep::verdict::route_remaining (cognitive 25) crates/vcad-ecad-fabprep/src/verdict.rs:112— vcad_ecad_fabprep::verdict::route_remaining has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_fabprep::calibrate::tightest_pad_hole_gap (cognitive 23) crates/vcad-ecad-fabprep/src/calibrate.rs:174— vcad_ecad_fabprep::calibrate::tightest_pad_hole_gap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_fabprep::calibrate::calibrate_rules (cognitive 21) crates/vcad-ecad-fabprep/src/calibrate.rs:231— vcad_ecad_fabprep::calibrate::calibrate_rules has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (21 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.
vcad_ecad_fabprep::delta::nets_in_message (cognitive 18) crates/vcad-ecad-fabprep/src/delta.rs:118— vcad_ecad_fabprep::delta::nets_in_message has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_fabprep::verdict::rip_up_pass (cognitive 18) crates/vcad-ecad-fabprep/src/verdict.rs:1579— vcad_ecad_fabprep::verdict::rip_up_pass has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (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.
vcad_ecad_fabprep::verdict::stitch_zones (cognitive 16) crates/vcad-ecad-fabprep/src/verdict.rs:1490— vcad_ecad_fabprep::verdict::stitch_zones has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 5 (7 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.
vcad_slicer::analyze::analyze_for_printing (cognitive 49) crates/vcad-slicer/src/analyze.rs:74— vcad_slicer::analyze::analyze_for_printing has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (43 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_slicer::slice::chain_segments (cognitive 27) crates/vcad-slicer/src/slice.rs:192— vcad_slicer::slice::chain_segments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (6 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.
vcad_slicer::perimeter::generate_perimeters (cognitive 25) crates/vcad-slicer/src/perimeter.rs:61— vcad_slicer::perimeter::generate_perimeters has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_slicer::analyze::detect_bridges (cognitive 22) crates/vcad-slicer/src/analyze.rs:272— vcad_slicer::analyze::detect_bridges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (14 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (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.
vcad_slicer::smart_defaults::recommend_settings (cognitive 21) crates/vcad-slicer/src/smart_defaults.rs:60— vcad_slicer::smart_defaults::recommend_settings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 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.
vcad_slicer::support::detect_overhangs (cognitive 18) crates/vcad-slicer/src/support.rs:64— vcad_slicer::support::detect_overhangs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, 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.
vcad_slicer::slice_with_progress (cognitive 17) crates/vcad-slicer/src/lib.rs:207— vcad_slicer::slice_with_progress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (7 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.
vcad_slicer::slice::triangle_plane_intersection (cognitive 16) crates/vcad-slicer/src/slice.rs:129— vcad_slicer::slice::triangle_plane_intersection has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
vcad_kernel_diff::lift::lift_surface (cognitive 38) crates/vcad-kernel-diff/src/lift.rs:55— vcad_kernel_diff::lift::lift_surface has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 8 (20 pts), loops 8 (18 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.
vcad_kernel_diff::implicit::implicit_terms (cognitive 28) crates/vcad-kernel-diff/src/implicit.rs:49— vcad_kernel_diff::implicit::implicit_terms has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 6 (16 pts), loops 5 (10 pts), if/else 1 (2 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_diff::lift::lift_surface_second (cognitive 24) crates/vcad-kernel-diff/src/lift.rs:211— vcad_kernel_diff::lift::lift_surface_second has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 15 (20 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_diff::mass::mass_properties (cognitive 22) crates/vcad-kernel-diff/src/mass.rs:50— vcad_kernel_diff::mass::mass_properties has cognitive complexity 22 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 4 (8 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.
vcad_kernel_diff::adjoint::evaluate_with_pullback (cognitive 21) crates/vcad-kernel-diff/src/adjoint.rs:265— vcad_kernel_diff::adjoint::evaluate_with_pullback has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 2 (6 pts), if/else 3 (5 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_diff::optimize::minimize (cognitive 17) crates/vcad-kernel-diff/src/optimize.rs:226— vcad_kernel_diff::optimize::minimize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (6 pts), loops 2 (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.
vcad_kernel_diff::implicit::row_pullbacks (cognitive 16) crates/vcad-kernel-diff/src/implicit.rs:562— vcad_kernel_diff::implicit::row_pullbacks has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (4 pts) (nesting depth added 8). 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.
vcad_kernel_diff::seam::carry_rows (cognitive 16) crates/vcad-kernel-diff/src/seam.rs:211— vcad_kernel_diff::seam::carry_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (6 pts), boolean chains 1, match/switch 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.
Change coupling: vcode.rs ↔ writer.rs crates/vcad-ir/src/vcode.rs:1— `crates/vcad-ir/src/vcode.rs` and `crates/vcad-kernel-urdf/src/writer.rs` change together 79% of the time (15 of the 19 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 15 shared commits counted here, the most recent 3 are `7fced6b1` Sketch on face: sketches re-attach to their named face on every rebui…; `51cdded3` feat(ir): SpurGear primitive with pressure angle, bore, mesh phase; `91029ca9` feat(loon): sweep-rotate swept-volume op for joint clearance cuts — run `git show` on any of them.
Change coupling: validate.rs ↔ to_loon.rs crates/vcad-eval/src/validate.rs:1— `crates/vcad-eval/src/validate.rs` and `crates/vcad-ir/src/to_loon.rs` change together 79% of the time (11 of the 14 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 11 shared commits counted here, the most recent 3 are `7fced6b1` Sketch on face: sketches re-attach to their named face on every rebui…; `51cdded3` feat(ir): SpurGear primitive with pressure angle, bore, mesh phase; `91029ca9` feat(loon): sweep-rotate swept-volume op for joint clearance cuts — run `git show` on any of them.
Change coupling: validate.rs ↔ writer.rs crates/vcad-eval/src/validate.rs:1— `crates/vcad-eval/src/validate.rs` and `crates/vcad-kernel-urdf/src/writer.rs` change together 79% of the time (11 of the 14 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 11 shared commits counted here, the most recent 3 are `7fced6b1` Sketch on face: sketches re-attach to their named face on every rebui…; `51cdded3` feat(ir): SpurGear primitive with pressure angle, bore, mesh phase; `91029ca9` feat(loon): sweep-rotate swept-volume op for joint clearance cuts — run `git show` on any of them.
Change coupling: server.ts ↔ main.ts packages/mcp/src/server.ts:1— `packages/mcp/src/server.ts` and `packages/mcp/viewer-app/main.ts` change together 74% of the time (14 of the 19 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 14 shared commits counted here, the most recent 3 are `fb2f9ef9` fix(mcp): bound the preview payload so big models render instead of f…; `c32515e7` fix(mcp): make MCP session loss self-announcing, not silent (#704); `d5954061` fix(mcp): always attach inline preview GLB to mount-tool results (#626) — run `git show` on any of them.
Change coupling: ReleasedDesktop.swift ↔ VcadApp.swift apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1— `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift` and `apple/VcadApp/Sources/VcadApp/VcadApp.swift` change together 62% of the time (13 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `400ba699` native: SolidWorks / Onshape / Blender mouse navigation presets (#1203); `6c6038f8` mac app: unsaved work goes to Recents, no launch recovery prompt (#1192); `acdac55a` Document runtime slice 1: scrubs off the main thread — run `git show` on any of them.
Change coupling: AppShell.tsx ↔ Header.tsx packages/app/src/components/AppShell.tsx:1— `packages/app/src/components/AppShell.tsx` and `packages/app/src/components/Header.tsx` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `02f9d8d1` refactor(app): comb out Borland-era UI patterns for v3 polish; `72723273` feat: rename log viewer to DevTools, dock between body and footer; `77a021f2` feat: sidebar drill-down, URL state, iTunes-style ⌘K search bar — run `git show` on any of them.
Change coupling: FeatureTree.tsx ↔ PropertyPanel.tsx packages/app/src/components/FeatureTree.tsx:1— `packages/app/src/components/FeatureTree.tsx` and `packages/app/src/components/PropertyPanel.tsx` change together 52% of the time (14 of the 27 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 14 shared commits counted here, the most recent 3 are `02f9d8d1` refactor(app): comb out Borland-era UI patterns for v3 polish; `cf72da66` feat(ux): two-pane sidebar + breadcrumb + tree mirrors sub-features; `87d459e1` feat(i18n): expand translation coverage across modals, panels, tutorials — run `git show` on any of them.
Change coupling: SceneMesh.tsx ↔ SelectionOverlay.tsx packages/app/src/components/SceneMesh.tsx:1— `packages/app/src/components/SceneMesh.tsx` and `packages/app/src/components/SelectionOverlay.tsx` change together 50% of the time (5 of the 10 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 5 shared commits counted here, the most recent 3 are `44d7089e` chat: higher-level AI tools for common geometry patterns; `77e39693` fix(app): polish selection UI for a subtler, more professional look; `81f16fae` perf(app): optimize viewport orbit performance — run `git show` on any of them.
Duplicated block (5 lines × 4) crates/vcad-eval/src/validate.rs:98— crates/vcad-eval/src/validate.rs:98-102 | crates/vcad-ir/src/lib.rs:1543-1547 | crates/vcad-ir/src/lib.rs:1595-1599 | crates/vcad-kernel-urdf/src/writer.rs:408-413 — 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 (5 lines × 4) crates/vcad-gdsii/src/bridge.rs:230— crates/vcad-gdsii/src/bridge.rs:230-234 | crates/vcad-kernel-raytrace/src/gpu/buffers.rs:1153-1157 | crates/vcad-process/src/bridge.rs:123-127 | crates/vcad-process/src/masks.rs:74-78 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-gdsii/src/bridge.rs:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) crates/vcad-kernel-fillet/src/chamfer.rs:54— crates/vcad-kernel-fillet/src/chamfer.rs:54-58 | crates/vcad-kernel-fillet/src/fillet_curved.rs:210-214 | crates/vcad-kernel-fillet/src/fillet_planar.rs:90-94 | crates/vcad-kernel-shell/src/lib.rs:1254-1260 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_curved.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/vcad-kernel-fillet/src/chamfer.rs:135— crates/vcad-kernel-fillet/src/chamfer.rs:135-139 | crates/vcad-kernel-fillet/src/fillet_curved.rs:981-985 | crates/vcad-kernel-fillet/src/fillet_planar.rs:217-221 | crates/vcad-kernel-fillet/src/trim.rs:423-427 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_curved.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/chamfer.rs:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) crates/vcad-kernel-tessellate/src/lib.rs:5330— crates/vcad-kernel-tessellate/src/lib.rs:5330-5337 | crates/vcad-kernel-tessellate/src/lib.rs:5433-5440 | crates/vcad-kernel-tessellate/src/lib.rs:5668-5672 | crates/vcad-kernel-tessellate/src/lib.rs:7721-7725 — 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) crates/vcad-ffi/src/gym.rs:533— crates/vcad-ffi/src/gym.rs:533-537 | crates/vcad-ffi/src/gym.rs:1076-1080 | crates/vcad-ffi/src/train.rs:687-691 | crates/vcad-ffi/src/train.rs:972-976 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/gym.rs:533` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 4) apple/VcadApp/Sources/VcadApp/Document.swift:534— apple/VcadApp/Sources/VcadApp/Document.swift:534-538 | apple/VcadApp/Sources/VcadApp/Document.swift:548-552 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:534-538 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:548-552 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Document.swift:534` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 4) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:88— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:88-92 | apple/VcadApp/Sources/VcadApp/SceneAssets.swift:106-110 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:88-92 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:106-110 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Low contrast colour pair in CSS (3.8:1) packages/app/public/auth/popup.html:158— `.btn.primary` sets color: #ffffff on background-color: #f92672 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) packages/app/public/launch/index.html:75— `::selection` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) packages/app/public/launch/index.html:83— `a:hover` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) packages/app/public/launch/index.html:115— `a.hero-btn.primary` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) packages/app/public/launch/index.html:116— `a.hero-btn:hover` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) packages/app/public/launch/index.html:139— `.step-btn:hover` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) packages/app/public/launch/index.html:271— `.deeper:hover .deeper-link` sets color: #fff on background-color: #ff2052 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
vcad_kernel_thermal::solve::build (cyclomatic 76) crates/vcad-kernel-thermal/src/solve.rs:551— vcad_kernel_thermal::solve::build has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_thermal::adjoint::smooth_max_gradient (cyclomatic 34) crates/vcad-kernel-thermal/src/adjoint.rs:145— vcad_kernel_thermal::adjoint::smooth_max_gradient 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.
vcad_kernel_thermal::graph::assemble (cyclomatic 27) crates/vcad-kernel-thermal/src/graph.rs:216— vcad_kernel_thermal::graph::assemble 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.
vcad_kernel_thermal::transient::solve_transient_schedule (cyclomatic 25) crates/vcad-kernel-thermal/src/transient.rs:226— vcad_kernel_thermal::transient::solve_transient_schedule 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.
vcad_kernel_thermal::thermocouple::reduce_log (cyclomatic 20) crates/vcad-kernel-thermal/src/thermocouple.rs:81— vcad_kernel_thermal::thermocouple::reduce_log 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.
vcad_kernel_thermal::solve::solve_field (cyclomatic 16) crates/vcad-kernel-thermal/src/solve.rs:1110— vcad_kernel_thermal::solve::solve_field 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.
vcad_kernel_thermal::solve::assemble_solution (cyclomatic 16) crates/vcad-kernel-thermal/src/solve.rs:1385— vcad_kernel_thermal::solve::assemble_solution 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.
vcad_ecad_sim::circuit::transient_adjoint::transient_sensitivities (cyclomatic 32) crates/vcad-ecad-sim/src/circuit/transient_adjoint.rs:145— vcad_ecad_sim::circuit::transient_adjoint::transient_sensitivities has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
vcad_ecad_sim::circuit::netlist::circuit_from_netlist (cyclomatic 31) crates/vcad-ecad-sim/src/circuit/netlist.rs:377— vcad_ecad_sim::circuit::netlist::circuit_from_netlist has cyclomatic complexity 31 (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.
vcad_ecad_sim::circuit::adjoint::ac_sensitivities (cyclomatic 25) crates/vcad-ecad-sim/src/circuit/adjoint.rs:255— vcad_ecad_sim::circuit::adjoint::ac_sensitivities 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.
vcad_ecad_sim::circuit::ac::build_and_solve (cyclomatic 23) crates/vcad-ecad-sim/src/circuit/ac.rs:271— vcad_ecad_sim::circuit::ac::build_and_solve 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.
vcad_ecad_sim::circuit::netlist::parse_si_value (cyclomatic 20) crates/vcad-ecad-sim/src/circuit/netlist.rs:122— vcad_ecad_sim::circuit::netlist::parse_si_value 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.
vcad_ecad_sim::circuit::dc::operating_point (cyclomatic 18) crates/vcad-ecad-sim/src/circuit/dc.rs:75— vcad_ecad_sim::circuit::dc::operating_point has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_ecad_sim::airgap::airgap_solve (cyclomatic 17) crates/vcad-ecad-sim/src/airgap.rs:238— vcad_ecad_sim::airgap::airgap_solve 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.
vcad_kernel_dfm::rules::hobby_mill::r7_threads_and_gears (cyclomatic 28) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1759— vcad_kernel_dfm::rules::hobby_mill::r7_threads_and_gears 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.
vcad_kernel_dfm::geom::setups::plan (cyclomatic 22) crates/vcad-kernel-dfm/src/geom/setups.rs:126— vcad_kernel_dfm::geom::setups::plan 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.
vcad_kernel_dfm::rules::hobby_mill::r5_min_wall (cyclomatic 22) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:1535— vcad_kernel_dfm::rules::hobby_mill::r5_min_wall 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.
vcad_kernel_dfm::rules::cnc::run (cyclomatic 21) crates/vcad-kernel-dfm/src/rules/cnc.rs:33— vcad_kernel_dfm::rules::cnc::run 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.
vcad_kernel_dfm::rules::hobby_mill::link_loops (cyclomatic 21) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:596— vcad_kernel_dfm::rules::hobby_mill::link_loops 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.
vcad_kernel_dfm::rules::hobby_mill::union_segments (cyclomatic 19) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:463— vcad_kernel_dfm::rules::hobby_mill::union_segments has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_dfm::rules::cnc::thin_walls (cyclomatic 16) crates/vcad-kernel-dfm/src/rules/cnc.rs:422— vcad_kernel_dfm::rules::cnc::thin_walls 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.
Repeated repair: crates/vcad-ffi/src/export.rs crates/vcad-ffi/src/export.rs:251— crates/vcad-ffi/src/export.rs changed 12 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is vcad_ffi::export::vcad_export_document at line 251), AT OR 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(step): interop audit — no hangs, colours, assembly placement, NURBS export (#1126)”; “fix(assembly): export instances not def copies, STEP posed instances, scalable interference, parse STEP once (#1123)”; “drop local needless_update allow (fixed on main by #1019)”; “fix(ffi): allow deliberate needless_update in photoreal options”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-ffi/src/export.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: crates/vcad-app/src/agent.rs crates/vcad-app/src/agent.rs:407— crates/vcad-app/src/agent.rs changed 16 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 8 (its worst body is vcad_app::agent::describe_scene at line 407), AT OR 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: clear the remaining agent acceptance-run blockers”; “fix(mcp): clear the agent actuator run's blockers”; “fix(analysis): honest verdicts, conforming FEA lattice, closed via meshes”; “fix(engine): opened documents keep bindings and actuator limits”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-app/src/agent.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: packages/mcp/src/tools/document-solids.ts packages/mcp/src/tools/document-solids.ts:116— packages/mcp/src/tools/document-solids.ts 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 9 (its worst body is document-solids.canonicalNodes at line 116), AT OR 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(mcp): keep node-only modules out of the browser tool set”; “fix: clear the remaining agent acceptance-run blockers”; “fix(mcp): clear the agent actuator run's blockers”; “fix(mcp): closed-case fit, dense renders, board write cost, fab and receipt gates”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- packages/mcp/src/tools/document-solids.ts`: 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: apple/VcadApp/Sources/VcadApp/AssemblyPanel.swift apple/VcadApp/Sources/VcadApp/AssemblyPanel.swift:201— apple/VcadApp/Sources/VcadApp/AssemblyPanel.swift changed 5 times in last 90 days and 3 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 JointDriveRow.body at line 201), AT OR 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(native): list parts by name; clearance checks posed instances”; “fix(mcp): clear the agent actuator run's blockers”; “fix(native): assembly joint list follows the pose; names wrap; triad clears the panels”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/AssemblyPanel.swift`: 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: crates/vcad-kernel-drafting/src/edge_extract.rs crates/vcad-kernel-drafting/src/edge_extract.rs:281— crates/vcad-kernel-drafting/src/edge_extract.rs changed 4 times in last 90 days and 3 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 vcad_kernel_drafting::edge_extract::build_adjacency at line 281), AT OR 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(drafting): weld mesh edges and drop T-junction boundaries in HLR”; “fix(drafting): deterministic edge order”; “fix(drafting): draw feature edges, not the triangle mesh”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- crates/vcad-kernel-drafting/src/edge_extract.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: apple/VcadApp/Sources/VcadApp/AssemblyModel.swift apple/VcadApp/Sources/VcadApp/AssemblyModel.swift:189— apple/VcadApp/Sources/VcadApp/AssemblyModel.swift changed 3 times in last 90 days and 3 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 EditorModel.pickedAnchor at line 189), AT OR 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(native): list parts by name; clearance checks posed instances”; “fix(mcp): clear the agent actuator run's blockers”; “fix(native): assembly joint list follows the pose; names wrap; triad clears the panels”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/AssemblyModel.swift`: 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: apple/VcadApp/Sources/VcadApp/CamJobPanel.swift apple/VcadApp/Sources/VcadApp/CamJobPanel.swift:135— apple/VcadApp/Sources/VcadApp/CamJobPanel.swift changed 3 times in last 90 days and 3 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 CamJobPanel.body at line 135), AT OR 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(native): CAM fields commit on Return, stale CAM results marked, hide empty drawing pill”; “fix(native): removing a CAM operation no longer crashes; benchmark part 10”; “fix(native): Fab panels fit and label their fields; CAM stock starts at the part”. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:27:34 -05:00' --until='2026-11-16 17:27:34 -05:00' --full-history --no-merges -- apple/VcadApp/Sources/VcadApp/CamJobPanel.swift`: 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.
vcad_kernel_flow::solve::solve_steady (cognitive 227) crates/vcad-kernel-flow/src/solve.rs:172— vcad_kernel_flow::solve::solve_steady has cognitive complexity 227 (threshold 15). Drivers by points: if/else 35 (124 pts), loops 21 (74 pts), match/switch 7 (26 pts), boolean chains 3 (nesting depth added 161). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_flow::adjoint::pressure_drop_gradient (cognitive 167) crates/vcad-kernel-flow/src/adjoint.rs:368— vcad_kernel_flow::adjoint::pressure_drop_gradient has cognitive complexity 167 (threshold 15). Drivers by points: if/else 22 (80 pts), loops 25 (72 pts), match/switch 2 (11 pts), boolean chains 4 (nesting depth added 114). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_flow::adjoint::forward (cognitive 124) crates/vcad-kernel-flow/src/adjoint.rs:125— vcad_kernel_flow::adjoint::forward has cognitive complexity 124 (threshold 15). Drivers by points: if/else 17 (62 pts), loops 16 (47 pts), match/switch 3 (12 pts), boolean chains 3 (nesting depth added 85). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_flow::solve::finish (cognitive 102) crates/vcad-kernel-flow/src/solve.rs:579— vcad_kernel_flow::solve::finish has cognitive complexity 102 (threshold 15). Drivers by points: if/else 20 (66 pts), loops 10 (26 pts), match/switch 2 (6 pts), boolean chains 4 (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.
vcad_kernel_flow::conjugate::wetted_surface (cognitive 32) crates/vcad-kernel-flow/src/conjugate.rs:161— vcad_kernel_flow::conjugate::wetted_surface has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (21 pts), loops 4 (10 pts), boolean chains 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.
vcad_kernel_flow::conjugate_adjoint::conjugate_gradient (cognitive 18) crates/vcad-kernel-flow/src/conjugate_adjoint.rs:490— vcad_kernel_flow::conjugate_adjoint::conjugate_gradient has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), match/switch 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.
vcad_kernel_flow::receipt::compare (cognitive 18) crates/vcad-kernel-flow/src/receipt.rs:280— vcad_kernel_flow::receipt::compare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
vcad_kernel::turning_profile::turning_profile (cognitive 214) crates/vcad-kernel/src/turning_profile.rs:195— vcad_kernel::turning_profile::turning_profile has cognitive complexity 214 (threshold 15). Drivers by points: if/else 72 (158 pts), loops 20 (37 pts), boolean chains 12, match/switch 3 (7 pts) (nesting depth added 107). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel::hull::convex_hull (cognitive 40) crates/vcad-kernel/src/hull.rs:64— vcad_kernel::hull::convex_hull has cognitive complexity 40 (threshold 15). Drivers by points: loops 14 (22 pts), if/else 8 (15 pts), boolean chains 3 (nesting depth added 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.
vcad_kernel::sheet_json::tessellate_model (cognitive 39) crates/vcad-kernel/src/sheet_json.rs:860— vcad_kernel::sheet_json::tessellate_model has cognitive complexity 39 (threshold 15). Drivers by points: loops 11 (25 pts), if/else 6 (14 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel::turning_profile::chain_segments (cognitive 30) crates/vcad-kernel/src/turning_profile.rs:698— vcad_kernel::turning_profile::chain_segments has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (21 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.
vcad_kernel::sheet_fold::folded_sheet_solid (cognitive 26) crates/vcad-kernel/src/sheet_fold.rs:59— vcad_kernel::sheet_fold::folded_sheet_solid has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 6, 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.
vcad_kernel::fillet_aabb_is_reasonable (cognitive 18) crates/vcad-kernel/src/lib.rs:2731— vcad_kernel::fillet_aabb_is_reasonable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4, boolean chains 2 (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.
vcad_kernel::collect_fillet_target_edges (cognitive 16) crates/vcad-kernel/src/lib.rs:2931— vcad_kernel::collect_fillet_target_edges has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_enclosure::mesh::extract_standoffs (cognitive 51) crates/vcad-kernel-enclosure/src/mesh.rs:338— vcad_kernel_enclosure::mesh::extract_standoffs has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (35 pts), loops 6 (13 pts), boolean chains 3 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_enclosure::pcb::mounting_holes_from_pcb (cognitive 26) crates/vcad-kernel-enclosure/src/pcb.rs:135— vcad_kernel_enclosure::pcb::mounting_holes_from_pcb has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
vcad_kernel_enclosure::fit::check_connectors (cognitive 23) crates/vcad-kernel-enclosure/src/fit.rs:772— vcad_kernel_enclosure::fit::check_connectors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (22 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.
vcad_kernel_enclosure::fit::check_lid_clearance (cognitive 22) crates/vcad-kernel-enclosure/src/fit.rs:559— vcad_kernel_enclosure::fit::check_lid_clearance has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, loops 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.
vcad_kernel_enclosure::mesh::extract_openings (cognitive 21) crates/vcad-kernel-enclosure/src/mesh.rs:419— vcad_kernel_enclosure::mesh::extract_openings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6 (9 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.
vcad_kernel_enclosure::fit::check_mounting_holes (cognitive 18) crates/vcad-kernel-enclosure/src/fit.rs:679— vcad_kernel_enclosure::fit::check_mounting_holes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
vcad_kernel_enclosure::mesh::extract_enclosure_features (cognitive 16) crates/vcad-kernel-enclosure/src/mesh.rs:238— vcad_kernel_enclosure::mesh::extract_enclosure_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×7
Edited copy of a member (27 corresponding lines) crates/vcad-kernel-fea/src/buckling.rs:408— crates/vcad-kernel-fea/src/buckling.rs:408-438 | crates/vcad-kernel-fea/src/modal.rs:142-268 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:400— crates/vcad-kernel-nurbs/src/lib.rs:400-426 | crates/vcad-kernel-nurbs/src/lib.rs:798-832 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) crates/vcad-ecad-pcb/src/teardrop.rs:155— crates/vcad-ecad-pcb/src/teardrop.rs:155-183 | crates/vcad-ecad-symbols/src/kicad_mod.rs:552-578 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) apple/VcadApp/Sources/VcadApp/VisionShell.swift:94— apple/VcadApp/Sources/VcadApp/VisionShell.swift:94-120 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:94-120 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:2606— crates/vcad-kernel-wasm/src/lib.rs:2606-2637 | crates/vcad-kernel-wasm/src/lib.rs:2876-2902 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:1324— crates/vcad-kernel-wasm/src/lib.rs:1324-1357 | crates/vcad-kernel-wasm/src/lib.rs:1376-1402 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) crates/vcad-gdsii/src/bridge.rs:182— crates/vcad-gdsii/src/bridge.rs:182-210 | crates/vcad-process/src/bridge.rs:93-119 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×7
Edited copy of a member (25 corresponding lines) crates/vcad-kernel-booleans/src/mesh/mod.rs:173— crates/vcad-kernel-booleans/src/mesh/mod.rs:173-203 | crates/vcad-kernel-fillet/src/topology.rs:178-202 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/vcad-ecad-pcb/src/router/flow/cdt.rs:204— crates/vcad-ecad-pcb/src/router/flow/cdt.rs:204-235 | crates/vcad-ecad-pcb/src/session.rs:970-994 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/vcad-ecad-symbols/src/builtin.rs:129— crates/vcad-ecad-symbols/src/builtin.rs:129-153 | crates/vcad-ecad-symbols/src/builtin.rs:206-242 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:5636— crates/vcad-kernel-wasm/src/lib.rs:5636-5660 | crates/vcad-kernel-wasm/src/lib.rs:5666-5692 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/vcad-eval/src/evaluate.rs:1942— crates/vcad-eval/src/evaluate.rs:1942-1969 | crates/vcad-kernel/src/sheet_json.rs:156-180 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:3072— crates/vcad-kernel-wasm/src/lib.rs:3072-3096 | crates/vcad-kernel-wasm/src/lib.rs:3257-3287 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/vcad-chat/src/executor.rs:554— crates/vcad-chat/src/executor.rs:554-578 | crates/vcad-chat/src/executor.rs:584-610 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×7
Edited copy of a member (19 corresponding lines) crates/vcad-kernel-drafting/src/hidden_line.rs:395— crates/vcad-kernel-drafting/src/hidden_line.rs:395-413 | crates/vcad-kernel-drafting/src/hidden_line.rs:424-446 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/vcad-ecad-symbols/src/footprint.rs:1286— crates/vcad-ecad-symbols/src/footprint.rs:1286-1304 | crates/vcad-ecad-symbols/src/footprint.rs:1314-1335 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/vcad-eval/src/evaluate.rs:2192— crates/vcad-eval/src/evaluate.rs:2192-2211 | crates/vcad-kernel-raytrace/src/gpu/buffers.rs:556-574 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/vcad-ecad-pcb/src/router/auto.rs:5015— crates/vcad-ecad-pcb/src/router/auto.rs:5015-5033 | crates/vcad-render/src/pcb.rs:1035-1057 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:2778— crates/vcad-ecad-pcb/src/drc.rs:2778-2797 | crates/vcad-ecad-pcb/src/drc.rs:2876-2894 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/vcad-parts/src/vacuum/fittings.rs:172— crates/vcad-parts/src/vacuum/fittings.rs:172-190 | crates/vcad-parts/src/vacuum/fittings.rs:229-248 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/vcad-eval/src/convert.rs:29— crates/vcad-eval/src/convert.rs:29-47 | crates/vcad-kernel-wasm/src/lib.rs:920-938 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (22 lines × 2) crates/vcad-ecad-pcb/src/copper_pour.rs:368— crates/vcad-ecad-pcb/src/copper_pour.rs:368-389 | crates/vcad-ecad-pcb/src/spatial.rs:540-561 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22 lines × 2) crates/vcad-ecad-pcb/src/drc.rs:1722— crates/vcad-ecad-pcb/src/drc.rs:1722-1743 | crates/vcad-ecad-pcb/src/spatial.rs:122-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/drc.rs:1722` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) crates/vcad-kernel-constraints/src/gpu.rs:66— crates/vcad-kernel-constraints/src/gpu.rs:66-87 | crates/vcad-kernel-constraints/src/gpu.rs:124-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-constraints/src/gpu.rs:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) crates/vcad-kernel-sweep/src/loft.rs:205— crates/vcad-kernel-sweep/src/loft.rs:205-226 | crates/vcad-kernel-sweep/src/sweep.rs:301-322 — before extracting anything, compare `crates/vcad-kernel-sweep/src/loft.rs` and `crates/vcad-kernel-sweep/src/sweep.rs` as WHOLE FILES: this scan already matched 8 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 (22 lines × 2) apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:105— apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:105-126 | apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift:105-126 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift` and `apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:1138— apple/VcadApp/Sources/VcadApp/Shell.swift:1138-1159 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:1138-1159 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) apple/VcadApp/Sources/VcadApp/VisionShell.swift:218— apple/VcadApp/Sources/VcadApp/VisionShell.swift:218-239 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:218-239 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/VisionShell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 201 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 × 3) crates/vcad-app/src/materializer.rs:1182— crates/vcad-app/src/materializer.rs:1182-1193 | crates/vcad-app/src/materializer.rs:1238-1249 | crates/vcad-app/src/materializer.rs:1287-1298 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/materializer.rs:1182` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 3) crates/vcad-cli/src/app.rs:746— crates/vcad-cli/src/app.rs:746-757 | crates/vcad-cli/src/app.rs:787-798 | crates/vcad-cli/src/app.rs:828-839 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:746` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) crates/vcad-kernel-export/src/lib.rs:372— crates/vcad-kernel-export/src/lib.rs:372-383 | crates/vcad-kernel-export/src/lib.rs:389-400 | crates/vcad-kernel-export/src/lib.rs:411-422 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-export/src/lib.rs:372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) crates/vcad-kernel-sketch/src/extrude.rs:1465— crates/vcad-kernel-sketch/src/extrude.rs:1465-1476 | crates/vcad-kernel-sketch/src/revolve.rs:644-655 | crates/vcad-kernel-sweep/src/loft.rs:295-306 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:1465` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) crates/vcad-kernel-dfm/src/geom/mod.rs:79— crates/vcad-kernel-dfm/src/geom/mod.rs:79-90 | crates/vcad-slicer/src/analyze.rs:347-358 | crates/vcad-slicer/src/dfm.rs:154-165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 3) crates/vcad-ir/src/vcode.rs:2519— crates/vcad-ir/src/vcode.rs:2519-2531 | crates/vcad-ir/src/vcode.rs:2559-2570 | crates/vcad-ir/src/vcode.rs:2719-2730 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:2519` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 3) crates/vcad-kernel-booleans/src/pipeline.rs:854— crates/vcad-kernel-booleans/src/pipeline.rs:854-865 | crates/vcad-kernel-booleans/src/pipeline.rs:906-917 | crates/vcad-kernel-booleans/src/pipeline.rs:1004-1015 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/pipeline.rs:854` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
vcad_kernel_sheet::poly2d::boolean (cyclomatic 58) crates/vcad-kernel-sheet/src/poly2d.rs:431— vcad_kernel_sheet::poly2d::boolean has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel_sheet::flatten::detect_bend (cyclomatic 43) crates/vcad-kernel-sheet/src/flatten.rs:873— vcad_kernel_sheet::flatten::detect_bend 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.
vcad_kernel_sheet::flatten::flatten_solid (cyclomatic 28) crates/vcad-kernel-sheet/src/flatten.rs:496— vcad_kernel_sheet::flatten::flatten_solid 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.
vcad_kernel_sheet::manufacturability::check_manufacturability (cyclomatic 19) crates/vcad-kernel-sheet/src/manufacturability.rs:333— vcad_kernel_sheet::manufacturability::check_manufacturability 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.
vcad_kernel_sheet::poly2d::splits_from (cyclomatic 18) crates/vcad-kernel-sheet/src/poly2d.rs:268— vcad_kernel_sheet::poly2d::splits_from 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.
vcad_kernel_sheet::flatten::assemble (cyclomatic 17) crates/vcad-kernel-sheet/src/flatten.rs:1099— vcad_kernel_sheet::flatten::assemble 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.
vcad_kernel_step::reconstruct::plan_edge_merges (cyclomatic 42) crates/vcad-kernel-step/src/reconstruct.rs:102— vcad_kernel_step::reconstruct::plan_edge_merges 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.
vcad_kernel_step::entities::surfaces::parse_bspline_surface (cyclomatic 28) crates/vcad-kernel-step/src/entities/surfaces.rs:286— vcad_kernel_step::entities::surfaces::parse_bspline_surface 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.
vcad_kernel_step::pmi::extract_pmi (cyclomatic 24) crates/vcad-kernel-step/src/pmi.rs:92— vcad_kernel_step::pmi::extract_pmi 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.
vcad_kernel_step::reconstruct::circle_fit (cyclomatic 18) crates/vcad-kernel-step/src/reconstruct.rs:365— vcad_kernel_step::reconstruct::circle_fit 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.
vcad_kernel_step::assembly::solid_occurrences (cyclomatic 16) crates/vcad-kernel-step/src/assembly.rs:198— vcad_kernel_step::assembly::solid_occurrences 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.
vcad_kernel_step::reader::length_unit_mm (cyclomatic 16) crates/vcad-kernel-step/src/reader.rs:436— vcad_kernel_step::reader::length_unit_mm 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.
vcad_kernel_particle::bem::solve (cyclomatic 39) crates/vcad-kernel-particle/src/bem.rs:389— vcad_kernel_particle::bem::solve 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.
vcad_kernel_particle::chain::trace_ion (cyclomatic 24) crates/vcad-kernel-particle/src/chain.rs:571— vcad_kernel_particle::chain::trace_ion 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.
vcad_kernel_particle::electrode_opt::optimize_electrodes (cyclomatic 23) crates/vcad-kernel-particle/src/electrode_opt.rs:196— vcad_kernel_particle::electrode_opt::optimize_electrodes 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.
vcad_kernel_particle::poisson::solve_with_chamber (cyclomatic 23) crates/vcad-kernel-particle/src/poisson.rs:167— vcad_kernel_particle::poisson::solve_with_chamber 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.
vcad_kernel_particle::chain::run_from (cyclomatic 19) crates/vcad-kernel-particle/src/chain.rs:1009— vcad_kernel_particle::chain::run_from 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.
vcad_kernel_particle::chain::predict (cyclomatic 16) crates/vcad-kernel-particle/src/chain.rs:1409— vcad_kernel_particle::chain::predict has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TodoComment crates/vcad-slicer/src/analyze.rs:266— // TODO: orientation optimization — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/vcad-kernel-wasm/src/lib.rs:4416— // TODO: Implement CPU picking path — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/vcad-kernel-wasm/src/lib.rs:5246— // shift down by thickness/2. Cutouts (`outline.cutouts`) are a TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/vcad-kernel-sketch/src/revolve.rs:244— // Faceted ring (true cone surfaces TODO). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/vcad-kernel-physics/src/gym.rs:106— /// damping. (Joint friction only — see the contact TODO on — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/vcad-kernel-physics/src/world.rs:1532— /// TODO(contact): once the contact ground-plane task lands, surface — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FlowGraph::build (cognitive 79) crates/vcad-ecad-pcb/src/router/flow/flow.rs:562— FlowGraph::build has cognitive complexity 79 (threshold 15). Drivers by points: loops 15 (35 pts), if/else 11 (34 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowGraph::shortest (cognitive 74) crates/vcad-ecad-pcb/src/router/flow/flow.rs:881— FlowGraph::shortest has cognitive complexity 74 (threshold 15). Drivers by points: if/else 13 (43 pts), loops 9 (23 pts), boolean chains 6, match/switch 1 (2 pts) (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.
FlowGraph::negotiate (cognitive 61) crates/vcad-ecad-pcb/src/router/flow/flow.rs:1175— FlowGraph::negotiate has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 8 (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.
FlowGraph::max_flow (cognitive 20) crates/vcad-ecad-pcb/src/router/complete.rs:1825— FlowGraph::max_flow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (8 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.
FlowGraph::apply (cognitive 20) crates/vcad-ecad-pcb/src/router/flow/flow.rs:1100— FlowGraph::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 3, 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.
FlowGraph::log_overflow (cognitive 16) crates/vcad-ecad-pcb/src/router/flow/flow.rs:1334— FlowGraph::log_overflow has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 1 (3 pts), match/switch 1 (3 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.
vcad_kernel_topopt::extract::extract_mesh (cognitive 70) crates/vcad-kernel-topopt/src/extract.rs:22— vcad_kernel_topopt::extract::extract_mesh has cognitive complexity 70 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 10 (30 pts), match/switch 1 (6 pts), boolean chains 2 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_topopt::simp::filter_sensitivities (cognitive 61) crates/vcad-kernel-topopt/src/simp.rs:147— vcad_kernel_topopt::simp::filter_sensitivities has cognitive complexity 61 (threshold 15). Drivers by points: if/else 7 (37 pts), loops 6 (21 pts), boolean chains 3 (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.
vcad_kernel_topopt::fea::hex_stiffness (cognitive 51) crates/vcad-kernel-topopt/src/fea.rs:34— vcad_kernel_topopt::fea::hex_stiffness has cognitive complexity 51 (threshold 15). Drivers by points: loops 13 (47 pts), if/else 2 (4 pts) (nesting depth added 36). 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.
vcad_kernel_topopt::analyze::analyze_fields_thermal_warm (cognitive 34) crates/vcad-kernel-topopt/src/analyze.rs:221— vcad_kernel_topopt::analyze::analyze_fields_thermal_warm has cognitive complexity 34 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 7 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 17). 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.
vcad_kernel_topopt::simp::optimize_densities (cognitive 28) crates/vcad-kernel-topopt/src/simp.rs:35— vcad_kernel_topopt::simp::optimize_densities has cognitive complexity 28 (threshold 15). Drivers by points: loops 10 (22 pts), if/else 3 (6 pts) (nesting depth added 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.
vcad_kernel_topopt::extract::taubin_smooth (cognitive 27) crates/vcad-kernel-topopt/src/extract.rs:184— vcad_kernel_topopt::extract::taubin_smooth has cognitive complexity 27 (threshold 15). Drivers by points: loops 9 (23 pts), if/else 1 (4 pts) (nesting depth added 17). 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.
vcad_kernel_shell::shell_brep_analytical (cognitive 65) crates/vcad-kernel-shell/src/lib.rs:136— vcad_kernel_shell::shell_brep_analytical has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 15 (27 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_shell::shell_brep_open (cognitive 64) crates/vcad-kernel-shell/src/lib.rs:436— vcad_kernel_shell::shell_brep_open has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 11 (14 pts), match/switch 4 (7 pts), boolean chains 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.
vcad_kernel_shell::compute_offset_vertex (cognitive 42) crates/vcad-kernel-shell/src/lib.rs:1027— vcad_kernel_shell::compute_offset_vertex has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 1 (5 pts), loops 2 (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.
vcad_kernel_shell::logical_faces (cognitive 35) crates/vcad-kernel-shell/src/lib.rs:692— vcad_kernel_shell::logical_faces has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 9 (11 pts), match/switch 4 (5 pts), boolean chains 4 (nesting depth added 12). Of this number, 33 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.
vcad_kernel_shell::solve_offset (cognitive 34) crates/vcad-kernel-shell/src/lib.rs:921— vcad_kernel_shell::solve_offset has cognitive complexity 34 (threshold 15). Drivers by points: loops 7 (21 pts), if/else 5 (12 pts), match/switch 1 (nesting depth added 21). 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.
vcad_kernel_shell::merge_loops (cognitive 16) crates/vcad-kernel-shell/src/lib.rs:845— vcad_kernel_shell::merge_loops has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (5 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.
vcad_termview::braille::buffer_to_braille (cognitive 33) crates/termview/src/braille.rs:11— vcad_termview::braille::buffer_to_braille has cognitive complexity 33 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (10 pts), match/switch 1 (7 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.
vcad_termview::rasterize::render_scene (cognitive 22) crates/termview/src/rasterize.rs:323— vcad_termview::rasterize::render_scene has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts), boolean chains 4 (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.
vcad_termview::rasterize::draw_line (cognitive 19) crates/termview/src/rasterize.rs:634— vcad_termview::rasterize::draw_line has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_termview::rasterize::rasterize_grid_line (cognitive 18) crates/termview/src/rasterize.rs:494— vcad_termview::rasterize::rasterize_grid_line has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 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.
vcad_termview::rasterize::draw_tiny_char (cognitive 18) crates/termview/src/rasterize.rs:672— vcad_termview::rasterize::draw_tiny_char has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_termview::output::buffer_to_halfblock (cognitive 16) crates/termview/src/output.rs:202— vcad_termview::output::buffer_to_halfblock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (GraphicsOutput::display_halfblock) 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×6
Edited copy of a member (28 corresponding lines) crates/vcad-kernel-cam/src/operation.rs:238— crates/vcad-kernel-cam/src/operation.rs:238-285 | crates/vcad-kernel-cam/src/operation/contour.rs:285-329 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/termview/src/output.rs:103— crates/termview/src/output.rs:103-147 | crates/termview/src/output.rs:202-243 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/vcad-kernel-text/src/glyph.rs:72— crates/vcad-kernel-text/src/glyph.rs:72-99 | crates/vcad-kernel-text/src/glyph.rs:101-134 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/vcad-ecad-diff/src/design.rs:151— crates/vcad-ecad-diff/src/design.rs:151-178 | crates/vcad-kernel-constraints/src/symbolic.rs:186-229 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/vcad-ffi/src/lib.rs:481— crates/vcad-ffi/src/lib.rs:481-512 | crates/vcad-ffi/src/lib.rs:550-577 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/vcad-kernel-tessellate/src/clearance.rs:613— crates/vcad-kernel-tessellate/src/clearance.rs:613-641 | crates/vcad-kernel-tessellate/src/clearance.rs:688-715 — These two members are one piece of code written twice and then edited apart: 28 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 (5 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/vcad-eval/src/evaluate.rs:2685— crates/vcad-eval/src/evaluate.rs:2685-2738 | crates/vcad-eval/src/kinematics.rs:22-37 | crates/vcad-ffi/src/lib.rs:820-830 | crates/vcad-kernel-assembly/src/pose.rs:44-70 | crates/vcad-typst/src/lib.rs:228-252 — 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) crates/vcad-kernel-acoustics/src/optimize.rs:57— crates/vcad-kernel-acoustics/src/optimize.rs:57-141 | crates/vcad-kernel-optics/src/optimize.rs:61-166 | crates/vcad-kernel-particle/src/optimize.rs:60-148 | crates/vcad-kernel-particle/src/optimize.rs:163-226 | crates/vcad-kernel-particle/src/optimize.rs:339-442 — 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) crates/vcad-kernel-fea/src/mesh.rs:124— crates/vcad-kernel-fea/src/mesh.rs:124-219 | crates/vcad-kernel-fea/src/mesh.rs:415-512 | crates/vcad-kernel-fea/src/mesh.rs:556-655 | crates/vcad-kernel-tessellate/src/clearance.rs:140-176 | crates/vcad-kernel-topopt/src/domain.rs:89-168 — 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) crates/vcad-kernel-gpu/src/decimate.rs:351— crates/vcad-kernel-gpu/src/decimate.rs:351-369 | crates/vcad-kernel-gpu/src/normals.rs:30-276 | crates/vcad-kernel-gpu/src/wavefront.rs:101-341 | crates/vcad-kernel-gpu/src/wavefront.rs:371-696 | crates/vcad-kernel-gpu/src/wavefront.rs:698-715 — 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) crates/vcad-kernel-sketch/src/extrude.rs:977— crates/vcad-kernel-sketch/src/extrude.rs:977-993 | crates/vcad-kernel-sketch/src/extrude.rs:1273-1315 | crates/vcad-kernel-sketch/src/extrude.rs:1421-1459 | crates/vcad-kernel-sweep/src/loft.rs:253-289 | crates/vcad-kernel-sweep/src/sweep.rs:348-393 — 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) crates/vcad-kernel-tessellate/src/lib.rs:5145— crates/vcad-kernel-tessellate/src/lib.rs:5145-5300 | crates/vcad-kernel-tessellate/src/lib.rs:5928-6105 | crates/vcad-kernel-tessellate/src/lib.rs:6115-6255 | crates/vcad-kernel-tessellate/src/lib.rs:6329-6526 | crates/vcad-kernel-tessellate/src/lib.rs:6715-6790 — 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.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×6
Edited copies of one member (3 members, 16+ corresponding lines) crates/vcad-ffi/src/engine.rs:131— crates/vcad-ffi/src/engine.rs:131-146 | crates/vcad-ffi/src/engine.rs:154-173 | crates/vcad-ffi/src/engine.rs:325-344 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/vcad-kernel-sketch/src/extrude.rs:1461— crates/vcad-kernel-sketch/src/extrude.rs:1461-1476 | crates/vcad-kernel-sketch/src/revolve.rs:635-655 | crates/vcad-kernel-sweep/src/loft.rs:291-306 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/vcad-ecad-pcb/src/router/sco.rs:916— crates/vcad-ecad-pcb/src/router/sco.rs:916-931 | crates/vcad-kernel-acoustics/src/instrument.rs:458-473 | crates/vcad-kernel-fea/src/modal.rs:291-306 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/vcad-eval/src/thermal_extract.rs:598— crates/vcad-eval/src/thermal_extract.rs:598-613 | crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:133-148 | crates/vcad-slicer-bambu/src/job.rs:91-113 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/vcad-kernel-neutronics/src/materials.rs:389— crates/vcad-kernel-neutronics/src/materials.rs:389-404 | crates/vcad-kernel-neutronics/src/materials.rs:410-425 | crates/vcad-kernel-neutronics/src/materials.rs:428-443 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/vcad-ffi/src/clearance.rs:253— crates/vcad-ffi/src/clearance.rs:253-268 | crates/vcad-ffi/src/dfm.rs:429-444 | crates/vcad-ffi/src/fea.rs:619-636 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×6
Edited copy of a member (18 corresponding lines) crates/vcad-kernel-acoustics/src/strike.rs:204— crates/vcad-kernel-acoustics/src/strike.rs:204-221 | crates/vcad-kernel-fea/src/modal.rs:270-289 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/vcad-parts/src/fasteners/nut_hex.rs:47— crates/vcad-parts/src/fasteners/nut_hex.rs:47-64 | crates/vcad-parts/src/fasteners/washer_flat.rs:53-72 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/vcad-kernel-step/src/entities/geometry.rs:11— crates/vcad-kernel-step/src/entities/geometry.rs:11-28 | crates/vcad-kernel-step/src/entities/geometry.rs:33-53 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/termview/src/protocols/sixel.rs:159— crates/termview/src/protocols/sixel.rs:159-176 | crates/vcad-embroidery-pes/src/palette.rs:22-40 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/vcad-ecad-pcb/src/router/auto.rs:3861— crates/vcad-ecad-pcb/src/router/auto.rs:3861-3878 | crates/vcad-ecad-pcb/src/session.rs:945-967 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/vcad-ir/src/expr_parser.rs:359— crates/vcad-ir/src/expr_parser.rs:359-376 | crates/vcad-ir/src/expr_parser.rs:378-396 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×6
Edited copy of a member (1 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1908— apple/VcadApp/Sources/VcadApp/Editor.swift:1908-1908 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1908-1908 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) apple/VcadApp/Sources/VcadApp/AnalysisPanel.swift:37— apple/VcadApp/Sources/VcadApp/AnalysisPanel.swift:37-37 | apple/VcadApp/Sources/VcadApp/FabricatePanel.swift:129-129 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:250— apple/VcadApp/Sources/VcadApp/Editor.swift:250-250 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:250-250 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:251— apple/VcadApp/Sources/VcadApp/Editor.swift:251-251 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:251-251 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:252— apple/VcadApp/Sources/VcadApp/Editor.swift:252-252 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:252-252 — These two members are one piece of code written twice and then edited apart: 1 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 (1 corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1080— apple/VcadApp/Sources/VcadApp/Editor.swift:1080-1080 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1080-1080 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (10–11 lines × 2) crates/vcad-eval/src/evaluate.rs:2433— crates/vcad-eval/src/evaluate.rs:2433-2442 | crates/vcad-kernel-wasm/src/lib.rs:2280-2290 — before extracting anything, compare `crates/vcad-eval/src/evaluate.rs` and `crates/vcad-kernel-wasm/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 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–11 lines × 2) crates/vcad-eval/src/evaluate.rs:3487— crates/vcad-eval/src/evaluate.rs:3487-3496 | crates/vcad-kernel-drafting/src/section.rs:352-362 — 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) crates/vcad-kernel-flow/src/adjoint.rs:525— crates/vcad-kernel-flow/src/adjoint.rs:525-535 | crates/vcad-kernel-flow/src/adjoint.rs:650-659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:525` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) crates/vcad-kernel-particle/src/wire3d.rs:604— crates/vcad-kernel-particle/src/wire3d.rs:604-614 | crates/vcad-kernel-tessellate/src/clearance.rs:462-471 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-particle/src/wire3d.rs:604` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/vcad-kernel-tessellate/src/clearance.rs:327— crates/vcad-kernel-tessellate/src/clearance.rs:327-336 | crates/vcad-kernel-tessellate/src/clearance.rs:338-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/clearance.rs:338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:6744— crates/vcad-kernel-wasm/src/lib.rs:6744-6753 | crates/vcad-kernel-wasm/src/lib.rs:6780-6790 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:6744` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crates/vcad-kernel-booleans/src/split.rs:2938— crates/vcad-kernel-booleans/src/split.rs:2938-2945 | crates/vcad-kernel-booleans/src/split.rs:7181-7188 | crates/vcad-kernel-booleans/src/split.rs:7226-7233 | crates/vcad-kernel-booleans/src/trim.rs:1068-1075 — before extracting anything, compare `crates/vcad-kernel-booleans/src/split.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:2938` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crates/vcad-kernel-booleans/src/trim.rs:436— crates/vcad-kernel-booleans/src/trim.rs:436-443 | crates/vcad-kernel-booleans/src/trim.rs:558-565 | crates/vcad-kernel-booleans/src/trim.rs:612-619 | crates/vcad-kernel-booleans/src/trim.rs:656-663 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/trim.rs:436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-booleans/src/trim.rs:435` calls `unwrap_cylindrical_loop` and `crates/vcad-kernel-booleans/src/trim.rs:655` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) crates/vcad-kernel-qcd/src/analysis.rs:147— crates/vcad-kernel-qcd/src/analysis.rs:147-154 | crates/vcad-kernel-shell/src/lib.rs:955-962 | crates/vcad-kernel-tessellate/src/frozen.rs:745-752 | crates/vcad-render/src/callouts.rs:268-275 — 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 (8 lines × 4) crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:60— crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:60-70 | crates/vcad-kernel-raytrace/src/intersect/torus.rs:67-77 | crates/vcad-kernel-raytrace/src/trim.rs:784-791 | crates/vcad-kernel-raytrace/src/trim.rs:874-881 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `torus` to `&TorusSurface` in one and `&vcad_kernel_geom::TorusSurface` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-raytrace/src/intersect/torus.rs:78` calls `norm` and `crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:71` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) crates/vcad-kernel-booleans/src/api.rs:838— crates/vcad-kernel-booleans/src/api.rs:838-845 | crates/vcad-kernel-booleans/src/pipeline.rs:2219-2226 | crates/vcad-kernel-booleans/src/validate.rs:112-119 | crates/vcad-kernel-booleans/src/validate.rs:128-135 — before extracting anything, compare `crates/vcad-kernel-booleans/src/api.rs` and `crates/vcad-kernel-booleans/src/validate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/api.rs:838` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:42— apple/VcadApp/Sources/VcadApp/Editor.swift:42-49 | apple/VcadApp/Sources/VcadApp/Editor.swift:50-57 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:42-49 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:50-57 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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–8 lines × 2) crates/vcad-ecad-pcb/src/router/length_match.rs:181— crates/vcad-ecad-pcb/src/router/length_match.rs:181-188 | crates/vcad-ecad-pcb/src/router/length_match.rs:799-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/length_match.rs:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:557— crates/vcad-kernel-booleans/src/mesh/csg.rs:557-564 | crates/vcad-kernel-booleans/src/mesh/csg.rs:574-580 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-cam/src/dropcutter/mesh_accel.rs:74— crates/vcad-kernel-cam/src/dropcutter/mesh_accel.rs:74-81 | crates/vcad-kernel-drafting/src/edge_extract.rs:461-467 — 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) crates/vcad-kernel-tessellate/src/lib.rs:2350— crates/vcad-kernel-tessellate/src/lib.rs:2350-2356 | crates/vcad-kernel-tessellate/src/lib.rs:2399-2406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:2399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:7159— crates/vcad-kernel-tessellate/src/lib.rs:7159-7166 | crates/vcad-kernel-tessellate/src/lib.rs:7200-7206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:7159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) crates/vcad-ecad-symbols/src/kicad_board.rs:42— crates/vcad-ecad-symbols/src/kicad_board.rs:42-48 | crates/vcad-ecad-symbols/src/kicad_board.rs:78-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 3) crates/vcad-kernel-booleans/src/cyl_cyl.rs:62— crates/vcad-kernel-booleans/src/cyl_cyl.rs:62-66 | crates/vcad-kernel-booleans/src/split.rs:5601-5605 | crates/vcad-kernel-booleans/src/split.rs:6105-6108 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/cyl_cyl.rs:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `brep` to `&BRepSolid` in one and `&mut BRepSolid` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (4–5 lines × 3) crates/vcad-kernel-constraints/src/symbolic.rs:287— crates/vcad-kernel-constraints/src/symbolic.rs:287-292 | crates/vcad-kernel-constraints/src/symbolic.rs:407-411 | crates/vcad-kernel-constraints/src/symbolic.rs:467-470 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-constraints/src/symbolic.rs:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 3) crates/vcad-kernel-em/src/axisym.rs:359— crates/vcad-kernel-em/src/axisym.rs:359-362 | crates/vcad-kernel-em/src/axisym.rs:376-380 | crates/vcad-kernel-em/src/axisym.rs:401-405 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 3) crates/vcad-kernel-optics/src/paraxial.rs:33— crates/vcad-kernel-optics/src/paraxial.rs:33-37 | crates/vcad-kernel-optics/src/paraxial.rs:50-54 | crates/vcad-kernel-optics/src/paraxial.rs:113-116 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-optics/src/paraxial.rs:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 3) crates/vcad-kernel-raytrace/src/cpu.rs:194— crates/vcad-kernel-raytrace/src/cpu.rs:194-203 | crates/vcad-kernel-raytrace/src/cpu.rs:371-374 | crates/vcad-kernel-raytrace/src/cpu.rs:524-528 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/cpu.rs:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 3) crates/vcad-loon/src/convert.rs:436— crates/vcad-loon/src/convert.rs:436-439 | crates/vcad-loon/src/convert.rs:674-678 | crates/vcad-loon/src/convert.rs:699-703 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-loon/src/convert.rs:674` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-loon/src/convert.rs:678` calls `str_val` and `crates/vcad-loon/src/convert.rs:439` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
AC3 · Page structure· Page without a main landmark · ×5
Page without a main landmark packages/app/public/launch/index.html:14— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark packages/app/public/splashscreen.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark packages/mcp/viewer-app/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark REDACTED:6— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark REDACTED:6— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
vcad_kernel::turning_profile::turning_profile (cyclomatic 95) crates/vcad-kernel/src/turning_profile.rs:195— vcad_kernel::turning_profile::turning_profile has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vcad_kernel::hull::convex_hull (cyclomatic 26) crates/vcad-kernel/src/hull.rs:64— vcad_kernel::hull::convex_hull has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel::sheet_fold::folded_sheet_solid (cyclomatic 21) crates/vcad-kernel/src/sheet_fold.rs:59— vcad_kernel::sheet_fold::folded_sheet_solid 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.
vcad_kernel::sheet_json::tessellate_model (cyclomatic 17) crates/vcad-kernel/src/sheet_json.rs:860— vcad_kernel::sheet_json::tessellate_model has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel::fillet_aabb_is_reasonable (cyclomatic 16) crates/vcad-kernel/src/lib.rs:2731— vcad_kernel::fillet_aabb_is_reasonable 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.
vcad_kernel_drafting::features::detect_circles (cyclomatic 28) crates/vcad-kernel-drafting/src/features.rs:51— vcad_kernel_drafting::features::detect_circles 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.
vcad_kernel_drafting::dxf::sheet_to_dxf (cyclomatic 26) crates/vcad-kernel-drafting/src/dxf.rs:192— vcad_kernel_drafting::dxf::sheet_to_dxf has cyclomatic complexity 26 (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.
vcad_kernel_drafting::section::intersect_triangle_with_plane (cyclomatic 21) crates/vcad-kernel-drafting/src/section.rs:32— vcad_kernel_drafting::section::intersect_triangle_with_plane 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.
vcad_kernel_drafting::hidden_line::merge_collinear (cyclomatic 19) crates/vcad-kernel-drafting/src/hidden_line.rs:84— vcad_kernel_drafting::hidden_line::merge_collinear has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (subtract, union). 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.
vcad_kernel_drafting::section::chain_segments (cyclomatic 17) crates/vcad-kernel-drafting/src/section.rs:222— vcad_kernel_drafting::section::chain_segments 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.
vcad_kernel_cam::turning::verify::verify_gcode (cognitive 130) crates/vcad-kernel-cam/src/turning/verify.rs:476— vcad_kernel_cam::turning::verify::verify_gcode has cognitive complexity 130 (threshold 15). Drivers by points: if/else 28 (87 pts), loops 13 (32 pts), boolean chains 10, match/switch 1 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_cam::turning::rotary::verify_rotary_gcode (cognitive 104) crates/vcad-kernel-cam/src/turning/rotary.rs:597— vcad_kernel_cam::turning::rotary::verify_rotary_gcode has cognitive complexity 104 (threshold 15). Drivers by points: if/else 27 (66 pts), match/switch 6 (20 pts), loops 8 (15 pts), boolean chains 3 (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.
vcad_kernel_cam::turning::verify::parse (cognitive 88) crates/vcad-kernel-cam/src/turning/verify.rs:153— vcad_kernel_cam::turning::verify::parse has cognitive complexity 88 (threshold 15). Drivers by points: if/else 19 (43 pts), match/switch 8 (24 pts), loops 6 (11 pts), boolean chains 10 (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.
vcad_kernel_cam::turning::rotary::plan_rotary (cognitive 63) crates/vcad-kernel-cam/src/turning/rotary.rs:250— vcad_kernel_cam::turning::rotary::plan_rotary has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 9 (19 pts), boolean chains 5 (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.
vcad_kernel_cam::turning::verify::hull_vs_part (cognitive 19) crates/vcad-kernel-cam/src/turning/verify.rs:420— vcad_kernel_cam::turning::verify::hull_vs_part has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), boolean chains 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.
InteractiveRouter::shortest_path (cognitive 76) crates/vcad-ecad-fabprep/src/verdict.rs:772— InteractiveRouter::shortest_path has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (47 pts), loops 12 (21 pts), boolean chains 8 (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.
InteractiveRouter::route (cognitive 21) crates/vcad-ecad-fabprep/src/verdict.rs:612— InteractiveRouter::route has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InteractiveRouter::shove_moves (cognitive 20) crates/vcad-ecad-fabprep/src/verdict.rs:1227— InteractiveRouter::shove_moves has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 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.
InteractiveRouter::tighten (cognitive 17) crates/vcad-ecad-fabprep/src/verdict.rs:1028— InteractiveRouter::tighten has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 4 (7 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.
InteractiveRouter::shove_victims (cognitive 17) crates/vcad-ecad-fabprep/src/verdict.rs:1173— InteractiveRouter::shove_victims has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, 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.
vcad_kernel_sketch::revolve::revolve (cognitive 42) crates/vcad-kernel-sketch/src/revolve.rs:60— vcad_kernel_sketch::revolve::revolve has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 6 (11 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_sketch::extrude::extrude_with_arcs (cognitive 33) crates/vcad-kernel-sketch/src/extrude.rs:552— vcad_kernel_sketch::extrude::extrude_with_arcs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 6 (10 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_sketch::extrude::extrude_with_options (cognitive 21) crates/vcad-kernel-sketch/src/extrude.rs:1071— vcad_kernel_sketch::extrude::extrude_with_options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 6). 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.
vcad_kernel_sketch::extrude::extrude_with_holes (cognitive 20) crates/vcad-kernel-sketch/src/extrude.rs:774— vcad_kernel_sketch::extrude::extrude_with_holes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 7 (9 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.
vcad_kernel_sketch::extrude::detect_axial_full_circle (cognitive 19) crates/vcad-kernel-sketch/src/extrude.rs:378— vcad_kernel_sketch::extrude::detect_axial_full_circle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (3 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.
Solid::resolve_face (cognitive 34) crates/vcad-kernel/src/lib.rs:1565— Solid::resolve_face has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 3 (6 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.
Solid::text_extrude (cognitive 30) crates/vcad-kernel-wasm/src/lib.rs:2220— Solid::text_extrude has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (10 pts), boolean chains 2, match/switch 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.
Solid::fillet_reported (cognitive 26) crates/vcad-kernel/src/lib.rs:1009— Solid::fillet_reported has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Solid::apply_transform (cognitive 21) crates/vcad-kernel/src/lib.rs:1968— Solid::apply_transform has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (12 pts), match/switch 2 (5 pts), if/else 2 (4 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Solid::edge_blend_reported (cognitive 17) crates/vcad-kernel/src/lib.rs:1174— Solid::edge_blend_reported has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (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.
vcad_kernel_raytrace::intersect::cone::intersect_cone (cognitive 24) crates/vcad-kernel-raytrace/src/intersect/cone.rs:13— vcad_kernel_raytrace::intersect::cone::intersect_cone has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
vcad_kernel_raytrace::cpu::render_scene_samples (cognitive 20) crates/vcad-kernel-raytrace/src/cpu.rs:474— vcad_kernel_raytrace::cpu::render_scene_samples has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (11 pts), match/switch 1 (5 pts), if/else 2 (4 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_raytrace::intersect::intersect_surface (cognitive 19) crates/vcad-kernel-raytrace/src/intersect/mod.rs:85— vcad_kernel_raytrace::intersect::intersect_surface has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 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.
vcad_kernel_raytrace::trim::repair_pole_vertices (cognitive 16) crates/vcad-kernel-raytrace/src/trim.rs:447— vcad_kernel_raytrace::trim::repair_pole_vertices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 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.
vcad_kernel_raytrace::trim::synthesize_planar_cap_polygon (cognitive 16) crates/vcad-kernel-raytrace/src/trim.rs:612— vcad_kernel_raytrace::trim::synthesize_planar_cap_polygon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×5
Edited copy of a member (40 corresponding lines) crates/vcad-slicer/src/path.rs:298— crates/vcad-slicer/src/path.rs:298-339 | crates/vcad-slicer/src/path.rs:342-381 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) crates/vcad-kernel-constraints/src/residual.rs:310— crates/vcad-kernel-constraints/src/residual.rs:310-349 | crates/vcad-kernel-constraints/src/symbolic.rs:541-580 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) crates/vcad-kernel-acoustics/src/linalg.rs:42— crates/vcad-kernel-acoustics/src/linalg.rs:42-81 | crates/vcad-kernel-antenna/src/linalg.rs:61-101 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) crates/vcad-kernel-cam/src/dropcutter/ball.rs:82— crates/vcad-kernel-cam/src/dropcutter/ball.rs:82-121 | crates/vcad-kernel-cam/src/dropcutter/bull.rs:195-235 — These two members are one piece of code written twice and then edited apart: 40 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 (40 corresponding lines) crates/vcad-kernel-fillet/src/closest_point.rs:130— crates/vcad-kernel-fillet/src/closest_point.rs:130-169 | crates/vcad-kernel-raytrace/src/trim.rs:905-945 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×5
Edited copy of a member (20 corresponding lines) crates/vcad-ecad-symbols/src/altium/binary.rs:297— crates/vcad-ecad-symbols/src/altium/binary.rs:297-316 | crates/vcad-ecad-symbols/src/altium/binary.rs:392-411 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/vcad-parts/src/vacuum/instruments.rs:91— crates/vcad-parts/src/vacuum/instruments.rs:91-113 | crates/vcad-parts/src/vacuum/instruments.rs:593-612 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:234— crates/vcad-kernel-drafting/src/dimension/geometry_ref.rs:234-253 | crates/vcad-kernel-drafting/src/section.rs:615-636 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:50— crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:50-80 | crates/vcad-ecad-pcb/src/router/gpu_bridge.rs:84-103 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/vcad-kernel-drafting/src/sheet.rs:327— crates/vcad-kernel-drafting/src/sheet.rs:327-346 | crates/vcad-kernel-drafting/src/sheet.rs:416-435 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (28 lines × 2) crates/termview/src/output.rs:107— crates/termview/src/output.rs:107-134 | crates/termview/src/output.rs:205-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/termview/src/output.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4747— apple/VcadApp/Sources/VcadApp/Editor.swift:4747-4774 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4747-4774 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:4747` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28 lines × 2) apple/VcadApp/Sources/VcadApp/IntentBar.swift:46— apple/VcadApp/Sources/VcadApp/IntentBar.swift:46-73 | apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift:46-73 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/IntentBar.swift` and `apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 142 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 (28 lines × 2) apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:147— apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:147-174 | apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift:147-174 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift` and `apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 (28 lines × 2) apple/VcadApp/Sources/VcadApp/Document.swift:674— apple/VcadApp/Sources/VcadApp/Document.swift:674-701 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:674-701 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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) crates/vcad-ecad-pcb/src/router/auto.rs:3483— crates/vcad-ecad-pcb/src/router/auto.rs:3483-3509 | crates/vcad-ecad-pcb/src/router/auto.rs:3511-3537 — both copies are in the same file, so extract the block into 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 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:8867— crates/vcad-kernel-tessellate/src/lib.rs:8867-8893 | crates/vcad-kernel-tessellate/src/lib.rs:8947-8973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:8867` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:5733— crates/vcad-kernel-tessellate/src/lib.rs:5733-5759 | crates/vcad-kernel-tessellate/src/lib.rs:7833-7859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5733` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1472— apple/VcadApp/Sources/VcadApp/Editor.swift:1472-1498 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1472-1498 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:4179— apple/VcadApp/Sources/VcadApp/Editor.swift:4179-4205 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4179-4205 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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–14 lines × 2) crates/vcad-ecad-pcb/src/ratsnest.rs:211— crates/vcad-ecad-pcb/src/ratsnest.rs:211-224 | crates/vcad-ecad-pcb/src/router/islands.rs:240-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/ratsnest.rs:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5460— crates/vcad-kernel-booleans/src/split.rs:5460-5473 | crates/vcad-kernel-booleans/src/split.rs:5634-5646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:5460` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) crates/vcad-slicer/src/path.rs:299— crates/vcad-slicer/src/path.rs:299-312 | crates/vcad-slicer/src/path.rs:343-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-slicer/src/path.rs:299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/vcad-loon/src/convert.rs:34— crates/vcad-loon/src/convert.rs:34-47 | crates/vcad-loon/src/convert.rs:211-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-loon/src/convert.rs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/vcad-ir/src/vcode.rs:1484— crates/vcad-ir/src/vcode.rs:1484-1496 | crates/vcad-ir/src/vcode.rs:1512-1525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1484` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crates/vcad-ecad-export/src/gerber.rs:945— crates/vcad-ecad-export/src/gerber.rs:945-957 | crates/vcad-ecad-export/src/gerber.rs:986-999 | crates/vcad-ecad-export/src/gerber.rs:1021-1033 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-export/src/gerber.rs:945` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crates/vcad-ecad-pcb/src/router/legalize.rs:492— crates/vcad-ecad-pcb/src/router/legalize.rs:492-504 | crates/vcad-kernel-shell/src/lib.rs:732-744 | crates/vcad-render/src/lib.rs:1619-1631 — 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) crates/vcad-kernel-neutronics/src/rng.rs:55— crates/vcad-kernel-neutronics/src/rng.rs:55-67 | crates/vcad-kernel-qcd/src/rng.rs:39-51 | crates/vcad-kernel-tolerance/src/rng.rs:48-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 3) crates/vcad-kernel-gpu/src/decimate.rs:116— crates/vcad-kernel-gpu/src/decimate.rs:116-129 | crates/vcad-kernel-gpu/src/normals.rs:76-89 | crates/vcad-kernel-gpu/src/wavefront.rs:153-165 — before extracting anything, compare `crates/vcad-kernel-gpu/src/decimate.rs` and `crates/vcad-kernel-gpu/src/normals.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-gpu/src/decimate.rs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crates/vcad-cli/src/repl.rs:196— crates/vcad-cli/src/repl.rs:196-209 | crates/vcad-cli/src/repl.rs:222-234 | crates/vcad-cli/src/repl.rs:247-259 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/repl.rs:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) crates/vcad-ir/src/vcode.rs:1096— crates/vcad-ir/src/vcode.rs:1096-1104 | crates/vcad-ir/src/vcode.rs:1202-1210 | crates/vcad-ir/src/vcode.rs:1234-1242 | crates/vcad-ir/src/vcode.rs:1260-1268 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1096` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) crates/vcad-kernel-tessellate/src/lib.rs:841— crates/vcad-kernel-tessellate/src/lib.rs:841-849 | crates/vcad-kernel-tessellate/src/lib.rs:947-955 | crates/vcad-kernel-tessellate/src/lib.rs:1792-1800 | crates/vcad-kernel-tessellate/src/lib.rs:8724-8732 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `mesh` to `&TriangleMesh` in one and `&mut TriangleMesh` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-tessellate/src/lib.rs:8723` calls `drop_exact_duplicate_triangles` and `crates/vcad-kernel-tessellate/src/lib.rs:839` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) crates/vcad-kernel-acoustics/src/receipt.rs:88— crates/vcad-kernel-acoustics/src/receipt.rs:88-96 | crates/vcad-kernel-antenna/src/receipt.rs:102-110 | crates/vcad-kernel-em/src/receipt.rs:78-86 | crates/vcad-kernel-photonics/src/receipt.rs:162-170 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-antenna/src/receipt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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) crates/vcad-ir/src/vcode.rs:2481— crates/vcad-ir/src/vcode.rs:2481-2489 | crates/vcad-ir/src/vcode.rs:2492-2500 | crates/vcad-ir/src/vcode.rs:2503-2511 | crates/vcad-ir/src/vcode.rs:2701-2710 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:2785— apple/VcadApp/Sources/VcadApp/Editor.swift:2785-2793 | apple/VcadApp/Sources/VcadApp/Editor.swift:4725-4733 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2785-2793 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4725-4733 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:2785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) crates/vcad-ecad-sim/src/circuit/ac.rs:176— crates/vcad-ecad-sim/src/circuit/ac.rs:176-182 | crates/vcad-ecad-sim/src/circuit/linalg.rs:56-62 | crates/vcad-kernel-acoustics/src/instrument.rs:612-618 | crates/vcad-kernel-fea/src/modal.rs:299-305 — before extracting anything, compare `crates/vcad-ecad-sim/src/circuit/ac.rs` and `crates/vcad-ecad-sim/src/circuit/linalg.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&mut [Cplx]` in one and `&mut [f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 4) crates/vcad-kernel-acoustics/src/optimize.rs:67— crates/vcad-kernel-acoustics/src/optimize.rs:67-73 | crates/vcad-kernel-optics/src/optimize.rs:71-77 | crates/vcad-kernel-particle/src/optimize.rs:70-76 | crates/vcad-kernel-particle/src/optimize.rs:173-179 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-optics/src/optimize.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:67` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 4) crates/vcad-torture/src/lib.rs:410— crates/vcad-torture/src/lib.rs:410-416 | crates/vcad-torture/src/lib.rs:459-465 | crates/vcad-torture/src/lib.rs:473-479 | crates/vcad-torture/src/lib.rs:487-493 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-torture/src/lib.rs:410` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-torture/src/lib.rs:407` calls `tangent_cases`, `iter`, `enumerate` and `crates/vcad-torture/src/lib.rs:457` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) apple/VcadApp/Sources/VcadApp/Document.swift:505— apple/VcadApp/Sources/VcadApp/Document.swift:505-511 | apple/VcadApp/Sources/VcadApp/Document.swift:535-541 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:505-511 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:535-541 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Document.swift:505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:187— apple/VcadApp/Sources/VcadApp/Editor.swift:187-193 | apple/VcadApp/Sources/VcadApp/Editor.swift:196-202 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:187-193 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:196-202 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (6 lines × 4) crates/vcad-kernel-booleans/src/split.rs:1441— crates/vcad-kernel-booleans/src/split.rs:1441-1446 | crates/vcad-kernel-booleans/src/split.rs:1580-1585 | crates/vcad-kernel-booleans/src/split.rs:1854-1861 | crates/vcad-kernel-booleans/src/split.rs:2184-2189 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) crates/vcad-kernel-tessellate/src/lib.rs:6001— crates/vcad-kernel-tessellate/src/lib.rs:6001-6006 | crates/vcad-kernel-tessellate/src/lib.rs:6061-6066 | crates/vcad-kernel-tessellate/src/lib.rs:6130-6135 | crates/vcad-kernel-tessellate/src/lib.rs:6170-6175 — 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 (6 lines × 4) crates/vcad-ffi/src/engine.rs:62— crates/vcad-ffi/src/engine.rs:62-67 | crates/vcad-ffi/src/engine.rs:132-137 | crates/vcad-ffi/src/engine.rs:218-223 | crates/vcad-ffi/src/engine.rs:277-282 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/engine.rs:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) crates/vcad-eval/src/kinematics.rs:32— crates/vcad-eval/src/kinematics.rs:32-37 | crates/vcad-eval/src/placement.rs:72-77 | crates/vcad-ffi/src/lib.rs:825-830 | crates/vcad-loon/src/convert.rs:3238-3243 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/kinematics.rs:32` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:798— apple/VcadApp/Sources/VcadApp/Editor.swift:798-803 | apple/VcadApp/Sources/VcadApp/Sim.swift:60-65 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:798-803 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:60-65 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:21— apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift:21-41 | apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift:21-41 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReceiptLedger.swift` and `apple/VcadVision/Sources/VcadVision/Shared/ReceiptLedger.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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) apple/VcadApp/Sources/VcadApp/SimController.swift:318— apple/VcadApp/Sources/VcadApp/SimController.swift:318-338 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:318-338 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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) apple/VcadApp/Sources/VcadApp/SimPanel.swift:237— apple/VcadApp/Sources/VcadApp/SimPanel.swift:237-257 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:237-257 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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) apple/VcadApp/Sources/VcadApp/Editor.swift:2843— apple/VcadApp/Sources/VcadApp/Editor.swift:2843-2863 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2843-2863 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3952— apple/VcadApp/Sources/VcadApp/Editor.swift:3952-3972 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3952-3972 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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.
IC1 · Incompleteness & stubs· Empty method body · ×5
Empty method body — does nothing with its inputs crates/vcad-cli/src/chat_session.rs:31— `push_user_message` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/vcad-cli/src/chat_session.rs:41— `drain_chat_events` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/vcad-i18n/src/lib.rs:15— `init` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/vcad-kernel-sheet/src/dxf.rs:207— `write_layer` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/vcad-kernel-sheet/src/dxf.rs:233— `write_line` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Duplicated block (31 lines × 2 locations) packages/app/public/launch/launch.js:481— packages/app/public/launch/launch.js:481 · www/public/kit/gallery.js:666 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (31 lines × 2 locations) packages/app/src/components/PropertyPanel.tsx:1085— packages/app/src/components/PropertyPanel.tsx:1085 · packages/app/src/components/PropertyPanel.tsx:1271 — 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 (31 lines × 2 locations) packages/app/src/components/StatusBar.tsx:331— packages/app/src/components/StatusBar.tsx:331 · packages/app/src/components/footer/RaytraceChip.tsx:140 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (31 lines × 2 locations) packages/app/src/components/ui/notifications/Toast.tsx:50— packages/app/src/components/ui/notifications/Toast.tsx:50 · packages/app/src/components/ui/notifications/WarningCard.tsx:61 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (31 lines × 2 locations) packages/mcp/src/tools/import-pcb.ts:64— packages/mcp/src/tools/import-pcb.ts:64 · packages/mcp/src/tools/import-pcb.ts:97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×4
Heading level jumps from h1 to h3 packages/docs/src/app/gallery/page.tsx:89— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 packages/docs/src/app/guides/[...slug]/page.tsx:83— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 packages/docs/src/app/reference/[...slug]/page.tsx:83— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 packages/docs/src/app/tutorials/[...slug]/page.tsx:105— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×4
Animation without a prefers-reduced-motion guard packages/app/public/auth/popup.html:116— `.progress .bar` moves (`animation: slide 1.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard packages/app/public/splashscreen.html:94— `.bar::after` moves (`animation: slide 1.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard packages/app/src/components/Splash.tsx:132— <div> moves — its `animate-[splash-slide_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard packages/app/src/components/footer/KernelPulseChip.tsx:74— <span> moves — its inline style sets `animation: vcad-pulse ${pulseDur.toFixed(2)}s cubic-bezier(0.4, 0, 0.6, 1) infinite` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
vcad_kernel_cam::turning::verify::parse (cyclomatic 70) crates/vcad-kernel-cam/src/turning/verify.rs:153— vcad_kernel_cam::turning::verify::parse has cyclomatic complexity 70 (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.
vcad_kernel_cam::turning::rotary::verify_rotary_gcode (cyclomatic 60) crates/vcad-kernel-cam/src/turning/rotary.rs:597— vcad_kernel_cam::turning::rotary::verify_rotary_gcode 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.
vcad_kernel_cam::turning::verify::verify_gcode (cyclomatic 51) crates/vcad-kernel-cam/src/turning/verify.rs:476— vcad_kernel_cam::turning::verify::verify_gcode 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.
vcad_kernel_cam::turning::rotary::plan_rotary (cyclomatic 32) crates/vcad-kernel-cam/src/turning/rotary.rs:250— vcad_kernel_cam::turning::rotary::plan_rotary 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.
vcad_kernel_flow::solve::solve_steady (cyclomatic 64) crates/vcad-kernel-flow/src/solve.rs:172— vcad_kernel_flow::solve::solve_steady 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.
vcad_kernel_flow::adjoint::pressure_drop_gradient (cyclomatic 52) crates/vcad-kernel-flow/src/adjoint.rs:368— vcad_kernel_flow::adjoint::pressure_drop_gradient 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.
vcad_kernel_flow::adjoint::forward (cyclomatic 41) crates/vcad-kernel-flow/src/adjoint.rs:125— vcad_kernel_flow::adjoint::forward 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.
vcad_kernel_flow::solve::finish (cyclomatic 33) crates/vcad-kernel-flow/src/solve.rs:579— vcad_kernel_flow::solve::finish 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.
vcad_kernel_wasm::evaluate_node (cyclomatic 49) crates/vcad-kernel-wasm/src/lib.rs:4823— vcad_kernel_wasm::evaluate_node has cyclomatic complexity 49 (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.
vcad_kernel_wasm::photonics_simulate (cyclomatic 28) crates/vcad-kernel-wasm/src/lib.rs:10925— vcad_kernel_wasm::photonics_simulate 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.
vcad_kernel_wasm::em_simulate (cyclomatic 24) crates/vcad-kernel-wasm/src/lib.rs:10289— vcad_kernel_wasm::em_simulate 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.
vcad_kernel_wasm::circuit_sim::circuit_from_schematic_wasm (cyclomatic 18) crates/vcad-kernel-wasm/src/circuit_sim.rs:1012— vcad_kernel_wasm::circuit_sim::circuit_from_schematic_wasm 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.
vcad_kernel_acoustics::helmholtz::solve_driven (cyclomatic 45) crates/vcad-kernel-acoustics/src/helmholtz.rs:189— vcad_kernel_acoustics::helmholtz::solve_driven 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.
vcad_kernel_acoustics::instrument::tune_bar (cyclomatic 27) crates/vcad-kernel-acoustics/src/instrument.rs:775— vcad_kernel_acoustics::instrument::tune_bar 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.
vcad_kernel_acoustics::instrument::modal (cyclomatic 20) crates/vcad-kernel-acoustics/src/instrument.rs:325— vcad_kernel_acoustics::instrument::modal has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_acoustics::instrument::lowest_modes (cyclomatic 16) crates/vcad-kernel-acoustics/src/instrument.rs:545— vcad_kernel_acoustics::instrument::lowest_modes has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_shell::shell_brep_open (cyclomatic 37) crates/vcad-kernel-shell/src/lib.rs:436— vcad_kernel_shell::shell_brep_open 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.
vcad_kernel_shell::shell_brep_analytical (cyclomatic 32) crates/vcad-kernel-shell/src/lib.rs:136— vcad_kernel_shell::shell_brep_analytical 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.
vcad_kernel_shell::logical_faces (cyclomatic 24) crates/vcad-kernel-shell/src/lib.rs:692— vcad_kernel_shell::logical_faces has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
vcad_kernel_shell::compute_offset_vertex (cyclomatic 18) crates/vcad-kernel-shell/src/lib.rs:1027— vcad_kernel_shell::compute_offset_vertex 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.
PlanarMagnetostatics::build_system (cognitive 125) crates/vcad-kernel-em/src/planar.rs:306— PlanarMagnetostatics::build_system has cognitive complexity 125 (threshold 15). Drivers by points: if/else 27 (69 pts), loops 20 (53 pts), boolean chains 3 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanarMagnetostatics::solve_nonlinear (cognitive 34) crates/vcad-kernel-em/src/planar.rs:556— PlanarMagnetostatics::solve_nonlinear has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 5 (12 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.
PlanarMagnetostatics::material_cell_map (cognitive 17) crates/vcad-kernel-em/src/planar.rs:253— PlanarMagnetostatics::material_cell_map has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (PlanarMagnetostatics::sat_cells) 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.
PlanarMagnetostatics::sat_cells (cognitive 17) crates/vcad-kernel-em/src/planar.rs:280— PlanarMagnetostatics::sat_cells has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (PlanarMagnetostatics::material_cell_map) 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.
ResidualSystem::solve_lm (cognitive 108) crates/vcad-ecad-pcb/src/router/sco.rs:524— ResidualSystem::solve_lm has cognitive complexity 108 (threshold 15). Drivers by points: if/else 18 (53 pts), loops 15 (46 pts), boolean chains 5, match/switch 1 (4 pts) (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResidualSystem::solve_sqp (cognitive 58) crates/vcad-ecad-pcb/src/router/sco.rs:361— ResidualSystem::solve_sqp has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 7 (15 pts), boolean chains 7 (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.
ResidualSystem::compile_with (cognitive 30) crates/vcad-ecad-pcb/src/router/sco.rs:154— ResidualSystem::compile_with has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts), boolean chains 3, match/switch 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.
ResidualSystem::normal_eqs (cognitive 19) crates/vcad-ecad-pcb/src/router/sco.rs:303— ResidualSystem::normal_eqs has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (6 pts), boolean chains 1 (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.
vcad_kernel_em::ac::solve_complex (cognitive 46) crates/vcad-kernel-em/src/ac.rs:124— vcad_kernel_em::ac::solve_complex has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 3 (6 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.
vcad_kernel_em::adjoint::cell_nu_gradients (cognitive 22) crates/vcad-kernel-em/src/adjoint.rs:98— vcad_kernel_em::adjoint::cell_nu_gradients has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4 (10 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_em::adjoint::rotor_torque_gradients (cognitive 20) crates/vcad-kernel-em/src/adjoint.rs:274— vcad_kernel_em::adjoint::rotor_torque_gradients has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_em::receipt::compare (cognitive 18) crates/vcad-kernel-em/src/receipt.rs:366— vcad_kernel_em::receipt::compare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
PhysicsWorld::from_document_with_colliders (cognitive 44) crates/vcad-kernel-physics/src/world.rs:266— PhysicsWorld::from_document_with_colliders has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 9 (10 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.
PhysicsWorld::ground_contacts (cognitive 41) crates/vcad-kernel-physics/src/world.rs:968— PhysicsWorld::ground_contacts has cognitive complexity 41 (threshold 15). Drivers by points: loops 8 (25 pts), if/else 4 (11 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PhysicsWorld::step (cognitive 27) crates/vcad-kernel-physics/src/world.rs:774— PhysicsWorld::step has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (13 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.
PhysicsWorld::enforce_joint_limits (cognitive 18) crates/vcad-kernel-physics/src/world.rs:1072— PhysicsWorld::enforce_joint_limits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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.
vcad_kernel_naming::profile::seed_extrude_names (cognitive 40) crates/vcad-kernel-naming/src/profile.rs:53— vcad_kernel_naming::profile::seed_extrude_names has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 3 (9 pts), loops 5 (6 pts), boolean chains 3 (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.
vcad_kernel_naming::propagate_from (cognitive 25) crates/vcad-kernel-naming/src/lib.rs:316— vcad_kernel_naming::propagate_from has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 7 (10 pts), match/switch 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.
vcad_kernel_naming::resolve_edge (cognitive 24) crates/vcad-kernel-naming/src/lib.rs:590— vcad_kernel_naming::resolve_edge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (5 pts), boolean chains 4, 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.
vcad_kernel_naming::same_surface (cognitive 17) crates/vcad-kernel-naming/src/lib.rs:397— vcad_kernel_naming::same_surface has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, match/switch 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.
vcad_mcp::tools::loon_carry::carry_electronics (cognitive 40) crates/vcad-mcp/src/tools/loon_carry.rs:15— vcad_mcp::tools::loon_carry::carry_electronics has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 7, loops 5 (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.
vcad_mcp::transport::handle_http (cognitive 21) crates/vcad-mcp/src/transport.rs:286— vcad_mcp::transport::handle_http has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 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.
vcad_mcp::tools::engine::run (cognitive 20) crates/vcad-mcp/src/tools/engine.rs:150— vcad_mcp::tools::engine::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, 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.
vcad_mcp::discovery::attach_http_stdio (cognitive 19) crates/vcad-mcp/src/discovery.rs:234— vcad_mcp::discovery::attach_http_stdio has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 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.
vcad_kernel_antenna::mom::fill_impedance_matrix (cognitive 31) crates/vcad-kernel-antenna/src/mom.rs:194— vcad_kernel_antenna::mom::fill_impedance_matrix has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 6 (9 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.
vcad_kernel_antenna::nanovna::parse_s1p (cognitive 25) crates/vcad-kernel-antenna/src/nanovna.rs:33— vcad_kernel_antenna::nanovna::parse_s1p has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (8 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.
vcad_kernel_antenna::receipt::predicted_claims (cognitive 23) crates/vcad-kernel-antenna/src/receipt.rs:124— vcad_kernel_antenna::receipt::predicted_claims has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (7 pts), boolean chains 4, 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.
vcad_kernel_antenna::linalg::lu_decompose (cognitive 20) crates/vcad-kernel-antenna/src/linalg.rs:61— vcad_kernel_antenna::linalg::lu_decompose has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (8 pts), boolean chains 1 (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.
vcad_kernel_optics::optimize::minimize (cognitive 30) crates/vcad-kernel-optics/src/optimize.rs:55— vcad_kernel_optics::optimize::minimize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts), boolean chains 4 (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.
vcad_kernel_optics::trace::trace_to_image (cognitive 19) crates/vcad-kernel-optics/src/trace.rs:166— vcad_kernel_optics::trace::trace_to_image has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 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.
vcad_kernel_optics::trace::intersect_conic (cognitive 18) crates/vcad-kernel-optics/src/trace.rs:112— vcad_kernel_optics::trace::intersect_conic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 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.
vcad_kernel_optics::spot::analyze (cognitive 16) crates/vcad-kernel-optics/src/spot.rs:135— vcad_kernel_optics::spot::analyze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (6 pts), match/switch 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_photonics::gds::decompose_rects (cognitive 30) crates/vcad-kernel-photonics/src/gds.rs:27— vcad_kernel_photonics::gds::decompose_rects has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (13 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.
vcad_kernel_photonics::adjoint::objectives_and_gradients (cognitive 23) crates/vcad-kernel-photonics/src/adjoint.rs:165— vcad_kernel_photonics::adjoint::objectives_and_gradients has cognitive complexity 23 (threshold 15). Drivers by points: loops 10 (20 pts), if/else 1 (3 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_photonics::optimize::maximize_split (cognitive 23) crates/vcad-kernel-photonics/src/optimize.rs:115— vcad_kernel_photonics::optimize::maximize_split has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_photonics::design::cone_filter_transpose (cognitive 22) crates/vcad-kernel-photonics/src/design.rs:209— vcad_kernel_photonics::design::cone_filter_transpose has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Change-coupling hub: repl.rs → validate.rs, vcode.rs, writer.rs crates/vcad-cli/src/repl.rs— `crates/vcad-cli/src/repl.rs` changes together with 3 other files — `crates/vcad-eval/src/validate.rs`, `crates/vcad-ir/src/vcode.rs`, `crates/vcad-kernel-urdf/src/writer.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: sheet_metal.rs → sheet-metal.ts, vcad_kernel_wasm.d.ts, vcad_kernel_wasm_bg.wasm.d.ts crates/vcad-kernel-wasm/src/sheet_metal.rs— `crates/vcad-kernel-wasm/src/sheet_metal.rs` changes together with 3 other files — `packages/engine/src/sheet-metal.ts`, `packages/kernel-wasm/vcad_kernel_wasm.d.ts`, `packages/kernel-wasm/vcad_kernel_wasm_bg.wasm.d.ts` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: REDACTED → sheet_metal.rs, index.ts, sheet-metal.ts, vcad_kernel_wasm.d.ts, vcad_kernel_wasm_bg.wasm.d.ts crates/vcad-kernel-sheet/src/lib.rs— `crates/vcad-kernel-sheet/src/lib.rs` changes together with 5 other files — `crates/vcad-kernel-wasm/src/sheet_metal.rs`, `packages/engine/src/index.ts`, `packages/engine/src/sheet-metal.ts`, `packages/kernel-wasm/vcad_kernel_wasm.d.ts`, `packages/kernel-wasm/vcad_kernel_wasm_bg.wasm.d.ts` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: evaluate.rs → validate.rs, to_loon.rs, vcode.rs, writer.rs crates/vcad-app/src/evaluate.rs— `crates/vcad-app/src/evaluate.rs` changes together with 4 other files — `crates/vcad-eval/src/validate.rs`, `crates/vcad-ir/src/to_loon.rs`, `crates/vcad-ir/src/vcode.rs`, `crates/vcad-kernel-urdf/src/writer.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/vcad-ecad-pcb/src/drc.rs:1570— crates/vcad-ecad-pcb/src/drc.rs:1570-1591 | crates/vcad-ecad-pcb/src/router/auto.rs:1591-1966 | crates/vcad-ecad-pcb/src/router/maze.rs:961-975 | crates/vcad-ecad-pcb/src/session.rs:282-441 | crates/vcad-ecad-pcb/src/spatial.rs:178-199 | crates/vcad-slicer/src/infill.rs:222-236 — 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) crates/vcad-ecad-pcb/src/drc.rs:2913— crates/vcad-ecad-pcb/src/drc.rs:2913-2995 | crates/vcad-ecad-pcb/src/session.rs:282-441 | crates/vcad-kernel-cam/src/turning/geom.rs:162-176 | crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:468-557 | crates/vcad-process/src/masks.rs:31-56 | crates/vcad-process/src/masks.rs:94-124 — 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) crates/vcad-kernel-fillet/src/chamfer.rs:37— crates/vcad-kernel-fillet/src/chamfer.rs:37-167 | crates/vcad-kernel-fillet/src/fillet_curved.rs:706-751 | crates/vcad-kernel-fillet/src/fillet_curved.rs:880-985 | crates/vcad-kernel-fillet/src/fillet_curved.rs:1085-1177 | crates/vcad-kernel-fillet/src/fillet_planar.rs:52-250 | crates/vcad-kernel-fillet/src/fillet_planar.rs:365-442 — 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) apple/VcadApp/Sources/VcadApp/Shell.swift:905— apple/VcadApp/Sources/VcadApp/Shell.swift:905-915 | apple/VcadApp/Sources/VcadApp/Shell.swift:926-936 | apple/VcadApp/Sources/VcadApp/Shell.swift:938-948 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:905-915 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:926-936 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:938-948 — 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.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×4
Edited copy of a member (23 corresponding lines) crates/vcad-kernel-qcd/src/lattice.rs:176— crates/vcad-kernel-qcd/src/lattice.rs:176-199 | crates/vcad-kernel-qcd/src/lattice.rs:206-228 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/vcad-kernel-neutronics/src/diffusion.rs:291— crates/vcad-kernel-neutronics/src/diffusion.rs:291-317 | crates/vcad-kernel-neutronics/src/diffusion.rs:323-345 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/vcad-kernel-em/src/axisym.rs:371— crates/vcad-kernel-em/src/axisym.rs:371-393 | crates/vcad-kernel-em/src/axisym.rs:396-418 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/vcad-kernel-sketch/src/extrude.rs:49— crates/vcad-kernel-sketch/src/extrude.rs:49-71 | crates/vcad-kernel-sketch/src/profile.rs:261-291 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) crates/vcad-kernel-wasm/src/expressions.rs:87— crates/vcad-kernel-wasm/src/expressions.rs:87-108 | crates/vcad-kernel-wasm/src/expressions.rs:114-139 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) crates/vcad-kernel-cam/src/turning/ops.rs:323— crates/vcad-kernel-cam/src/turning/ops.rs:323-350 | crates/vcad-kernel-cam/src/turning/ops.rs:354-375 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) crates/vcad-kernel-dfm/src/geom/probe.rs:340— crates/vcad-kernel-dfm/src/geom/probe.rs:340-361 | crates/vcad-kernel-raytrace/src/intersect/triangle.rs:47-80 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) crates/vcad-crdt/src/lib.rs:338— crates/vcad-crdt/src/lib.rs:338-359 | crates/vcad-crdt/src/lib.rs:362-383 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×4
Edited copies of one member (3 members, 9+ corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:3026— crates/vcad-ecad-pcb/src/drc.rs:3026-3035 | crates/vcad-ecad-pcb/src/router/escape.rs:186-194 | crates/vcad-ecad-pcb/src/spatial.rs:222-233 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) REDACTED:678— REDACTED:678-686 | crates/vcad-ir/src/gear.rs:359-371 | crates/vcad-parts/src/builder.rs:162-173 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/vcad-ecad-pcb/src/router/auto.rs:4295— crates/vcad-ecad-pcb/src/router/auto.rs:4295-4303 | crates/vcad-ecad-pcb/src/router/auto.rs:4309-4317 | crates/vcad-ecad-pcb/src/router/maze.rs:100-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/vcad-kernel-qcd/src/update.rs:20— crates/vcad-kernel-qcd/src/update.rs:20-28 | crates/vcad-kernel-qcd/src/update.rs:31-39 | crates/vcad-kernel-qcd/src/update.rs:45-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (24 lines × 2) crates/vcad-kernel-em/src/axisym.rs:673— crates/vcad-kernel-em/src/axisym.rs:673-696 | crates/vcad-kernel-em/src/planar.rs:581-604 — before extracting anything, compare `crates/vcad-kernel-em/src/axisym.rs` and `crates/vcad-kernel-em/src/planar.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:673` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3268— apple/VcadApp/Sources/VcadApp/Editor.swift:3268-3291 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3268-3291 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) apple/VcadApp/Sources/VcadApp/SimController.swift:464— apple/VcadApp/Sources/VcadApp/SimController.swift:464-487 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:464-487 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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) apple/VcadApp/Sources/VcadApp/Document.swift:602— apple/VcadApp/Sources/VcadApp/Document.swift:602-625 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:602-625 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Document.swift:602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (43 lines × 2) crates/vcad-ecad-pcb/src/router/maze.rs:410— crates/vcad-ecad-pcb/src/router/maze.rs:410-452 | crates/vcad-ecad-pcb/src/router/maze.rs:1294-1336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/maze.rs:410` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (43 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:875— apple/VcadApp/Sources/VcadApp/Editor.swift:875-917 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:875-917 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (43 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2875— apple/VcadApp/Sources/VcadApp/Editor.swift:2875-2917 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2875-2917 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (43 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2383— apple/VcadApp/Sources/VcadApp/Editor.swift:2383-2425 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2383-2425 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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–13 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5884— crates/vcad-kernel-booleans/src/split.rs:5884-5895 | crates/vcad-kernel-booleans/src/split.rs:5922-5934 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:5884` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) crates/vcad-kernel-drafting/src/section.rs:697— crates/vcad-kernel-drafting/src/section.rs:697-709 | crates/vcad-kernel-drafting/src/section.rs:911-922 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel/src/lib.rs:2195— crates/vcad-kernel/src/lib.rs:2195-2207 | crates/vcad-kernel/src/lib.rs:2252-2263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) crates/vcad-kernel-em/src/spec.rs:357— crates/vcad-kernel-em/src/spec.rs:357-369 | crates/vcad-kernel-em/src/spec.rs:545-556 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-cam/src/operation/roughing3d.rs:176— crates/vcad-kernel-cam/src/operation/roughing3d.rs:176-187 | crates/vcad-kernel-cam/src/operation/roughing3d.rs:230-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/operation/roughing3d.rs:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:555— crates/vcad-kernel-sketch/src/extrude.rs:555-566 | crates/vcad-kernel-sketch/src/extrude.rs:825-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 (11–12 lines × 2) crates/vcad-kernel-booleans/src/no_crossing.rs:191— crates/vcad-kernel-booleans/src/no_crossing.rs:191-201 | crates/vcad-kernel-booleans/src/no_crossing.rs:203-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/no_crossing.rs:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:4777— crates/vcad-kernel-tessellate/src/lib.rs:4777-4787 | crates/vcad-kernel-tessellate/src/lib.rs:6863-6874 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-nurbs/src/lib.rs:146— crates/vcad-kernel-nurbs/src/lib.rs:146-157 | crates/vcad-kernel-step/src/entities/surfaces.rs:1121-1130 — 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–12 lines × 2) crates/vcad-kernel-raytrace/src/cpu.rs:95— crates/vcad-kernel-raytrace/src/cpu.rs:95-104 | crates/vcad-kernel-raytrace/src/cpu.rs:184-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/cpu.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/vcad-kernel-raytrace/src/cpu.rs:124— crates/vcad-kernel-raytrace/src/cpu.rs:124-133 | crates/vcad-kernel-raytrace/src/cpu.rs:209-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/cpu.rs:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:2372— crates/vcad-kernel-tessellate/src/lib.rs:2372-2383 | crates/vcad-kernel-tessellate/src/lib.rs:2443-2452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:2372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–10 lines × 2) crates/vcad-chat/src/executor.rs:563— crates/vcad-chat/src/executor.rs:563-572 | crates/vcad-chat/src/executor.rs:596-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–10 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:918— crates/vcad-kernel-booleans/src/classify.rs:918-927 | crates/vcad-kernel-booleans/src/trim.rs:541-548 — before extracting anything, compare `crates/vcad-kernel-booleans/src/classify.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 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 × 2) crates/vcad-kernel-diff/src/implicit.rs:105— crates/vcad-kernel-diff/src/implicit.rs:105-112 | crates/vcad-kernel-geom/src/lib.rs:1624-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 (8–10 lines × 2) crates/vcad-kernel-primitives/src/lib.rs:113— crates/vcad-kernel-primitives/src/lib.rs:113-122 | crates/vcad-kernel-primitives/src/lib.rs:330-337 — both copies are in the same file, so extract the block into 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–7 lines × 3) crates/vcad-kernel-booleans/src/split.rs:1581— crates/vcad-kernel-booleans/src/split.rs:1581-1586 | crates/vcad-kernel-booleans/src/split.rs:1809-1815 | crates/vcad-kernel-booleans/src/split.rs:1856-1862 — 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–7 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:4576— crates/vcad-kernel-tessellate/src/lib.rs:4576-4581 | crates/vcad-kernel-tessellate/src/lib.rs:7261-7266 | crates/vcad-kernel-tessellate/src/lib.rs:8133-8139 — 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–7 lines × 3) crates/vcad-ecad-export/src/gerber.rs:905— crates/vcad-ecad-export/src/gerber.rs:905-910 | crates/vcad-ecad-export/src/gerber.rs:911-917 | crates/vcad-ecad-export/src/gerber.rs:921-927 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-export/src/gerber.rs:905` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-export/src/gerber.rs:918` calls `Some` and `crates/vcad-ecad-export/src/gerber.rs:910` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 3) crates/vcad-kernel-constraints/src/session.rs:891— crates/vcad-kernel-constraints/src/session.rs:891-897 | crates/vcad-kernel-tessellate/src/lib.rs:366-371 | crates/vcad-render/src/lib.rs:2069-2075 — 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 (5 lines × 5) crates/vcad-kernel-booleans/src/split.rs:3082— crates/vcad-kernel-booleans/src/split.rs:3082-3088 | crates/vcad-kernel-booleans/src/split.rs:5085-5089 | crates/vcad-kernel-booleans/src/split.rs:5339-5343 | crates/vcad-kernel-booleans/src/split.rs:6303-6307 | crates/vcad-kernel-booleans/src/split.rs:6843-6847 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:3082` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 5) crates/vcad-kernel-gpu/src/decimate.rs:352— crates/vcad-kernel-gpu/src/decimate.rs:352-356 | crates/vcad-kernel-gpu/src/normals.rs:259-263 | crates/vcad-kernel-gpu/src/wavefront.rs:323-327 | crates/vcad-kernel-gpu/src/wavefront.rs:678-682 | crates/vcad-kernel-gpu/src/wavefront.rs:699-703 — before extracting anything, compare `crates/vcad-kernel-gpu/src/decimate.rs` and `crates/vcad-kernel-gpu/src/normals.rs` as WHOLE FILES: this scan already matched 7 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 (5 lines × 5) crates/vcad-kernel-raytrace/src/cpu.rs:122— crates/vcad-kernel-raytrace/src/cpu.rs:122-126 | crates/vcad-kernel-raytrace/src/cpu.rs:207-211 | crates/vcad-kernel-raytrace/src/cpu.rs:376-380 | crates/vcad-kernel-raytrace/src/cpu.rs:530-534 | crates/vcad-kernel-raytrace/src/cpu.rs:553-557 — 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) crates/vcad-kernel-sketch/src/extrude.rs:318— crates/vcad-kernel-sketch/src/extrude.rs:318-322 | crates/vcad-kernel-sketch/src/extrude.rs:699-703 | crates/vcad-kernel-sketch/src/extrude.rs:892-896 | crates/vcad-kernel-sketch/src/extrude.rs:1218-1222 | crates/vcad-kernel-sweep/src/loft.rs:195-199 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/loft.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (48 lines × 2) apple/VcadApp/Sources/VcadApp/IntentBar.swift:220— apple/VcadApp/Sources/VcadApp/IntentBar.swift:220-267 | apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift:220-267 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/IntentBar.swift` and `apple/VcadVision/Sources/VcadVision/Shared/IntentBar.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 142 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 (48 lines × 2) apple/VcadApp/Sources/VcadApp/SimController.swift:347— apple/VcadApp/Sources/VcadApp/SimController.swift:347-394 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:347-394 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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 (48 lines × 2) apple/VcadApp/Sources/VcadApp/SimPanel.swift:24— apple/VcadApp/Sources/VcadApp/SimPanel.swift:24-71 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:24-71 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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 (48 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3343— apple/VcadApp/Sources/VcadApp/Editor.swift:3343-3390 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3343-3390 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (29 lines × 2) apple/VcadApp/Sources/VcadApp/Chime.swift:37— apple/VcadApp/Sources/VcadApp/Chime.swift:37-65 | apple/VcadVision/Sources/VcadVision/Shared/Chime.swift:37-65 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Chime.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Chime.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (29 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:628— apple/VcadApp/Sources/VcadApp/Editor.swift:628-656 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:628-656 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (29 lines × 2) apple/VcadApp/Sources/VcadApp/SimPanel.swift:189— apple/VcadApp/Sources/VcadApp/SimPanel.swift:189-217 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:189-217 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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 (29 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4030— apple/VcadApp/Sources/VcadApp/Editor.swift:4030-4058 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4030-4058 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
ResidualSystem::solve_lm (cyclomatic 37) crates/vcad-ecad-pcb/src/router/sco.rs:524— ResidualSystem::solve_lm 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.
ResidualSystem::solve_sqp (cyclomatic 29) crates/vcad-ecad-pcb/src/router/sco.rs:361— ResidualSystem::solve_sqp 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.
ResidualSystem::compile_with (cyclomatic 17) crates/vcad-ecad-pcb/src/router/sco.rs:154— ResidualSystem::compile_with 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.
FlowGraph::build (cyclomatic 33) crates/vcad-ecad-pcb/src/router/flow/flow.rs:562— FlowGraph::build has cyclomatic complexity 33 (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.
FlowGraph::shortest (cyclomatic 31) crates/vcad-ecad-pcb/src/router/flow/flow.rs:881— FlowGraph::shortest 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.
FlowGraph::negotiate (cyclomatic 28) crates/vcad-ecad-pcb/src/router/flow/flow.rs:1175— FlowGraph::negotiate 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.
vcad_kernel_diff::lift::lift_surface_second (cyclomatic 33) crates/vcad-kernel-diff/src/lift.rs:211— vcad_kernel_diff::lift::lift_surface_second has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
vcad_kernel_diff::lift::lift_surface (cyclomatic 27) crates/vcad-kernel-diff/src/lift.rs:55— vcad_kernel_diff::lift::lift_surface has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
vcad_kernel_diff::implicit::implicit_terms (cyclomatic 22) crates/vcad-kernel-diff/src/implicit.rs:49— vcad_kernel_diff::implicit::implicit_terms has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
QuadricCtx::project_point (cyclomatic 32) crates/vcad-kernel-booleans/src/api.rs:1267— QuadricCtx::project_point 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.
QuadricCtx::project_mesh (cyclomatic 17) crates/vcad-kernel-booleans/src/api.rs:1159— QuadricCtx::project_mesh 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.
QuadricCtx::collect (cyclomatic 16) crates/vcad-kernel-booleans/src/api.rs:1074— QuadricCtx::collect 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.
vcad_design_constraints::lower::run (cyclomatic 31) crates/vcad-design-constraints/src/lower.rs:614— vcad_design_constraints::lower::run 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.
vcad_design_constraints::lower::write_back_group (cyclomatic 28) crates/vcad-design-constraints/src/lower.rs:800— vcad_design_constraints::lower::write_back_group 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.
vcad_design_constraints::measure::constraint_residual (cyclomatic 17) crates/vcad-design-constraints/src/measure.rs:252— vcad_design_constraints::measure::constraint_residual 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.
vcad_mcp::tools::loon_carry::carry_electronics (cyclomatic 29) crates/vcad-mcp/src/tools/loon_carry.rs:15— vcad_mcp::tools::loon_carry::carry_electronics 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.
vcad_mcp::tools::engine::run (cyclomatic 18) crates/vcad-mcp/src/tools/engine.rs:150— vcad_mcp::tools::engine::run 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.
vcad_mcp::transport::handle_http (cyclomatic 16) crates/vcad-mcp/src/transport.rs:286— vcad_mcp::transport::handle_http 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.
mecheval_grader::suite_c::solve_ik (cyclomatic 28) mecheval/graders/src/suite_c.rs:478— mecheval_grader::suite_c::solve_ik 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.
mecheval_grader::anti_cheese::enforce (cyclomatic 24) mecheval/graders/src/anti_cheese.rs:42— mecheval_grader::anti_cheese::enforce 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.
mecheval_grader::grader::check_step_roundtrip (cyclomatic 17) mecheval/graders/src/grader.rs:724— mecheval_grader::grader::check_step_roundtrip 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: mecheval_grader::grader::run_check (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.
vcad_kernel_topopt::extract::extract_mesh (cyclomatic 22) crates/vcad-kernel-topopt/src/extract.rs:22— vcad_kernel_topopt::extract::extract_mesh 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.
vcad_kernel_topopt::analyze::analyze_fields_thermal_warm (cyclomatic 18) crates/vcad-kernel-topopt/src/analyze.rs:221— vcad_kernel_topopt::analyze::analyze_fields_thermal_warm has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_topopt::simp::filter_sensitivities (cyclomatic 17) crates/vcad-kernel-topopt/src/simp.rs:147— vcad_kernel_topopt::simp::filter_sensitivities 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.
vcad_kernel_naming::profile::seed_extrude_names (cyclomatic 21) crates/vcad-kernel-naming/src/profile.rs:53— vcad_kernel_naming::profile::seed_extrude_names 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.
vcad_kernel_naming::resolve_edge (cyclomatic 19) crates/vcad-kernel-naming/src/lib.rs:590— vcad_kernel_naming::resolve_edge 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.
vcad_kernel_naming::same_surface (cyclomatic 17) crates/vcad-kernel-naming/src/lib.rs:397— vcad_kernel_naming::same_surface 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.
Solid::resolve_face (cyclomatic 20) crates/vcad-kernel/src/lib.rs:1565— Solid::resolve_face 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.
Solid::text_extrude (cyclomatic 20) crates/vcad-kernel-wasm/src/lib.rs:2220— Solid::text_extrude 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.
Solid::fillet_reported (cyclomatic 17) crates/vcad-kernel/src/lib.rs:1009— Solid::fillet_reported 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.
vcad_kernel_photon_dose::transport::run (cognitive 157) crates/vcad-kernel-photon-dose/src/transport.rs:329— vcad_kernel_photon_dose::transport::run has cognitive complexity 157 (threshold 15). Drivers by points: if/else 45 (111 pts), loops 14 (39 pts), boolean chains 7 (nesting depth added 91). 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.
vcad_kernel_photon_dose::capture::capture_lines (cognitive 29) crates/vcad-kernel-photon-dose/src/capture.rs:209— vcad_kernel_photon_dose::capture::capture_lines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 5 (11 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.
vcad_kernel_photon_dose::capture::capture_gamma_reports (cognitive 17) crates/vcad-kernel-photon-dose/src/capture.rs:286— vcad_kernel_photon_dose::capture::capture_gamma_reports has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (4 pts), loops 2 (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.
vcad_kernel_neutronics::transport::run (cognitive 106) crates/vcad-kernel-neutronics/src/transport.rs:318— vcad_kernel_neutronics::transport::run has cognitive complexity 106 (threshold 15). Drivers by points: if/else 22 (66 pts), loops 10 (22 pts), match/switch 5 (15 pts), boolean chains 3 (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.
vcad_kernel_neutronics::receipt::compare (cognitive 18) crates/vcad-kernel-neutronics/src/receipt.rs:301— vcad_kernel_neutronics::receipt::compare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
vcad_kernel_neutronics::transport::distance_to_boundary (cognitive 16) crates/vcad-kernel-neutronics/src/transport.rs:233— vcad_kernel_neutronics::transport::distance_to_boundary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FeSystem::build (cognitive 93) crates/vcad-kernel-topopt/src/fea.rs:154— FeSystem::build has cognitive complexity 93 (threshold 15). Drivers by points: loops 18 (50 pts), if/else 12 (43 pts) (nesting depth added 63). 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.
FeSystem::apply (cognitive 19) crates/vcad-kernel-topopt/src/fea.rs:275— FeSystem::apply has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (9 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.
FeSystem::solve (cognitive 18) crates/vcad-kernel-topopt/src/fea.rs:327— FeSystem::solve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (8 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.
vcad_printcheck::checks::check_columns (cognitive 79) crates/vcad-printcheck/src/checks.rs:237— vcad_printcheck::checks::check_columns has cognitive complexity 79 (threshold 15). Drivers by points: if/else 18 (50 pts), loops 12 (23 pts), boolean chains 4, match/switch 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.
vcad_printcheck::checks::check_walls (cognitive 61) crates/vcad-printcheck/src/checks.rs:582— vcad_printcheck::checks::check_walls has cognitive complexity 61 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 6 (15 pts), match/switch 1 (6 pts), boolean chains 5 (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.
vcad_printcheck::checks::anchor_reach (cognitive 22) crates/vcad-printcheck/src/checks.rs:708— vcad_printcheck::checks::anchor_reach has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuadricCtx::project_point (cognitive 58) crates/vcad-kernel-booleans/src/api.rs:1267— QuadricCtx::project_point has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (50 pts), boolean chains 6, loops 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.
QuadricCtx::collect (cognitive 34) crates/vcad-kernel-booleans/src/api.rs:1074— QuadricCtx::collect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 4, loops 2 (3 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.
QuadricCtx::project_mesh (cognitive 31) crates/vcad-kernel-booleans/src/api.rs:1159— QuadricCtx::project_mesh has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 5 (8 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.
Envelope::new (cognitive 58) crates/vcad-kernel-cam/src/turning/envelope.rs:149— Envelope::new has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 12 (22 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Envelope::path (cognitive 46) crates/vcad-kernel-cam/src/turning/envelope.rs:350— Envelope::path has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 3 (5 pts), boolean chains 4, 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.
Envelope::below (cognitive 24) crates/vcad-kernel-cam/src/turning/envelope.rs:299— Envelope::below has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 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.
vcad_ecad_schematic::generate_netlist (cognitive 53) crates/vcad-ecad-schematic/src/lib.rs:146— vcad_ecad_schematic::generate_netlist has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 16 (26 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_ecad_schematic::erc::check_unconnected_pins (cognitive 29) crates/vcad-ecad-schematic/src/erc.rs:92— vcad_ecad_schematic::erc::check_unconnected_pins has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 9 (14 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.
vcad_ecad_schematic::erc::check_pin_type_conflicts (cognitive 17) crates/vcad-ecad-schematic/src/erc.rs:177— vcad_ecad_schematic::erc::check_pin_type_conflicts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (6 pts), match/switch 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simulation::step_tm (cognitive 53) crates/vcad-kernel-photonics/src/sim.rs:455— Simulation::step_tm has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (30 pts), loops 12 (21 pts), match/switch 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.
Simulation::step_te (cognitive 35) crates/vcad-kernel-photonics/src/sim.rs:597— Simulation::step_te has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 8 (13 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.
Simulation::record_monitors (cognitive 22) crates/vcad-kernel-photonics/src/sim.rs:692— Simulation::record_monitors has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (12 pts), match/switch 4 (10 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.
FlowModel::validate (cognitive 50) crates/vcad-kernel-flow/src/model.rs:476— FlowModel::validate has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 15, 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.
FlowModel::inlet_hydraulic_diameter_mm (cognitive 40) crates/vcad-kernel-flow/src/model.rs:330— FlowModel::inlet_hydraulic_diameter_mm has cognitive complexity 40 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 7 (16 pts), boolean chains 3, 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.
FlowModel::inlet_net_flux_m3_s (cognitive 25) crates/vcad-kernel-flow/src/model.rs:419— FlowModel::inlet_net_flux_m3_s has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (14 pts), loops 4 (10 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.
vcad_atoms::optimize::optimize_parameters (cognitive 42) crates/vcad-atoms/src/optimize.rs:335— vcad_atoms::optimize::optimize_parameters has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 7 (15 pts), boolean chains 2 (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.
vcad_atoms::optimize::face_sensitivities (cognitive 32) crates/vcad-atoms/src/optimize.rs:607— vcad_atoms::optimize::face_sensitivities has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (11 pts), match/switch 2 (8 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.
vcad_atoms::fab::gcode_envelope (cognitive 22) crates/vcad-atoms/src/fab.rs:84— vcad_atoms::fab::gcode_envelope has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), match/switch 2 (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.
ConvertCtx::convert_solid (cognitive 35) crates/vcad-loon/src/convert.rs:2335— ConvertCtx::convert_solid has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 7, match/switch 4 (5 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ConvertCtx::material_physics (cognitive 19) crates/vcad-loon/src/convert.rs:1191— ConvertCtx::material_physics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (7 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.
ConvertCtx::apply_material_physics (cognitive 16) crates/vcad-loon/src/convert.rs:1296— ConvertCtx::apply_material_physics has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), 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.
vcad_kernel_features::relate (cognitive 30) crates/vcad-kernel-features/src/lib.rs:762— vcad_kernel_features::relate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (10 pts), match/switch 1 (3 pts), boolean chains 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.
vcad_kernel_features::raw_cylindrical_faces (cognitive 22) crates/vcad-kernel-features/src/lib.rs:167— vcad_kernel_features::raw_cylindrical_faces has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), match/switch 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.
vcad_kernel_features::step::place (cognitive 19) crates/vcad-kernel-features/src/step.rs:79— vcad_kernel_features::step::place has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (9 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.
vcad_diff::recompose (cognitive 28) crates/vcad-diff/src/lib.rs:224— vcad_diff::recompose has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 6 (9 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.
vcad_diff::merge (cognitive 26) crates/vcad-diff/src/lib.rs:585— vcad_diff::merge has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (11 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.
vcad_diff::decompose (cognitive 18) crates/vcad-diff/src/lib.rs:149— vcad_diff::decompose has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (9 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.
vcad_kernel_tolerance::allocate::allocate (cognitive 28) crates/vcad-kernel-tolerance/src/allocate.rs:247— vcad_kernel_tolerance::allocate::allocate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_tolerance::economics::economics (cognitive 27) crates/vcad-kernel-tolerance/src/economics.rs:272— vcad_kernel_tolerance::economics::economics has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, loops 3, 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.
vcad_kernel_tolerance::receipt::compare (cognitive 17) crates/vcad-kernel-tolerance/src/receipt.rs:283— vcad_kernel_tolerance::receipt::compare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, loops 2, 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.
vcad_kernel_constraints::residual::compute_constraint_residuals (cognitive 27) crates/vcad-kernel-constraints/src/residual.rs:20— vcad_kernel_constraints::residual::compute_constraint_residuals has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 2 (4 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.
vcad_kernel_constraints::residual::get_point_coords (cognitive 16) crates/vcad-kernel-constraints/src/residual.rs:306— vcad_kernel_constraints::residual::get_point_coords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
vcad_kernel_constraints::symbolic::sym_point (cognitive 16) crates/vcad-kernel-constraints/src/symbolic.rs:541— vcad_kernel_constraints::symbolic::sym_point has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Mesh::build (cognitive 26) crates/vcad-kernel-antenna/src/geometry.rs:254— Mesh::build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (8 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mesh::slice (cognitive 23) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:413— Mesh::slice has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 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.
Mesh::new (cognitive 18) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:258— Mesh::new has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 2 (5 pts) (nesting depth added 8). 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.
TriangleMesh::edge_segments (cognitive 24) crates/vcad-kernel-tessellate/src/lib.rs:312— TriangleMesh::edge_segments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (5 pts), boolean chains 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.
TriangleMesh::merge (cognitive 21) crates/vcad-kernel-tessellate/src/lib.rs:136— TriangleMesh::merge has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (9 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.
TriangleMesh::boundary_loops (cognitive 20) crates/vcad-kernel-tessellate/src/lib.rs:454— TriangleMesh::boundary_loops has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (6 pts), loops 3 (4 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.
TurnPlanner::level_rough (cognitive 22) crates/vcad-kernel-cam/src/turning/ops.rs:252— TurnPlanner::level_rough has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (8 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.
TurnPlanner::new (cognitive 20) crates/vcad-kernel-cam/src/turning/ops.rs:42— TurnPlanner::new has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (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.
TurnPlanner::bore (cognitive 17) crates/vcad-kernel-cam/src/turning/ops.rs:421— TurnPlanner::bore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1, match/switch 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.
RobotEnv::check_termination (cognitive 21) crates/vcad-kernel-physics/src/gym.rs:768— RobotEnv::check_termination has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RobotEnv::apply_episode_randomization (cognitive 16) crates/vcad-kernel-physics/src/gym.rs:434— RobotEnv::apply_episode_randomization has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RobotEnv::apply_action (cognitive 16) crates/vcad-kernel-physics/src/gym.rs:996— RobotEnv::apply_action has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
vcad_kernel_urdf::reader::contains_doctype (cognitive 21) crates/vcad-kernel-urdf/src/reader.rs:697— vcad_kernel_urdf::reader::contains_doctype has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (17 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.
vcad_kernel_urdf::reader::locate_robot_bounds (cognitive 20) crates/vcad-kernel-urdf/src/reader.rs:16— vcad_kernel_urdf::reader::locate_robot_bounds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, match/switch 1 (2 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.
vcad_kernel_urdf::reader::normalize_link_child_order (cognitive 20) crates/vcad-kernel-urdf/src/reader.rs:137— vcad_kernel_urdf::reader::normalize_link_child_order has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 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.
TooManyFields: Cli crates/vcad-render/src/main.rs:161— TooManyFields — 64 stored fields beside 3 methods. The bar is 30 stored fields; this is 34 over it, 2.13× 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: App crates/vcad-cli/src/app.rs:102— TooManyFields — 35 stored fields beside 37 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: Palette crates/vcad-render/src/pcb.rs:77— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×3
Edited copy of a member (30 corresponding lines) crates/vcad-ecad-symbols/src/altium/binary.rs:318— crates/vcad-ecad-symbols/src/altium/binary.rs:318-347 | crates/vcad-ecad-symbols/src/altium/binary.rs:349-390 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/vcad-app/src/document_api.rs:851— crates/vcad-app/src/document_api.rs:851-880 | crates/vcad-ffi/src/train.rs:263-293 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/vcad-ecad-symbols/src/builtin.rs:278— crates/vcad-ecad-symbols/src/builtin.rs:278-307 | crates/vcad-ecad-symbols/src/footprint.rs:609-643 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) crates/vcad-kernel-booleans/src/classify.rs:1654— crates/vcad-kernel-booleans/src/classify.rs:1654-1696 | crates/vcad-kernel/src/lib.rs:3153-3183 — These two members are one piece of code written twice and then edited apart: 31 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 (31 corresponding lines) crates/vcad-kernel-tessellate/src/lib.rs:8181— crates/vcad-kernel-tessellate/src/lib.rs:8181-8212 | crates/vcad-kernel-tessellate/src/lib.rs:8222-8252 — These two members are one piece of code written twice and then edited apart: 31 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 (31 corresponding lines) crates/vcad-kernel-em/src/receipt.rs:448— crates/vcad-kernel-em/src/receipt.rs:448-478 | crates/vcad-kernel-thermal/src/receipt.rs:598-632 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×3
Edited copy of a member (33 corresponding lines) crates/vcad-kernel-nurbs/src/lib.rs:211— crates/vcad-kernel-nurbs/src/lib.rs:211-243 | crates/vcad-kernel-nurbs/src/lib.rs:682-714 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:12— crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:12-56 | crates/vcad-kernel-raytrace/src/intersect/sphere.rs:13-45 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/vcad-kernel-diff/src/seam.rs:302— crates/vcad-kernel-diff/src/seam.rs:302-340 | crates/vcad-kernel-diff/src/second_order.rs:125-157 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×3
Edited copies of one member (3 members, 13+ corresponding lines) crates/vcad-ecad-pcb/src/pour_synth.rs:289— crates/vcad-ecad-pcb/src/pour_synth.rs:289-301 | crates/vcad-ecad-pcb/src/router/auto.rs:3941-3953 | crates/vcad-ecad-pcb/src/router/flow/access.rs:130-144 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/vcad-ffi/src/lib.rs:261— crates/vcad-ffi/src/lib.rs:261-278 | crates/vcad-ffi/src/lib.rs:282-296 | crates/vcad-ffi/src/lib.rs:745-757 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/vcad-ecad-pcb/src/router/claims_ir.rs:435— crates/vcad-ecad-pcb/src/router/claims_ir.rs:435-447 | crates/vcad-ecad-pcb/src/router/claims_ir.rs:457-470 | crates/vcad-ecad-pcb/src/router/claims_ir.rs:473-486 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (45 lines × 2) crates/vcad-eval/src/evaluate.rs:3389— crates/vcad-eval/src/evaluate.rs:3389-3433 | crates/vcad-eval/src/validate.rs:170-214 — 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 (45 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:924— apple/VcadApp/Sources/VcadApp/Editor.swift:924-968 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:924-968 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (45 lines × 2) apple/VcadApp/Sources/VcadApp/Sim.swift:199— apple/VcadApp/Sources/VcadApp/Sim.swift:199-243 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:199-243 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Sim.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Sim.swift` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 321 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 (32 lines × 2) crates/vcad-kernel-cam/src/post/grbl.rs:155— crates/vcad-kernel-cam/src/post/grbl.rs:155-186 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:207-238 — before extracting anything, compare `crates/vcad-kernel-cam/src/post/grbl.rs` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/post/grbl.rs:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2483— apple/VcadApp/Sources/VcadApp/Editor.swift:2483-2514 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2483-2514 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (32 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4380— apple/VcadApp/Sources/VcadApp/Editor.swift:4380-4411 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4380-4411 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (26 lines × 2) crates/vcad-kernel-fea/src/buckling.rs:411— crates/vcad-kernel-fea/src/buckling.rs:411-436 | crates/vcad-kernel-fea/src/modal.rs:177-202 — before extracting anything, compare `crates/vcad-kernel-fea/src/buckling.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/buckling.rs:411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) crates/vcad-ecad-symbols/src/altium/mod.rs:1020— crates/vcad-ecad-symbols/src/altium/mod.rs:1020-1045 | crates/vcad-ecad-symbols/src/eagle_brd.rs:364-389 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:130— apple/VcadApp/Sources/VcadApp/Shell.swift:130-155 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:130-155 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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–20 lines × 2) crates/vcad-cli/src/ui/command.rs:162— crates/vcad-cli/src/ui/command.rs:162-180 | crates/vcad-cli/src/ui/menu.rs:498-517 — 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–20 lines × 2) crates/vcad-ecad-export/src/gerber.rs:937— crates/vcad-ecad-export/src/gerber.rs:937-955 | crates/vcad-ecad-export/src/gerber.rs:978-997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-export/src/gerber.rs:937` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:51— crates/vcad-kernel-sketch/src/extrude.rs:51-70 | crates/vcad-kernel-sketch/src/profile.rs:264-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16–17 lines × 2) crates/vcad-ecad-symbols/src/footprint.rs:80— crates/vcad-ecad-symbols/src/footprint.rs:80-95 | crates/vcad-ecad-symbols/src/footprint.rs:107-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/footprint.rs:80` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) crates/vcad-kernel-booleans/src/mesh/mod.rs:178— crates/vcad-kernel-booleans/src/mesh/mod.rs:178-193 | crates/vcad-kernel-shell/src/lib.rs:1336-1352 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/mod.rs` and `crates/vcad-kernel-shell/src/lib.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 (16–17 lines × 2) crates/vcad-kernel-raytrace/src/intersect/cone.rs:101— crates/vcad-kernel-raytrace/src/intersect/cone.rs:101-116 | crates/vcad-kernel-raytrace/src/intersect/sphere.rs:62-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/intersect/cone.rs:101` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crates/vcad-kernel-diff/src/lift.rs:225— crates/vcad-kernel-diff/src/lift.rs:225-238 | crates/vcad-kernel-diff/src/lift.rs:375-388 | crates/vcad-kernel-diff/src/lift.rs:397-410 — 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) crates/vcad-kernel-fea/src/buckling.rs:1777— crates/vcad-kernel-fea/src/buckling.rs:1777-1790 | crates/vcad-kernel-fea/src/section.rs:1017-1030 | crates/vcad-kernel-fea/src/shell.rs:860-873 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/buckling.rs:1777` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crates/vcad-kernel-fillet/src/chamfer.rs:49— crates/vcad-kernel-fillet/src/chamfer.rs:49-62 | crates/vcad-kernel-fillet/src/fillet_curved.rs:205-218 | crates/vcad-kernel-fillet/src/fillet_planar.rs:85-98 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_curved.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) crates/vcad-kernel-fillet/src/chamfer.rs:113— crates/vcad-kernel-fillet/src/chamfer.rs:113-123 | crates/vcad-kernel-fillet/src/fillet_planar.rs:198-209 | crates/vcad-kernel-fillet/src/fillet_planar.rs:414-424 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_planar.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/fillet_planar.rs:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-fillet/src/chamfer.rs:112` calls `compute_centroid` and `crates/vcad-kernel-fillet/src/fillet_planar.rs:198` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 3) crates/vcad-kernel-flow/src/gpu.rs:192— crates/vcad-kernel-flow/src/gpu.rs:192-202 | crates/vcad-kernel-gpu/src/wavefront.rs:168-179 | crates/vcad-kernel-gpu/src/wavefront.rs:463-474 — before extracting anything, compare `crates/vcad-kernel-flow/src/gpu.rs` and `crates/vcad-kernel-gpu/src/wavefront.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/gpu.rs:192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 3) crates/vcad-render/src/animate.rs:375— crates/vcad-render/src/animate.rs:375-386 | crates/vcad-render/src/animate.rs:599-609 | crates/vcad-render/src/animate.rs:697-707 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/animate.rs:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) crates/vcad-kernel-booleans/src/classify.rs:683— crates/vcad-kernel-booleans/src/classify.rs:683-691 | crates/vcad-kernel-booleans/src/trim.rs:256-266 — before extracting anything, compare `crates/vcad-kernel-booleans/src/classify.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:683` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) crates/vcad-kernel-booleans/src/split.rs:4850— crates/vcad-kernel-booleans/src/split.rs:4850-4860 | crates/vcad-kernel-booleans/src/split.rs:5164-5172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:4850` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5072— crates/vcad-kernel-booleans/src/split.rs:5072-5080 | crates/vcad-kernel-booleans/src/split.rs:6285-6295 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-booleans/src/split.rs:2773— crates/vcad-kernel-booleans/src/split.rs:2773-2783 | crates/vcad-kernel-booleans/src/split.rs:3776-3783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:2773` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8–11 lines × 2) crates/vcad-kernel-booleans/src/split.rs:4031— crates/vcad-kernel-booleans/src/split.rs:4031-4041 | crates/vcad-kernel-booleans/src/split.rs:4519-4526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:4031` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–11 lines × 2) packages/training/src/lambda/distill_lambda.py:320— packages/training/src/lambda/distill_lambda.py:320-327 | packages/training/src/modal/distill.py:325-335 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `packages/training/src/modal/distill.py:325` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 3) crates/vcad-ecad-sim/src/circuit/ac.rs:190— crates/vcad-ecad-sim/src/circuit/ac.rs:190-198 | crates/vcad-ecad-sim/src/circuit/ac.rs:312-319 | crates/vcad-ecad-sim/src/circuit/devices.rs:375-383 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-sim/src/circuit/ac.rs:190` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `g` to `Cplx` in one and `f64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–9 lines × 3) crates/vcad-eval/src/cavity_extract.rs:269— crates/vcad-eval/src/cavity_extract.rs:269-277 | crates/vcad-eval/src/sim_extract.rs:302-309 | crates/vcad-eval/src/thermal_extract.rs:528-535 — before extracting anything, compare `crates/vcad-eval/src/cavity_extract.rs` and `crates/vcad-eval/src/sim_extract.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. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-eval/src/sim_extract.rs:311` calls `push`, `to_string` and `crates/vcad-eval/src/cavity_extract.rs:277` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 3) apple/VcadApp/Sources/VcadApp/ModelBrowser.swift:279— apple/VcadApp/Sources/VcadApp/ModelBrowser.swift:279-286 | apple/VcadApp/Sources/VcadApp/Shell.swift:624-632 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:624-632 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/ModelBrowser.swift:279` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 2) crates/vcad-kernel-booleans/src/freeze.rs:83— crates/vcad-kernel-booleans/src/freeze.rs:83-88 | crates/vcad-kernel-booleans/src/split.rs:775-782 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6–8 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:312— crates/vcad-kernel-sketch/src/extrude.rs:312-319 | crates/vcad-kernel-sketch/src/extrude.rs:888-893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:4990— crates/vcad-kernel-tessellate/src/lib.rs:4990-4995 | crates/vcad-kernel-tessellate/src/lib.rs:6656-6663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:4990` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (37 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:1169— apple/VcadApp/Sources/VcadApp/Shell.swift:1169-1205 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:1169-1205 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 (37 lines × 2) apple/VcadApp/Sources/VcadApp/Kernel.swift:22— apple/VcadApp/Sources/VcadApp/Kernel.swift:22-58 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:22-58 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 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 (37 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1530— apple/VcadApp/Sources/VcadApp/Editor.swift:1530-1566 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1530-1566 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (39 lines × 2) apple/VcadApp/Sources/VcadApp/Kernel.swift:518— apple/VcadApp/Sources/VcadApp/Kernel.swift:518-556 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:518-556 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 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 (39 lines × 2) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:156— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:156-194 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:156-194 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 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 (39 lines × 2) apple/VcadApp/Sources/VcadApp/Document.swift:518— apple/VcadApp/Sources/VcadApp/Document.swift:518-556 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:518-556 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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.
R10 · Code Duplication· Duplicated block with local edits (45 matched lines × 2 locations) · ×3
Duplicated block with local edits (45 matched lines × 2 locations) packages/app/src/components/cam/OperationList.tsx:479— packages/app/src/components/cam/OperationList.tsx:479 · packages/app/src/components/cam/ToolLibrary.tsx:95 — the two spans are one implementation copied and then locally edited — 235 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (45 matched lines × 2 locations) packages/app/src/components/dialogs/MirrorDialog.tsx:21— packages/app/src/components/dialogs/MirrorDialog.tsx:21 · packages/app/src/components/dialogs/PatternDialog.tsx:29 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (45 matched lines × 2 locations) packages/core/src/commands/executors.ts:530— packages/core/src/commands/executors.ts:530 · packages/mcp/src/tools/parts.ts:117 — the two spans are one implementation copied and then locally edited — 376 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
AC1 · Text alternatives· <canvas> without a text alternative · ×2
<canvas> without a text alternative packages/app/src/components/RayTracedViewport.tsx:850— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative packages/app/src/components/ViewportContent.tsx:1523— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
ConvertCtx::convert_solid (cyclomatic 62) crates/vcad-loon/src/convert.rs:2335— ConvertCtx::convert_solid 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.
ConvertCtx::material_physics (cyclomatic 29) crates/vcad-loon/src/convert.rs:1191— ConvertCtx::material_physics has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DocumentGraph.paramSummary (cyclomatic 51) apple/VcadApp/Sources/VcadApp/Document.swift:560— DocumentGraph.paramSummary has cyclomatic complexity 51 (threshold 15). Of this number, 46 points are the body's own statements and 5 belong to 2 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.
DocumentGraph.paramSummary (cyclomatic 51) apple/VcadVision/Sources/VcadVision/Shared/Document.swift:560— DocumentGraph.paramSummary has cyclomatic complexity 51 (threshold 15). Of this number, 46 points are the body's own statements and 5 belong to 2 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.
DocumentGraph.parse (cyclomatic 50) apple/VcadApp/Sources/VcadApp/Document.swift:173— DocumentGraph.parse 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.
DocumentGraph.parse (cyclomatic 50) apple/VcadVision/Sources/VcadVision/Shared/Document.swift:173— DocumentGraph.parse 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.
Server::handle_modern (cyclomatic 44) crates/vcad-mcp/src/server.rs:818— Server::handle_modern 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.
Server::call_tool_inner (cyclomatic 21) crates/vcad-mcp/src/server.rs:521— Server::call_tool_inner 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.
vcad_ecad_fabprep::run_fab_prep (cyclomatic 39) crates/vcad-ecad-fabprep/src/lib.rs:403— vcad_ecad_fabprep::run_fab_prep 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.
vcad_ecad_fabprep::render::fab_notes (cyclomatic 18) crates/vcad-ecad-fabprep/src/render.rs:236— vcad_ecad_fabprep::render::fab_notes 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.
FlowModel::validate (cyclomatic 39) crates/vcad-kernel-flow/src/model.rs:476— FlowModel::validate 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.
FlowModel::inlet_hydraulic_diameter_mm (cyclomatic 18) crates/vcad-kernel-flow/src/model.rs:330— FlowModel::inlet_hydraulic_diameter_mm 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.
KernelMesh.creasedNormals (cyclomatic 37) apple/VcadApp/Sources/VcadApp/Kernel.swift:93— KernelMesh.creasedNormals has cyclomatic complexity 37 (threshold 15). Of this number, 28 points are the body's own statements and 9 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.
KernelMesh.creasedNormals (cyclomatic 37) apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:93— KernelMesh.creasedNormals has cyclomatic complexity 37 (threshold 15). Of this number, 28 points are the body's own statements and 9 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.
vcad_printcheck::checks::check_columns (cyclomatic 34) crates/vcad-printcheck/src/checks.rs:237— vcad_printcheck::checks::check_columns 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.
vcad_printcheck::checks::check_walls (cyclomatic 23) crates/vcad-printcheck/src/checks.rs:582— vcad_printcheck::checks::check_walls 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.
PhysicsWorld::from_document_with_colliders (cyclomatic 33) crates/vcad-kernel-physics/src/world.rs:266— PhysicsWorld::from_document_with_colliders has cyclomatic complexity 33 (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.
PhysicsWorld::ground_contacts (cyclomatic 18) crates/vcad-kernel-physics/src/world.rs:968— PhysicsWorld::ground_contacts has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
EditorModel.finishSketch (cyclomatic 32) apple/VcadApp/Sources/VcadApp/Editor.swift:2156— EditorModel.finishSketch 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.
EditorModel.finishSketch (cyclomatic 32) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2156— EditorModel.finishSketch 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.
Problem::sample (cyclomatic 31) crates/vcad-eval/src/optimize.rs:1172— Problem::sample 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.
Problem::new (cyclomatic 17) crates/vcad-eval/src/optimize.rs:849— Problem::new 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.
Envelope::new (cyclomatic 30) crates/vcad-kernel-cam/src/turning/envelope.rs:149— Envelope::new 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.
Envelope::path (cyclomatic 21) crates/vcad-kernel-cam/src/turning/envelope.rs:350— Envelope::path 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.
Simulation::step_tm (cyclomatic 28) crates/vcad-kernel-photonics/src/sim.rs:455— Simulation::step_tm 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.
Simulation::step_te (cyclomatic 20) crates/vcad-kernel-photonics/src/sim.rs:597— Simulation::step_te 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.
EditorModel.startBackgroundEvaluation (cyclomatic 28) apple/VcadApp/Sources/VcadApp/Editor.swift:4268— EditorModel.startBackgroundEvaluation 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.
EditorModel.startBackgroundEvaluation (cyclomatic 28) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4268— EditorModel.startBackgroundEvaluation 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.
vcad_ecad_schematic::generate_netlist (cyclomatic 27) crates/vcad-ecad-schematic/src/lib.rs:146— vcad_ecad_schematic::generate_netlist 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.
vcad_ecad_schematic::erc::check_unconnected_pins (cyclomatic 16) crates/vcad-ecad-schematic/src/erc.rs:92— vcad_ecad_schematic::erc::check_unconnected_pins 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.
DocEdit.patternInstancing (cyclomatic 27) apple/VcadApp/Sources/VcadApp/Document.swift:710— DocEdit.patternInstancing has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: DocumentGraph.symbol (cyclomatic 35) 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.
DocEdit.patternInstancing (cyclomatic 27) apple/VcadVision/Sources/VcadVision/Shared/Document.swift:710— DocEdit.patternInstancing has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: DocumentGraph.symbol (cyclomatic 35) 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.
vcad_embroidery_dst::reader::decode_record (cyclomatic 25) crates/vcad-embroidery-dst/src/reader.rs:31— vcad_embroidery_dst::reader::decode_record 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.
vcad_embroidery_dst::writer::encode_record (cyclomatic 25) crates/vcad-embroidery-dst/src/writer.rs:67— vcad_embroidery_dst::writer::encode_record 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.
EditorModel.documentScene (cyclomatic 24) apple/VcadApp/Sources/VcadApp/Editor.swift:4451— EditorModel.documentScene has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorModel.documentScene (cyclomatic 24) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4451— EditorModel.documentScene has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamingMesh.update (cyclomatic 24) apple/VcadApp/Sources/VcadApp/Kernel.swift:300— StreamingMesh.update has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
StreamingMesh.update (cyclomatic 24) apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:300— StreamingMesh.update has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
DocumentCommands.body (cyclomatic 24) apple/VcadApp/Sources/VcadApp/Shell.swift:176— DocumentCommands.body has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DocumentCommands.body (cyclomatic 24) apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:176— DocumentCommands.body has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
vcad_kernel_sketch::revolve::revolve (cyclomatic 23) crates/vcad-kernel-sketch/src/revolve.rs:60— vcad_kernel_sketch::revolve::revolve 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.
vcad_kernel_sketch::extrude::extrude_with_arcs (cyclomatic 16) crates/vcad-kernel-sketch/src/extrude.rs:552— vcad_kernel_sketch::extrude::extrude_with_arcs 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.
EditorModel.tools (cyclomatic 22) apple/VcadApp/Sources/VcadApp/Editor.swift:3882— EditorModel.tools 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.
EditorModel.tools (cyclomatic 22) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3882— EditorModel.tools 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.
EditorModel.assemblyScene (cyclomatic 20) apple/VcadApp/Sources/VcadApp/Editor.swift:4560— EditorModel.assemblyScene has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 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.
EditorModel.assemblyScene (cyclomatic 20) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4560— EditorModel.assemblyScene has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 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.
FeatureRowView.row (cyclomatic 20) apple/VcadApp/Sources/VcadApp/Shell.swift:620— FeatureRowView.row 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. This is NOT this file's highest cyclomatic complexity: FeatureParamEditors.editors (cyclomatic 21) 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.
FeatureRowView.row (cyclomatic 20) apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:620— FeatureRowView.row 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. This is NOT this file's highest cyclomatic complexity: FeatureParamEditors.editors (cyclomatic 21) 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.
InspectorView.body (cyclomatic 20) apple/VcadApp/Sources/VcadApp/VisionShell.swift:13— InspectorView.body 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.
InspectorView.body (cyclomatic 20) apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:13— InspectorView.body 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.
vcad_kernel_antenna::nanovna::parse_s1p (cyclomatic 19) crates/vcad-kernel-antenna/src/nanovna.rs:33— vcad_kernel_antenna::nanovna::parse_s1p 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.
vcad_kernel_antenna::receipt::predicted_claims (cyclomatic 16) crates/vcad-kernel-antenna/src/receipt.rs:124— vcad_kernel_antenna::receipt::predicted_claims 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.
vcad_kernel_enclosure::mesh::extract_standoffs (cyclomatic 19) crates/vcad-kernel-enclosure/src/mesh.rs:338— vcad_kernel_enclosure::mesh::extract_standoffs 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.
vcad_kernel_enclosure::fit::check_lid_clearance (cyclomatic 16) crates/vcad-kernel-enclosure/src/fit.rs:559— vcad_kernel_enclosure::fit::check_lid_clearance 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.
vcad_kernel_tolerance::allocate::allocate (cyclomatic 17) crates/vcad-kernel-tolerance/src/allocate.rs:247— vcad_kernel_tolerance::allocate::allocate 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.
vcad_kernel_tolerance::economics::economics (cyclomatic 17) crates/vcad-kernel-tolerance/src/economics.rs:272— vcad_kernel_tolerance::economics::economics 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.
EditorModel.gizmoDragTo (cyclomatic 17) apple/VcadApp/Sources/VcadApp/Editor.swift:2383— EditorModel.gizmoDragTo 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.
EditorModel.gizmoDragTo (cyclomatic 17) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2383— EditorModel.gizmoDragTo 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.
EditorModel.installKeyMonitor (cyclomatic 17) apple/VcadApp/Sources/VcadApp/Editor.swift:3146— EditorModel.installKeyMonitor 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.
EditorModel.installKeyMonitor (cyclomatic 17) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3146— EditorModel.installKeyMonitor 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.
vcad_diff::recompose (cyclomatic 16) crates/vcad-diff/src/lib.rs:224— vcad_diff::recompose 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.
vcad_diff::merge (cyclomatic 16) crates/vcad-diff/src/lib.rs:585— vcad_diff::merge 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.
EditorModel.appendIRFeatures (cyclomatic 16) apple/VcadApp/Sources/VcadApp/Editor.swift:1803— EditorModel.appendIRFeatures 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.
EditorModel.appendIRFeatures (cyclomatic 16) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1803— EditorModel.appendIRFeatures 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.
EditorModel.beginGizmoDrag (cyclomatic 16) apple/VcadApp/Sources/VcadApp/Editor.swift:2343— EditorModel.beginGizmoDrag 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.
EditorModel.beginGizmoDrag (cyclomatic 16) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2343— EditorModel.beginGizmoDrag 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.
EditorModel.beginStepImport (cyclomatic 16) apple/VcadApp/Sources/VcadApp/Editor.swift:3615— EditorModel.beginStepImport 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.
EditorModel.beginStepImport (cyclomatic 16) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3615— EditorModel.beginStepImport 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.
FeatureRowView.menu (cyclomatic 16) apple/VcadApp/Sources/VcadApp/Shell.swift:710— FeatureRowView.menu 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: FeatureParamEditors.editors (cyclomatic 21) 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.
FeatureRowView.menu (cyclomatic 16) apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:710— FeatureRowView.menu 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: FeatureParamEditors.editors (cyclomatic 21) 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.
Skipped test: preserves B-rep for exact mounting plate example structure packages/engine/src/__tests__/evaluate.test.ts:319— Skipped — switched off by it.skip
Skipped test: detects clashes between overlapping instances packages/engine/src/__tests__/evaluate.test.ts:897— Skipped — switched off by it.skip
StepReader::read_solid (cognitive 122) crates/vcad-kernel-step/src/reader.rs:709— StepReader::read_solid has cognitive complexity 122 (threshold 15). Drivers by points: if/else 36 (86 pts), loops 13 (27 pts), match/switch 3 (8 pts), boolean chains 1 (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.
StepReader::anchored_solid_ids (cognitive 22) crates/vcad-kernel-step/src/reader.rs:543— StepReader::anchored_solid_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 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.
AccessMarket::build (cognitive 102) crates/vcad-ecad-pcb/src/router/flow/access.rs:195— AccessMarket::build has cognitive complexity 102 (threshold 15). Drivers by points: if/else 20 (65 pts), loops 13 (25 pts), boolean chains 12 (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.
AccessMarket::solve (cognitive 16) crates/vcad-ecad-pcb/src/router/flow/access.rs:451— AccessMarket::solve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_export::build_glb (cognitive 79) crates/vcad-kernel-export/src/lib.rs:250— vcad_kernel_export::build_glb has cognitive complexity 79 (threshold 15). Drivers by points: if/else 29 (49 pts), loops 9 (21 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.
vcad_kernel_export::build_stl (cognitive 20) crates/vcad-kernel-export/src/lib.rs:647— vcad_kernel_export::build_stl has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 1 (3 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DocumentGraph.parse (cognitive 79) apple/VcadApp/Sources/VcadApp/Document.swift:173— DocumentGraph.parse has cognitive complexity 79 (threshold 15). Drivers by points: if/else 20 (43 pts), boolean chains 22, loops 7 (14 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.
DocumentGraph.parse (cognitive 79) apple/VcadVision/Sources/VcadVision/Shared/Document.swift:173— DocumentGraph.parse has cognitive complexity 79 (threshold 15). Drivers by points: if/else 20 (43 pts), boolean chains 22, loops 7 (14 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.
AxisymMagnetostatics::build_system (cognitive 78) crates/vcad-kernel-em/src/axisym.rs:421— AxisymMagnetostatics::build_system has cognitive complexity 78 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 17 (36 pts), boolean chains 2 (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.
AxisymMagnetostatics::solve_nonlinear (cognitive 34) crates/vcad-kernel-em/src/axisym.rs:652— AxisymMagnetostatics::solve_nonlinear has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 5 (12 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.
KernelMesh.creasedNormals (cognitive 66) apple/VcadApp/Sources/VcadApp/Kernel.swift:93— KernelMesh.creasedNormals has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 11 (17 pts), boolean chains 7, ternaries 2 (nesting depth added 28). Of this number, 56 points are the body's own statements and 10 belong to 3 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.
KernelMesh.creasedNormals (cognitive 66) apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:93— KernelMesh.creasedNormals has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 11 (17 pts), boolean chains 7, ternaries 2 (nesting depth added 28). Of this number, 56 points are the body's own statements and 10 belong to 3 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.
vcad_kernel_adjoint::couple::solve_coupled (cognitive 63) crates/vcad-kernel-adjoint/src/couple.rs:287— vcad_kernel_adjoint::couple::solve_coupled has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 9 (17 pts), boolean chains 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_adjoint::validate::fd_sweep (cognitive 18) crates/vcad-kernel-adjoint/src/validate.rs:175— vcad_kernel_adjoint::validate::fd_sweep has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, boolean chains 1, match/switch 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.
vcad_design_constraints::lower::write_back_group (cognitive 62) crates/vcad-design-constraints/src/lower.rs:800— vcad_design_constraints::lower::write_back_group has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (47 pts), loops 4 (8 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 39). 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.
vcad_design_constraints::lower::run (cognitive 55) crates/vcad-design-constraints/src/lower.rs:614— vcad_design_constraints::lower::run has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (33 pts), match/switch 6 (12 pts), loops 6 (7 pts), boolean chains 3 (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.
Server::handle_modern (cognitive 58) crates/vcad-mcp/src/server.rs:818— Server::handle_modern has cognitive complexity 58 (threshold 15). Drivers by points: if/else 28 (38 pts), match/switch 10 (18 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.
Server::call_tool_inner (cognitive 31) crates/vcad-mcp/src/server.rs:521— Server::call_tool_inner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 4 (6 pts), loops 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.
Problem::sample (cognitive 57) crates/vcad-eval/src/optimize.rs:1172— Problem::sample has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 11 (20 pts), match/switch 3 (9 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.
Problem::new (cognitive 23) crates/vcad-eval/src/optimize.rs:849— Problem::new has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerCdt::build (cognitive 54) crates/vcad-ecad-pcb/src/router/flow/cdt.rs:532— LayerCdt::build has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 14 (20 pts), boolean chains 6, match/switch 1 (2 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.
LayerCdt::walk (cognitive 29) crates/vcad-ecad-pcb/src/router/flow/cdt.rs:850— LayerCdt::walk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
DocumentGraph.paramSummary (cognitive 53) apple/VcadApp/Sources/VcadApp/Document.swift:560— DocumentGraph.paramSummary has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 10, match/switch 1, ternaries 1 (nesting depth added 20). Of this number, 48 points are the body's own statements and 5 belong to 2 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.
DocumentGraph.paramSummary (cognitive 53) apple/VcadVision/Sources/VcadVision/Shared/Document.swift:560— DocumentGraph.paramSummary has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 10, match/switch 1, ternaries 1 (nesting depth added 20). Of this number, 48 points are the body's own statements and 5 belong to 2 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.
ecad.addMotorWinding::feedClear (cognitive 53) packages/mcp/src/tools/ecad.ts:12102— ecad.addMotorWinding::feedClear has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 8 (15 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. This shape REPEATS in the file: 2 other methods here (ecad.addMotorWinding, ecad.addMotorWinding::buildFeed) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
ecad.addMotorWinding::buildFeed (cognitive 17) packages/mcp/src/tools/ecad.ts:12050— ecad.addMotorWinding::buildFeed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, loops 3 (6 pts), boolean chains 2, ternaries 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. This shape REPEATS in the file: 2 other methods here (ecad.addMotorWinding, ecad.addMotorWinding::feedClear) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
EditorModel.startBackgroundEvaluation (cognitive 51) apple/VcadApp/Sources/VcadApp/Editor.swift:4268— EditorModel.startBackgroundEvaluation has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 8, ternaries 2 (4 pts), loops 2 (3 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.
EditorModel.startBackgroundEvaluation (cognitive 51) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4268— EditorModel.startBackgroundEvaluation has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 8, ternaries 2 (4 pts), loops 2 (3 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.
EditorModel.finishSketch (cognitive 50) apple/VcadApp/Sources/VcadApp/Editor.swift:2156— EditorModel.finishSketch has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 3 (9 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.finishSketch (cognitive 50) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2156— EditorModel.finishSketch has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 3 (9 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WireField::surface_residual (cognitive 49) crates/vcad-kernel-particle/src/bem.rs:821— WireField::surface_residual has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WireField::evaluate (cognitive 23) crates/vcad-kernel-particle/src/bem.rs:713— WireField::evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (5 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.
vcad_runtime::run (cognitive 49) crates/vcad-runtime/src/lib.rs:553— vcad_runtime::run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (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.
vcad_runtime::evaluator (cognitive 17) crates/vcad-runtime/src/lib.rs:385— vcad_runtime::evaluator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StepWriter::write_loops (cognitive 46) crates/vcad-kernel-step/src/writer.rs:845— StepWriter::write_loops has cognitive complexity 46 (threshold 15). Drivers by points: loops 7 (23 pts), if/else 7 (19 pts), boolean chains 4 (nesting depth added 28). 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.
StepWriter::write_orphan_run (cognitive 18) crates/vcad-kernel-step/src/writer.rs:1003— StepWriter::write_orphan_run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 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.
schematic-hierarchy.flattenSchematic::elaborate (cognitive 39) packages/mcp/src/tools/schematic-hierarchy.ts:150— schematic-hierarchy.flattenSchematic::elaborate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 10 (12 pts), ternaries 3 (9 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. This shape REPEATS in the file: one other method here (schematic-hierarchy.flattenSchematic::elaborateAll) 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.
schematic-hierarchy.flattenSchematic::elaborateAll (cognitive 17) packages/mcp/src/tools/schematic-hierarchy.ts:111— schematic-hierarchy.flattenSchematic::elaborateAll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (schematic-hierarchy.flattenSchematic::elaborate) 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.
Ctx::elaborate (cognitive 37) crates/vcad-ecad-schematic/src/hierarchy.rs:205— Ctx::elaborate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 9 (10 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.
Ctx::elaborate_all (cognitive 18) crates/vcad-ecad-schematic/src/hierarchy.rs:129— Ctx::elaborate_all has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PairProblem::add_clearance (cognitive 36) crates/vcad-ecad-pcb/src/router/descent.rs:605— PairProblem::add_clearance has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 5 (13 pts), boolean chains 3, match/switch 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.
PairProblem::build_pinned (cognitive 26) crates/vcad-ecad-pcb/src/router/descent.rs:417— PairProblem::build_pinned has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (6 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.
EditorModel.tools (cognitive 36) apple/VcadApp/Sources/VcadApp/Editor.swift:3882— EditorModel.tools has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 7 (16 pts), boolean chains 2, 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.
EditorModel.tools (cognitive 36) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3882— EditorModel.tools has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 7 (16 pts), boolean chains 2, 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.
vcad_kernel_calibration::build_calibration_report (cognitive 35) crates/vcad-kernel-calibration/src/lib.rs:492— vcad_kernel_calibration::build_calibration_report has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 5, 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.
vcad_kernel_calibration::canonical_stringify (cognitive 18) crates/vcad-kernel-calibration/src/lib.rs:385— vcad_kernel_calibration::canonical_stringify has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), 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.
CircuitEnv::attempt_step (cognitive 34) crates/vcad-ecad-sim/src/circuit/mod.rs:500— CircuitEnv::attempt_step has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 5 (12 pts), loops 5 (8 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.
CircuitEnv::step_adaptive (cognitive 21) crates/vcad-ecad-sim/src/circuit/mod.rs:395— CircuitEnv::step_adaptive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocEdit.patternInstancing (cognitive 33) apple/VcadApp/Sources/VcadApp/Document.swift:710— DocEdit.patternInstancing has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (13 pts), loops 2 (4 pts) (nesting depth added 6). Of this number, 29 points are the body's own statements and 4 belong to one function item 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.
DocEdit.patternInstancing (cognitive 33) apple/VcadVision/Sources/VcadVision/Shared/Document.swift:710— DocEdit.patternInstancing has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (13 pts), loops 2 (4 pts) (nesting depth added 6). Of this number, 29 points are the body's own statements and 4 belong to one function item 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.
StreamingMesh.update (cognitive 33) apple/VcadApp/Sources/VcadApp/Kernel.swift:300— StreamingMesh.update has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, loops 5 (9 pts), ternaries 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.
StreamingMesh.update (cognitive 33) apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:300— StreamingMesh.update has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, loops 5 (9 pts), ternaries 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.
vcad_kernel_physics::world::solve_contacts_pgs (cognitive 32) crates/vcad-kernel-physics/src/world.rs:2070— vcad_kernel_physics::world::solve_contacts_pgs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 5 (13 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.
vcad_kernel_physics::diff::rollout_gradient_with_anchors (cognitive 17) crates/vcad-kernel-physics/src/diff.rs:381— vcad_kernel_physics::diff::rollout_gradient_with_anchors has cognitive complexity 17 (threshold 15). Drivers by points: loops 9 (16 pts), if/else 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_torture::run (cognitive 32) crates/vcad-torture/src/main.rs:173— vcad_torture::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 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.
vcad_torture::run_one_isolated (cognitive 29) crates/vcad-torture/src/main.rs:79— vcad_torture::run_one_isolated has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.documentScene (cognitive 32) apple/VcadApp/Sources/VcadApp/Editor.swift:4451— EditorModel.documentScene has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 9 (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.
EditorModel.documentScene (cognitive 32) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4451— EditorModel.documentScene has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 9 (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.
Probe::new (cognitive 31) crates/vcad-kernel-dfm/src/geom/probe.rs:82— Probe::new has cognitive complexity 31 (threshold 15). Drivers by points: loops 10 (18 pts), if/else 5 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). 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.
Probe::first_hit (cognitive 20) crates/vcad-kernel-dfm/src/geom/probe.rs:288— Probe::first_hit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.assemblyScene (cognitive 31) apple/VcadApp/Sources/VcadApp/Editor.swift:4560— EditorModel.assemblyScene has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 11). Of this number, 28 points are the body's own statements and 3 belong to 2 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.
EditorModel.assemblyScene (cognitive 31) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4560— EditorModel.assemblyScene has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 11). Of this number, 28 points are the body's own statements and 3 belong to 2 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.
component (cognitive 31) www/public/kit/gallery.js:546— component has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 11 (26 pts), loops 2 (4 pts), 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.
component (cognitive 31) packages/app/public/launch/launch.js:373— component has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 11 (26 pts), loops 2 (4 pts), 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.
InspectorView.body (cognitive 29) apple/VcadApp/Sources/VcadApp/VisionShell.swift:13— InspectorView.body has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 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.
InspectorView.body (cognitive 29) apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:13— InspectorView.body has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 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.
RouteSession::probe (cognitive 28) crates/vcad-ecad-pcb/src/session.rs:840— RouteSession::probe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RouteSession::from_pcb (cognitive 24) crates/vcad-ecad-pcb/src/session.rs:282— RouteSession::from_pcb has cognitive complexity 24 (threshold 15). Drivers by points: loops 11 (16 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 8). 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.
vcad_embroidery::digitize::fill::fill_stitch_multi (cognitive 27) crates/vcad-embroidery/src/digitize/fill.rs:80— vcad_embroidery::digitize::fill::fill_stitch_multi has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (11 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.
vcad_embroidery::digitize::running::running_stitch (cognitive 16) crates/vcad-embroidery/src/digitize/running.rs:26— vcad_embroidery::digitize::running::running_stitch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeatureRowView.menu (cognitive 27) apple/VcadApp/Sources/VcadApp/Shell.swift:710— FeatureRowView.menu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6 (12 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeatureRowView.menu (cognitive 27) apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:710— FeatureRowView.menu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6 (12 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dressBoard (cognitive 27) www/public/kit/gallery.js:599— dressBoard has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (13 pts), loops 6 (10 pts), boolean chains 2, if/else 2 (nesting depth added 11). None of this is in the body itself: all 27 points belong to 2 function items inside it that branch (a function literal at line 600, (anonymous)::mat). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dressBoard (cognitive 27) packages/app/public/launch/launch.js:426— dressBoard has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (13 pts), loops 6 (10 pts), boolean chains 2, if/else 2 (nesting depth added 11). None of this is in the body itself: all 27 points belong to 2 function items inside it that branch (a function literal at line 427, (anonymous)::mat). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vcad_embroidery_pes::pec::decode_stitch_delta (cognitive 26) crates/vcad-embroidery-pes/src/pec.rs:124— vcad_embroidery_pes::pec::decode_stitch_delta has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (26 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.
vcad_embroidery_pes::pec::read_pec (cognitive 17) crates/vcad-embroidery-pes/src/pec.rs:17— vcad_embroidery_pes::pec::read_pec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 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.
vcad_kernel_gpu::wavefront_batch::distance_fields_batch_async (cognitive 26) crates/vcad-kernel-gpu/src/wavefront_batch.rs:74— vcad_kernel_gpu::wavefront_batch::distance_fields_batch_async has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (8 pts), boolean chains 2, match/switch 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.
vcad_kernel_gpu::decimate::cpu_decimate (cognitive 25) crates/vcad-kernel-gpu/src/decimate.rs:391— vcad_kernel_gpu::decimate::cpu_decimate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (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.
vcad_embroidery_dst::reader::decode_record (cognitive 25) crates/vcad-embroidery-dst/src/reader.rs:31— vcad_embroidery_dst::reader::decode_record has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, boolean chains 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.
vcad_embroidery_dst::writer::encode_record (cognitive 22) crates/vcad-embroidery-dst/src/writer.rs:67— vcad_embroidery_dst::writer::encode_record has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorModel.beginStepImport (cognitive 25) apple/VcadApp/Sources/VcadApp/Editor.swift:3615— EditorModel.beginStepImport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, 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.
EditorModel.beginStepImport (cognitive 25) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3615— EditorModel.beginStepImport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, 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.
FeatureRowView.row (cognitive 25) apple/VcadApp/Sources/VcadApp/Shell.swift:620— FeatureRowView.row has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, ternaries 8 (11 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FeatureRowView.row (cognitive 25) apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:620— FeatureRowView.row has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, ternaries 8 (11 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DocumentCommands.body (cognitive 24) apple/VcadApp/Sources/VcadApp/Shell.swift:176— DocumentCommands.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 5 (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.
DocumentCommands.body (cognitive 24) apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:176— DocumentCommands.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 5 (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.
EditorModel.gizmoDragTo (cognitive 22) apple/VcadApp/Sources/VcadApp/Editor.swift:2383— EditorModel.gizmoDragTo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, match/switch 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.gizmoDragTo (cognitive 22) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2383— EditorModel.gizmoDragTo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, match/switch 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_assembly::interference::check_interference (cognitive 21) crates/vcad-kernel-assembly/src/interference.rs:123— vcad_kernel_assembly::interference::check_interference has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 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.
vcad_kernel_assembly::joint_range::check_joint_range (cognitive 16) crates/vcad-kernel-assembly/src/joint_range.rs:184— vcad_kernel_assembly::joint_range::check_joint_range has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4, boolean chains 2, match/switch 2 (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.
EditorModel.appendIRFeatures (cognitive 21) apple/VcadApp/Sources/VcadApp/Editor.swift:1803— EditorModel.appendIRFeatures has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, 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.
EditorModel.appendIRFeatures (cognitive 21) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1803— EditorModel.appendIRFeatures has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, 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.
EditorModel.currentKernelMeshes (cognitive 20) apple/VcadApp/Sources/VcadApp/Editor.swift:2925— EditorModel.currentKernelMeshes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), ternaries 1 (2 pts), 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.
EditorModel.currentKernelMeshes (cognitive 20) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2925— EditorModel.currentKernelMeshes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), ternaries 1 (2 pts), 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.
Grid::cast_filtered (cognitive 19) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:985— Grid::cast_filtered has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, 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.
Grid::inside_other_shell (cognitive 16) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:943— Grid::inside_other_shell has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.installKeyMonitor (cognitive 19) apple/VcadApp/Sources/VcadApp/Editor.swift:3146— EditorModel.installKeyMonitor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4 (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.
EditorModel.installKeyMonitor (cognitive 19) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3146— EditorModel.installKeyMonitor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4 (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.
EditorModel.tessellateDocumentParts (cognitive 18) apple/VcadApp/Sources/VcadApp/Editor.swift:2875— EditorModel.tessellateDocumentParts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.tessellateDocumentParts (cognitive 18) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2875— EditorModel.tessellateDocumentParts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KernelMesh.normalsTrustworthy (cognitive 17) apple/VcadApp/Sources/VcadApp/Kernel.swift:63— KernelMesh.normalsTrustworthy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KernelMesh.normalsTrustworthy (cognitive 17) apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:63— KernelMesh.normalsTrustworthy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.beginGizmoDrag (cognitive 16) apple/VcadApp/Sources/VcadApp/Editor.swift:2343— EditorModel.beginGizmoDrag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 2 (4 pts), 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.
EditorModel.beginGizmoDrag (cognitive 16) apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2343— EditorModel.beginGizmoDrag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 2 (4 pts), 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.
TooManyFunctions: vcad_kernel_wasm crates/vcad-kernel-wasm/src/lib.rs:60— TooManyFunctions — 137 free functions. The bar is 30 free functions; this is 107 over it, 4.57× 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: vcad_kernel_wasm::ecad_wasm crates/vcad-kernel-wasm/src/lib.rs:6326— TooManyFunctions — 48 free functions. The bar is 30 free functions; this is 18 over it, 1.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.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/vcad-atoms/src/fab.rs:225— crates/vcad-atoms/src/fab.rs:225-235 | crates/vcad-ffi/src/fea.rs:256-278 | crates/vcad-kernel-assembly/src/pose.rs:304-317 | crates/vcad-kernel-fea/src/modal.rs:1142-1174 | crates/vcad-mcp/src/tools/core.rs:307-377 | crates/vcad-render/src/animate.rs:512-532 | crates/vcad-render/src/report.rs:307-336 | crates/vcad-sound/src/lib.rs:431-440 | crates/vcad-typst/src/lib.rs:270-320 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/vcad-kernel-booleans/src/split.rs:340— crates/vcad-kernel-booleans/src/split.rs:340-852 | crates/vcad-kernel-booleans/src/split.rs:1350-1902 | crates/vcad-kernel-booleans/src/split.rs:2713-3165 | crates/vcad-kernel-booleans/src/split.rs:4802-5123 | crates/vcad-kernel-booleans/src/split.rs:5148-5386 | crates/vcad-kernel-booleans/src/split.rs:5394-5527 | crates/vcad-kernel-booleans/src/split.rs:5560-5733 | crates/vcad-kernel-booleans/src/split.rs:6055-6350 | crates/vcad-kernel-booleans/src/split.rs:6685-6883 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/vcad-kernel-booleans/src/mesh/csg.rs:90— crates/vcad-kernel-booleans/src/mesh/csg.rs:90-111 | crates/vcad-kernel-fillet/src/fillet_planar.rs:255-282 | crates/vcad-kernel-shell/src/lib.rs:903-914 | crates/vcad-kernel-sketch/src/extrude.rs:1317-1337 | crates/vcad-kernel-sweep/src/loft.rs:329-349 | crates/vcad-kernel-sweep/src/sweep.rs:408-428 | crates/vcad-kernel-tessellate/src/lib.rs:2902-2911 — 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) crates/vcad-kernel-sketch/src/extrude.rs:178— crates/vcad-kernel-sketch/src/extrude.rs:178-365 | crates/vcad-kernel-sketch/src/extrude.rs:552-746 | crates/vcad-kernel-sketch/src/extrude.rs:778-952 | crates/vcad-kernel-sketch/src/extrude.rs:1075-1261 | crates/vcad-kernel-sketch/src/revolve.rs:65-331 | crates/vcad-kernel-sweep/src/loft.rs:128-241 | crates/vcad-kernel-sweep/src/sweep.rs:127-336 — 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· Edited copy of a member (72 corresponding lines) · ×2
Edited copy of a member (72 corresponding lines) apple/VcadApp/Sources/VcadApp/Shell.swift:620— apple/VcadApp/Sources/VcadApp/Shell.swift:620-691 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:620-691 — These two members are one piece of code written twice and then edited apart: 72 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 (72 corresponding lines) crates/vcad-kernel-diff/src/synthesize.rs:237— crates/vcad-kernel-diff/src/synthesize.rs:237-321 | crates/vcad-kernel-diff/src/synthesize.rs:355-426 — These two members are one piece of code written twice and then edited apart: 72 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 (51 corresponding lines) · ×2
Edited copy of a member (51 corresponding lines) crates/vcad-render/src/lib.rs:2357— crates/vcad-render/src/lib.rs:2357-2407 | crates/vcad-render/src/lib.rs:4686-4754 — These two members are one piece of code written twice and then edited apart: 51 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 (51 corresponding lines) crates/vcad-ecad-sim/src/circuit/ac.rs:134— crates/vcad-ecad-sim/src/circuit/ac.rs:134-184 | crates/vcad-ecad-sim/src/circuit/linalg.rs:13-64 — These two members are one piece of code written twice and then edited apart: 51 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 (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) crates/vcad-ecad-symbols/src/altium/mod.rs:1019— crates/vcad-ecad-symbols/src/altium/mod.rs:1019-1050 | crates/vcad-ecad-symbols/src/eagle_brd.rs:363-395 — These two members are one piece of code written twice and then edited apart: 32 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 (32 corresponding lines) crates/vcad-ecad-sim/src/circuit/receipt.rs:218— crates/vcad-ecad-sim/src/circuit/receipt.rs:218-249 | crates/vcad-kernel-photon-dose/src/receipt.rs:356-390 — These two members are one piece of code written twice and then edited apart: 32 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 (49 corresponding lines) · ×2
Edited copy of a member (49 corresponding lines) crates/vcad-torture/src/lib.rs:343— crates/vcad-torture/src/lib.rs:343-405 | crates/vcad-torture/src/lib.rs:519-567 — These two members are one piece of code written twice and then edited apart: 49 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 (49 corresponding lines) crates/vcad-kernel-primitives/src/lib.rs:526— crates/vcad-kernel-primitives/src/lib.rs:526-586 | crates/vcad-kernel-primitives/src/lib.rs:730-778 — These two members are one piece of code written twice and then edited apart: 49 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 (26 corresponding lines) · ×2
Edited copy of a member (26 corresponding lines) crates/vcad-ffi/src/engine.rs:61— crates/vcad-ffi/src/engine.rs:61-86 | crates/vcad-ffi/src/engine.rs:94-123 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) packages/training/src/modal/eval.py:148— packages/training/src/modal/eval.py:148-173 | packages/training/src/modal/train.py:281-319 — These two members are one piece of code written twice and then edited apart: 26 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 (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) crates/vcad-kernel-cam/src/dropcutter/bull.rs:97— crates/vcad-kernel-cam/src/dropcutter/bull.rs:97-125 | crates/vcad-kernel-cam/src/dropcutter/flat.rs:56-85 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) crates/vcad-kernel-step/src/entities/curves.rs:268— crates/vcad-kernel-step/src/entities/curves.rs:268-296 | crates/vcad-kernel-step/src/entities/surfaces.rs:442-472 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×2
Edited copies of one member (3 members, 21+ corresponding lines) crates/vcad-kernel-stocksim/src/verify.rs:262— crates/vcad-kernel-stocksim/src/verify.rs:262-282 | crates/vcad-kernel-tessellate/src/clearance.rs:414-441 | crates/vcad-kernel-tessellate/src/clearance.rs:756-785 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) crates/vcad-ir/src/vcode.rs:1587— crates/vcad-ir/src/vcode.rs:1587-1607 | crates/vcad-ir/src/vcode.rs:1610-1630 | crates/vcad-ir/src/vcode.rs:1633-1653 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×2
Edited copies of one member (3 members, 22+ corresponding lines) crates/vcad-ecad-pcb/src/dfm.rs:516— crates/vcad-ecad-pcb/src/dfm.rs:516-537 | crates/vcad-ecad-pcb/src/drc.rs:1447-1471 | crates/vcad-eval/src/evaluate.rs:3477-3500 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) crates/vcad-kernel-fea/src/buckling.rs:1769— crates/vcad-kernel-fea/src/buckling.rs:1769-1790 | crates/vcad-kernel-fea/src/section.rs:1009-1030 | crates/vcad-kernel-fea/src/shell.rs:845-873 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 10+ corresponding lines) · ×2
Edited copies of one member (6 members, 10+ corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:10826— crates/vcad-kernel-wasm/src/lib.rs:10826-10836 | crates/vcad-kernel-wasm/src/lib.rs:11202-11211 | crates/vcad-kernel-wasm/src/lib.rs:11220-11229 | crates/vcad-kernel-wasm/src/lib.rs:11240-11249 | crates/vcad-kernel-wasm/src/lib.rs:11259-11269 | crates/vcad-kernel-wasm/src/lib.rs:11286-11301 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 10+ corresponding lines) crates/vcad-ecad-pcb/src/drc.rs:1937— crates/vcad-ecad-pcb/src/drc.rs:1937-1949 | crates/vcad-ir/src/ecad.rs:1568-1579 | crates/vcad-kernel-raytrace/src/trim.rs:532-543 | crates/vcad-kernel-sheet/src/poly2d.rs:110-121 | crates/vcad-kernel-sheet/src/unfold.rs:361-372 | crates/vcad-render/src/pcb.rs:768-777 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:614— crates/vcad-kernel-geom/src/lib.rs:614-622 | crates/vcad-kernel-geom/src/lib.rs:625-632 | crates/vcad-kernel-geom/src/lib.rs:643-649 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/vcad-kernel-neutronics/src/rng.rs:12— crates/vcad-kernel-neutronics/src/rng.rs:12-18 | crates/vcad-kernel-qcd/src/rng.rs:10-16 | crates/vcad-torture/src/lib.rs:292-298 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×2
Edited copies of one member (4 members, 12+ corresponding lines) crates/vcad-kernel-diff/src/implicit.rs:407— crates/vcad-kernel-diff/src/implicit.rs:407-418 | crates/vcad-kernel-diff/src/implicit.rs:425-438 | crates/vcad-kernel-diff/src/implicit.rs:445-456 | crates/vcad-kernel-diff/src/implicit.rs:463-474 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) crates/vcad-parts/src/types.rs:243— crates/vcad-parts/src/types.rs:243-254 | crates/vcad-parts/src/types.rs:257-268 | crates/vcad-parts/src/types.rs:271-283 | crates/vcad-parts/src/types.rs:286-297 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:3398— crates/vcad-kernel-wasm/src/lib.rs:3398-3405 | crates/vcad-kernel-wasm/src/lib.rs:3431-3448 | crates/vcad-kernel-wasm/src/lib.rs:3467-3474 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/vcad-kernel-booleans/src/no_crossing.rs:220— crates/vcad-kernel-booleans/src/no_crossing.rs:220-228 | crates/vcad-kernel-features/src/lib.rs:489-498 | crates/vcad-kernel-step/src/entities/surfaces.rs:1266-1273 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:635— crates/vcad-kernel-geom/src/lib.rs:635-640 | crates/vcad-kernel-geom/src/lib.rs:806-811 | crates/vcad-kernel-geom/src/lib.rs:994-1000 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/vcad-kernel-drafting/src/sheet.rs:768— crates/vcad-kernel-drafting/src/sheet.rs:768-773 | crates/vcad-kernel-drafting/src/sheet.rs:776-784 | crates/vcad-kernel-drafting/src/sheet.rs:790-798 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×2
Edited copies of one member (4 members, 4+ corresponding lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1856— apple/VcadApp/Sources/VcadApp/Editor.swift:1856-1859 | apple/VcadApp/Sources/VcadApp/Editor.swift:3818-3821 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1856-1859 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3818-3821 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) crates/vcad-ecad-pcb/src/router/auto.rs:3960— crates/vcad-ecad-pcb/src/router/auto.rs:3960-3963 | crates/vcad-ecad-pcb/src/router/maze.rs:60-63 | crates/vcad-kernel-booleans/src/cyl_band.rs:95-98 | crates/vcad-kernel-booleans/src/split.rs:122-125 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 3+ corresponding lines) · ×2
Edited copies of one member (6 members, 3+ corresponding lines) crates/vcad-app/src/tools.rs:852— crates/vcad-app/src/tools.rs:852-854 | crates/vcad-kernel-antenna/src/geometry.rs:37-39 | crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:253-255 | crates/vcad-kernel-flow/src/model.rs:620-622 | crates/vcad-kernel-tolerance/src/loops.rs:110-112 | crates/vcad-printcheck/src/checks.rs:777-779 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 3+ corresponding lines) crates/vcad-eval/src/optimize.rs:1532— crates/vcad-eval/src/optimize.rs:1532-1534 | crates/vcad-kernel-acoustics/src/instrument.rs:485-487 | crates/vcad-kernel-em/src/axisym.rs:840-846 | crates/vcad-kernel-fea/src/modal.rs:456-458 | crates/vcad-kernel-fea/src/solve.rs:552-554 | crates/vcad-kernel-topopt/src/fea.rs:388-390 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Duplicated block (46 lines × 2) crates/vcad-kernel-stocksim/src/verify.rs:296— crates/vcad-kernel-stocksim/src/verify.rs:296-341 | crates/vcad-kernel-tessellate/src/clearance.rs:499-544 — before extracting anything, compare `crates/vcad-kernel-stocksim/src/verify.rs` and `crates/vcad-kernel-tessellate/src/clearance.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (46 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:506— apple/VcadApp/Sources/VcadApp/Shell.swift:506-551 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:506-551 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 (35 lines × 2) crates/vcad-kernel-booleans/src/trim.rs:434— crates/vcad-kernel-booleans/src/trim.rs:434-468 | crates/vcad-kernel-booleans/src/trim.rs:556-590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/trim.rs:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (35 lines × 2) apple/VcadApp/Sources/VcadApp/SimPanel.swift:153— apple/VcadApp/Sources/VcadApp/SimPanel.swift:153-187 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:153-187 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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 × 2) crates/vcad-kernel-booleans/src/pipeline.rs:1587— crates/vcad-kernel-booleans/src/pipeline.rs:1587-1611 | crates/vcad-kernel-booleans/src/pipeline.rs:1613-1637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/pipeline.rs:1587` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1973— apple/VcadApp/Sources/VcadApp/Editor.swift:1973-1997 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1973-1997 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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) crates/vcad-kernel-sketch/src/revolve.rs:313— crates/vcad-kernel-sketch/src/revolve.rs:313-331 | crates/vcad-kernel-sweep/src/loft.rs:224-241 — before extracting anything, compare `crates/vcad-kernel-sketch/src/revolve.rs` and `crates/vcad-kernel-sweep/src/loft.rs` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/revolve.rs:313` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) crates/vcad-kernel-wasm/src/lib.rs:5068— crates/vcad-kernel-wasm/src/lib.rs:5068-5086 | crates/vcad-kernel-wasm/src/lib.rs:5127-5144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:5068` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17–18 lines × 2) crates/vcad-ecad-pcb/src/router/length_match.rs:233— crates/vcad-ecad-pcb/src/router/length_match.rs:233-250 | crates/vcad-ecad-pcb/src/router/length_match.rs:710-726 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/length_match.rs:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) crates/vcad-kernel-booleans/src/mesh/csg.rs:626— crates/vcad-kernel-booleans/src/mesh/csg.rs:626-643 | crates/vcad-kernel-tessellate/src/lib.rs:8930-8946 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/csg.rs` and `crates/vcad-kernel-tessellate/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/csg.rs:626` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–17 lines × 2) crates/vcad-kernel-cam/src/dropcutter/bull.rs:112— crates/vcad-kernel-cam/src/dropcutter/bull.rs:112-125 | crates/vcad-kernel-cam/src/dropcutter/flat.rs:69-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/dropcutter/bull.rs:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 2) crates/vcad-kernel-step/src/pmi.rs:127— crates/vcad-kernel-step/src/pmi.rs:127-143 | crates/vcad-kernel-step/src/pmi.rs:147-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-step/src/pmi.rs:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/vcad-ecad-pcb/src/router/flow/funnel.rs:56— crates/vcad-ecad-pcb/src/router/flow/funnel.rs:56-71 | crates/vcad-ecad-pcb/src/router/flow/funnel.rs:75-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/flow/funnel.rs:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/vcad-kernel-booleans/src/trim.rs:784— crates/vcad-kernel-booleans/src/trim.rs:784-798 | crates/vcad-kernel-booleans/src/trim.rs:822-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1468— crates/vcad-kernel-booleans/src/split.rs:1468-1482 | crates/vcad-kernel-booleans/src/split.rs:1677-1689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1468` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–15 lines × 2) crates/vcad-kernel-booleans/src/split.rs:1590— crates/vcad-kernel-booleans/src/split.rs:1590-1602 | crates/vcad-kernel-booleans/src/split.rs:1867-1881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1590` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–14 lines × 2) crates/vcad-app/src/materializer.rs:1187— crates/vcad-app/src/materializer.rs:1187-1200 | crates/vcad-app/src/materializer.rs:1243-1252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/materializer.rs:1187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–14 lines × 2) crates/vcad-sim/src/batch.rs:217— crates/vcad-sim/src/batch.rs:217-230 | crates/vcad-sim/src/batch.rs:256-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-sim/src/batch.rs:266` calls `Ok`, `batch_observe` and `crates/vcad-sim/src/batch.rs:233` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–14 lines × 2) crates/vcad-ecad-symbols/src/builtin.rs:30— crates/vcad-ecad-symbols/src/builtin.rs:30-41 | crates/vcad-ecad-symbols/src/footprint.rs:76-89 — before extracting anything, compare `crates/vcad-ecad-symbols/src/builtin.rs` and `crates/vcad-ecad-symbols/src/footprint.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-symbols/src/builtin.rs:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–14 lines × 2) crates/vcad-kernel-booleans/src/mesh/mod.rs:114— crates/vcad-kernel-booleans/src/mesh/mod.rs:114-125 | crates/vcad-kernel-shell/src/lib.rs:1270-1283 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/mod.rs` and `crates/vcad-kernel-shell/src/lib.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/mod.rs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 4) crates/vcad-ecad-pcb/src/router/descent.rs:926— crates/vcad-ecad-pcb/src/router/descent.rs:926-938 | crates/vcad-ecad-pcb/src/router/mod.rs:435-447 | crates/vcad-ecad-pcb/src/router/pair.rs:1498-1510 | crates/vcad-ecad-pcb/src/router/pair.rs:1606-1618 — 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 (13 lines × 4) crates/vcad-ecad-export/src/gerber.rs:712— crates/vcad-ecad-export/src/gerber.rs:712-724 | crates/vcad-ecad-export/src/gerber.rs:745-757 | crates/vcad-ecad-export/src/gerber.rs:786-798 | crates/vcad-ecad-export/src/gerber.rs:852-864 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-export/src/gerber.rs:712` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 3) crates/vcad-ffi/src/lib.rs:1428— crates/vcad-ffi/src/lib.rs:1428-1440 | crates/vcad-ffi/src/lib.rs:1464-1474 | crates/vcad-ffi/src/lib.rs:2281-2291 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:1428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 3) crates/vcad-kernel-acoustics/src/optimize.rs:103— crates/vcad-kernel-acoustics/src/optimize.rs:103-114 | crates/vcad-kernel-particle/src/optimize.rs:109-121 | crates/vcad-kernel-particle/src/optimize.rs:188-198 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-particle/src/optimize.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–12 lines × 3) crates/vcad-kernel-booleans/src/cyl_band.rs:670— crates/vcad-kernel-booleans/src/cyl_band.rs:670-678 | crates/vcad-kernel-tessellate/src/lib.rs:4838-4849 | crates/vcad-kernel-tessellate/src/lib.rs:6940-6949 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/cyl_band.rs:670` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–12 lines × 3) crates/vcad-kernel-geom/src/lib.rs:211— crates/vcad-kernel-geom/src/lib.rs:211-219 | crates/vcad-kernel-geom/src/lib.rs:1460-1468 | crates/vcad-kernel-sweep/src/frenet.rs:83-94 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-geom/src/lib.rs:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 6) crates/vcad-kernel-acoustics/src/receipt.rs:266— crates/vcad-kernel-acoustics/src/receipt.rs:266-276 | crates/vcad-kernel-em/src/receipt.rs:375-385 | crates/vcad-kernel-flow/src/receipt.rs:289-299 | crates/vcad-kernel-particle/src/receipt.rs:383-393 | crates/vcad-kernel-thermal/src/receipt.rs:429-439 | crates/vcad-kernel-tolerance/src/receipt.rs:302-312 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-em/src/receipt.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:266` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 6) crates/vcad-ir/src/vcode.rs:1806— crates/vcad-ir/src/vcode.rs:1806-1816 | crates/vcad-ir/src/vcode.rs:1878-1888 | crates/vcad-ir/src/vcode.rs:1965-1975 | crates/vcad-ir/src/vcode.rs:1982-1992 | crates/vcad-ir/src/vcode.rs:1999-2009 | crates/vcad-ir/src/vcode.rs:2021-2031 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ir/src/vcode.rs:1806` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ir/src/vcode.rs:1963` calls `parse_u64` and `crates/vcad-ir/src/vcode.rs:1804` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 3) crates/vcad-ecad-sim/src/circuit/ac.rs:141— crates/vcad-ecad-sim/src/circuit/ac.rs:141-150 | crates/vcad-ecad-sim/src/circuit/linalg.rs:20-30 | crates/vcad-kernel-acoustics/src/linalg.rs:50-60 — before extracting anything, compare `crates/vcad-ecad-sim/src/circuit/ac.rs` and `crates/vcad-ecad-sim/src/circuit/linalg.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-sim/src/circuit/ac.rs:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&mut [Cplx]` in one and `&mut [f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10–11 lines × 3) crates/vcad-kernel-gpu/src/wavefront.rs:325— crates/vcad-kernel-gpu/src/wavefront.rs:325-335 | crates/vcad-kernel-gpu/src/wavefront.rs:680-690 | crates/vcad-kernel-gpu/src/wavefront.rs:701-710 — 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–9 lines × 9) crates/vcad-kernel-booleans/src/split.rs:1525— crates/vcad-kernel-booleans/src/split.rs:1525-1532 | crates/vcad-kernel-booleans/src/split.rs:1770-1778 | crates/vcad-kernel-booleans/src/split.rs:1798-1806 | crates/vcad-kernel-booleans/src/split.rs:3067-3074 | crates/vcad-kernel-booleans/src/split.rs:3081-3088 | crates/vcad-kernel-booleans/src/split.rs:5084-5089 | crates/vcad-kernel-booleans/src/split.rs:6302-6307 | crates/vcad-kernel-booleans/src/split.rs:6826-6831 | crates/vcad-kernel-booleans/src/split.rs:6842-6847 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–9 lines × 9) crates/vcad-kernel-constraints/src/residual.rs:50— crates/vcad-kernel-constraints/src/residual.rs:50-55 | crates/vcad-kernel-constraints/src/residual.rs:67-72 | crates/vcad-kernel-constraints/src/residual.rs:103-111 | crates/vcad-kernel-constraints/src/residual.rs:254-259 | crates/vcad-kernel-constraints/src/symbolic.rs:297-302 | crates/vcad-kernel-constraints/src/symbolic.rs:310-315 | crates/vcad-kernel-constraints/src/symbolic.rs:338-343 | crates/vcad-kernel-constraints/src/symbolic.rs:351-356 | crates/vcad-kernel-constraints/src/symbolic.rs:484-489 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 6) crates/vcad-kernel-acoustics/src/receipt.rs:261— crates/vcad-kernel-acoustics/src/receipt.rs:261-269 | crates/vcad-kernel-em/src/receipt.rs:370-378 | crates/vcad-kernel-flow/src/receipt.rs:284-292 | crates/vcad-kernel-neutronics/src/receipt.rs:305-313 | crates/vcad-kernel-particle/src/receipt.rs:378-386 | crates/vcad-kernel-thermal/src/receipt.rs:424-432 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-em/src/receipt.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 6) crates/vcad-kernel-acoustics/src/spec.rs:40— crates/vcad-kernel-acoustics/src/spec.rs:40-48 | crates/vcad-kernel-em/src/spec.rs:52-60 | crates/vcad-kernel-particle/src/spec.rs:43-51 | crates/vcad-kernel-photonics/src/spec.rs:47-55 | crates/vcad-kernel-thermal/src/spec.rs:64-72 | crates/vcad-kernel-tolerance/src/spec.rs:61-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times.
Duplicated block (7–8 lines × 4) crates/vcad-kernel-export/src/lib.rs:371— crates/vcad-kernel-export/src/lib.rs:371-378 | crates/vcad-kernel-export/src/lib.rs:388-395 | crates/vcad-kernel-export/src/lib.rs:410-417 | crates/vcad-kernel-export/src/lib.rs:472-478 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-export/src/lib.rs:371` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 4) apple/VcadApp/Sources/VcadApp/Kernel.swift:251— apple/VcadApp/Sources/VcadApp/Kernel.swift:251-257 | apple/VcadApp/Sources/VcadApp/Kernel.swift:305-312 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:251-257 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:305-312 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Kernel.swift:305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 4) crates/vcad-kernel-fea/src/mesh.rs:162— crates/vcad-kernel-fea/src/mesh.rs:162-173 | crates/vcad-kernel-fea/src/mesh.rs:420-431 | crates/vcad-kernel-fea/src/mesh.rs:574-585 | crates/vcad-kernel-topopt/src/domain.rs:115-126 — before extracting anything, compare `crates/vcad-kernel-fea/src/mesh.rs` and `crates/vcad-kernel-topopt/src/domain.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/vcad-cli/src/app.rs:325— crates/vcad-cli/src/app.rs:325-336 | crates/vcad-cli/src/app.rs:351-362 | crates/vcad-cli/src/app.rs:376-387 | crates/vcad-cli/src/app.rs:425-436 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:325` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 3) crates/vcad-kernel-booleans/src/classify.rs:273— crates/vcad-kernel-booleans/src/classify.rs:273-280 | crates/vcad-kernel-booleans/src/classify.rs:481-488 | crates/vcad-kernel-booleans/src/split.rs:3772-3778 — 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–8 lines × 3) crates/vcad-kernel-constraints/src/residual.rs:36— crates/vcad-kernel-constraints/src/residual.rs:36-43 | crates/vcad-kernel-constraints/src/residual.rs:169-175 | crates/vcad-kernel-constraints/src/residual.rs:237-243 — 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 × 6) crates/vcad-ffi/src/engine.rs:65— crates/vcad-ffi/src/engine.rs:65-71 | crates/vcad-ffi/src/engine.rs:98-104 | crates/vcad-ffi/src/engine.rs:135-141 | crates/vcad-ffi/src/engine.rs:158-164 | crates/vcad-ffi/src/engine.rs:221-227 | crates/vcad-ffi/src/engine.rs:329-335 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/engine.rs:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) apple/VcadApp/Sources/VcadApp/Editor.swift:209— apple/VcadApp/Sources/VcadApp/Editor.swift:209-215 | apple/VcadApp/Sources/VcadApp/Editor.swift:217-223 | apple/VcadApp/Sources/VcadApp/Editor.swift:224-230 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:209-215 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:217-223 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:224-230 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (6–7 lines × 2) crates/vcad-ecad-symbols/src/altium/binary.rs:259— crates/vcad-ecad-symbols/src/altium/binary.rs:259-264 | crates/vcad-ecad-symbols/src/altium/binary.rs:530-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) crates/vcad-kernel-particle/src/wire3d.rs:621— crates/vcad-kernel-particle/src/wire3d.rs:621-627 | crates/vcad-kernel-tessellate/src/clearance.rs:478-483 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/clearance.rs:478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–7 lines × 4) crates/vcad-kernel-flow/src/adjoint.rs:227— crates/vcad-kernel-flow/src/adjoint.rs:227-229 | crates/vcad-kernel-flow/src/adjoint.rs:272-278 | crates/vcad-kernel-flow/src/solve.rs:352-354 | crates/vcad-kernel-flow/src/solve.rs:408-414 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:272` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–7 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:855— apple/VcadApp/Sources/VcadApp/Editor.swift:855-857 | apple/VcadApp/Sources/VcadApp/Editor.swift:2925-2931 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:855-857 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2925-2931 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:2925` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apple/VcadApp/Sources/VcadApp/Editor.swift:2931` calls `serialize` and `apple/VcadApp/Sources/VcadApp/Editor.swift:857` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–7 lines × 3) crates/vcad-kernel-physics/src/world.rs:487— crates/vcad-kernel-physics/src/world.rs:487-493 | mecheval/graders/src/fit_physics.rs:588-590 | mecheval/graders/src/fit_physics.rs:629-635 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–7 lines × 3) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2687— apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2687-2689 | apple/VcadApp/Sources/VcadApp/VisionShell.swift:114-120 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:114-120 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift` and `apple/VcadApp/Sources/VcadApp/VisionShell.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apple/VcadApp/Sources/VcadApp/VisionShell.swift:113` calls `Circle`, `fill`, `Color` and `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2687` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 5) crates/vcad-kernel-sketch/src/extrude.rs:988— crates/vcad-kernel-sketch/src/extrude.rs:988-993 | crates/vcad-kernel-sketch/src/extrude.rs:1309-1315 | crates/vcad-kernel-sketch/src/extrude.rs:1453-1459 | crates/vcad-kernel-sweep/src/loft.rs:283-289 | crates/vcad-kernel-sweep/src/sweep.rs:387-393 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/loft.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:988` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) crates/vcad-app/src/materializer.rs:972— crates/vcad-app/src/materializer.rs:972-981 | crates/vcad-app/src/materializer.rs:1060-1065 | crates/vcad-app/src/materializer.rs:1092-1097 | crates/vcad-app/src/materializer.rs:1534-1543 | crates/vcad-app/src/materializer.rs:1582-1591 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/materializer.rs:972` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–6 lines × 4) crates/vcad-kernel-diff/src/lift.rs:245— crates/vcad-kernel-diff/src/lift.rs:245-250 | crates/vcad-kernel-diff/src/lift.rs:275-280 | crates/vcad-kernel-diff/src/lift.rs:305-310 | crates/vcad-kernel-diff/src/lift.rs:334-335 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/lift.rs:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–6 lines × 4) apple/VcadApp/Sources/VcadApp/Kernel.swift:63— apple/VcadApp/Sources/VcadApp/Kernel.swift:63-68 | apple/VcadApp/Sources/VcadApp/Kernel.swift:116-117 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:63-68 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:116-117 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Kernel.swift:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–6 lines × 3) crates/vcad-kernel-dfm/src/geom/probe.rs:197— crates/vcad-kernel-dfm/src/geom/probe.rs:197-199 | crates/vcad-kernel-dfm/src/geom/probe.rs:382-386 | crates/vcad-kernel-shell/src/lib.rs:895-900 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/geom/probe.rs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–6 lines × 3) crates/vcad-kernel-step/src/assembly.rs:175— crates/vcad-kernel-step/src/assembly.rs:175-180 | crates/vcad-kernel-tessellate/src/query.rs:102-104 | crates/vcad-parts/src/vacuum/mod.rs:652-657 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-step/src/assembly.rs:175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 10) crates/vcad-kernel-tessellate/src/lib.rs:2864— crates/vcad-kernel-tessellate/src/lib.rs:2864-2868 | crates/vcad-kernel-tessellate/src/lib.rs:4582-4586 | crates/vcad-kernel-tessellate/src/lib.rs:4695-4699 | crates/vcad-kernel-tessellate/src/lib.rs:4988-4992 | crates/vcad-kernel-tessellate/src/lib.rs:5213-5217 | crates/vcad-kernel-tessellate/src/lib.rs:6433-6437 | crates/vcad-kernel-tessellate/src/lib.rs:6654-6658 | crates/vcad-kernel-tessellate/src/lib.rs:7069-7073 | crates/vcad-kernel-tessellate/src/lib.rs:7267-7271 | crates/vcad-kernel-tessellate/src/lib.rs:8141-8145 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-tessellate/src/lib.rs:4694` calls `radial_normal` and `crates/vcad-kernel-tessellate/src/lib.rs:7068` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 10) crates/vcad-kernel-wasm/src/lib.rs:8850— crates/vcad-kernel-wasm/src/lib.rs:8850-8854 | crates/vcad-kernel-wasm/src/lib.rs:8977-8981 | crates/vcad-kernel-wasm/src/lib.rs:9067-9071 | crates/vcad-kernel-wasm/src/lib.rs:9175-9179 | crates/vcad-kernel-wasm/src/lib.rs:9329-9333 | crates/vcad-kernel-wasm/src/lib.rs:9455-9459 | crates/vcad-kernel-wasm/src/lib.rs:9647-9651 | crates/vcad-kernel-wasm/src/lib.rs:10297-10301 | crates/vcad-kernel-wasm/src/lib.rs:10655-10659 | crates/vcad-kernel-wasm/src/lib.rs:11140-11144 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-wasm/src/lib.rs:9645` calls `from_str`, `map_err` and `crates/vcad-kernel-wasm/src/lib.rs:8849` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 6) crates/vcad-ecad-pcb/src/drc.rs:1579— crates/vcad-ecad-pcb/src/drc.rs:1579-1583 | crates/vcad-ecad-pcb/src/router/auto.rs:1610-1612 | crates/vcad-ecad-pcb/src/router/maze.rs:964-966 | crates/vcad-ecad-pcb/src/session.rs:351-353 | crates/vcad-ecad-pcb/src/spatial.rs:191-193 | crates/vcad-slicer/src/infill.rs:229-233 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/drc.rs:1579` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-pcb/src/spatial.rs:193` calls `max` and `crates/vcad-slicer/src/infill.rs:233` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 6) crates/vcad-ecad-pcb/src/drc.rs:2937— crates/vcad-ecad-pcb/src/drc.rs:2937-2939 | crates/vcad-ecad-pcb/src/session.rs:357-359 | crates/vcad-kernel-cam/src/turning/geom.rs:170-172 | crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:480-484 | crates/vcad-process/src/masks.rs:38-42 | crates/vcad-process/src/masks.rs:106-108 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:480` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–5 lines × 3) crates/vcad-ecad-pcb/src/router/descent.rs:1111— crates/vcad-ecad-pcb/src/router/descent.rs:1111-1113 | crates/vcad-ecad-pcb/src/router/mod.rs:555-559 | crates/vcad-ecad-pcb/src/router/pair.rs:1880-1884 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/mod.rs:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–5 lines × 3) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:296— apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:296-298 | apple/VcadApp/Sources/VcadApp/Document.swift:853-857 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:853-857 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–5 lines × 4) crates/vcad-kernel-booleans/src/classify.rs:694— crates/vcad-kernel-booleans/src/classify.rs:694-698 | crates/vcad-kernel-booleans/src/split.rs:734-736 | crates/vcad-kernel-booleans/src/split.rs:815-817 | crates/vcad-kernel-booleans/src/trim.rs:269-273 — before extracting anything, compare `crates/vcad-kernel-booleans/src/classify.rs` and `crates/vcad-kernel-booleans/src/trim.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/classify.rs:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–5 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:859— apple/VcadApp/Sources/VcadApp/Editor.swift:859-863 | apple/VcadApp/Sources/VcadApp/Editor.swift:2932-2934 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:859-863 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2932-2934 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:859` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apple/VcadApp/Sources/VcadApp/Editor.swift:858` calls `generated`, `Data` and `apple/VcadApp/Sources/VcadApp/Editor.swift:2932` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (53 lines × 2) apple/VcadApp/Sources/VcadApp/Document.swift:710— apple/VcadApp/Sources/VcadApp/Document.swift:710-762 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:710-762 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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 (53 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:966— apple/VcadApp/Sources/VcadApp/Shell.swift:966-1018 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:966-1018 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 (127 lines × 2) apple/VcadApp/Sources/VcadApp/Document.swift:173— apple/VcadApp/Sources/VcadApp/Document.swift:173-299 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:173-299 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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 (127 lines × 2) apple/VcadApp/Sources/VcadApp/Kernel.swift:93— apple/VcadApp/Sources/VcadApp/Kernel.swift:93-219 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:93-219 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 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) apple/VcadApp/Sources/VcadApp/Document.swift:449— apple/VcadApp/Sources/VcadApp/Document.swift:449-481 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:449-481 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 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) apple/VcadApp/Sources/VcadApp/Editor.swift:3146— apple/VcadApp/Sources/VcadApp/Editor.swift:3146-3178 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3146-3178 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (40 lines × 2) apple/VcadApp/Sources/VcadApp/Kernel.swift:245— apple/VcadApp/Sources/VcadApp/Kernel.swift:245-284 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:245-284 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 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 (40 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2343— apple/VcadApp/Sources/VcadApp/Editor.swift:2343-2382 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2343-2382 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 2) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:359— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:359-392 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:359-392 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 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 × 2) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:266— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:266-299 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:266-299 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 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.
Low cohesion: DimensionStyle (LCOM4 5) crates/vcad-kernel-drafting/src/dimension/style.rs:13— DimensionStyle'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: Su3 (LCOM4 4) crates/vcad-kernel-qcd/src/su3.rs:68— Su3'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.
Duplicated block (65 lines × 2 locations) mecheval/harness/src/solvers/gateway-direct.ts:56— mecheval/harness/src/solvers/gateway-direct.ts:56 · mecheval/harness/src/solvers/wafer-direct.ts:40 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (65 lines × 2 locations) packages/app/public/launch/launch.js:99— packages/app/public/launch/launch.js:99 · www/public/kit/gallery.js:211 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (34 lines × 2 locations) packages/app/src/components/FeatureTree.tsx:426— packages/app/src/components/FeatureTree.tsx:426 · packages/app/src/components/InlineProperties.tsx:8 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (34 lines × 2 locations) packages/training/src/generators/ball.ts:121— packages/training/src/generators/ball.ts:121 · packages/training/src/generators/turned.ts:136 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (31 matched lines × 2 locations) · ×2
Duplicated block with local edits (31 matched lines × 2 locations) apple/VcadApp/scripts/vcad-app-discovery.mjs:55— apple/VcadApp/scripts/vcad-app-discovery.mjs:55 · packages/mcp/src/app-discovery.ts:70 — the two spans are one implementation copied and then locally edited — 278 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (31 matched lines × 2 locations) packages/app/src/components/cam/CamSettings.tsx:71— packages/app/src/components/cam/CamSettings.tsx:71 · packages/app/src/components/cam/OperationList.tsx:258 — the two spans are one implementation copied and then locally edited — 183 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Dead file (~31 LoC) packages/app/src/components/shadcn/collapsible.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~31 LoC) packages/app/src/lib/open-document.ts— no import path from any entry point (91 application, 42 tooling, 184 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
AC3 · Page structure· Data table has no header cells · ×1
Data table has no header cells packages/app/src/components/CompressedFieldOverlay.tsx:309— A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
Low contrast Tailwind colour pair (3.8:1) packages/app/src/components/FeatureTree.tsx:186— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
SchematicCanvas.SchematicCanvas (cyclomatic 213) packages/app/src/components/electronics/SchematicCanvas.tsx:230— SchematicCanvas.SchematicCanvas has cyclomatic complexity 213 (threshold 15). Of this number, 32 points are the body's own statements and 181 belong to 41 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.
ViewportContent.ViewportContent (cyclomatic 199) packages/app/src/components/ViewportContent.tsx:366— ViewportContent.ViewportContent has cyclomatic complexity 199 (threshold 15). Of this number, 39 points are the body's own statements and 160 belong to 45 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.
document-store.useDocumentStore (cyclomatic 181) packages/core/src/stores/document-store.ts:948— document-store.useDocumentStore has cyclomatic complexity 181 (threshold 15). Most of this is not in the body itself: 1 of the 181 points is its own statement and the rest belongs to 53 function literals inside it that branch (lines 1656, 1263, 1142, …). 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.
useKeyboardShortcuts.useKeyboardShortcuts (cyclomatic 163) packages/app/src/hooks/useKeyboardShortcuts.ts:15— useKeyboardShortcuts.useKeyboardShortcuts has cyclomatic complexity 163 (threshold 15). Most of this is not in the body itself: 1 of the 163 points is its own statement and the rest belongs to one function literal inside it that branches (line 17). 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.
ecad.routeNets (cyclomatic 161) packages/mcp/src/tools/ecad.ts:3811— ecad.routeNets has cyclomatic complexity 161 (threshold 15). Of this number, 141 points are the body's own statements and 20 belong to 5 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.
DrawingView.DrawingView (cyclomatic 122) packages/app/src/components/DrawingView.tsx:121— DrawingView.DrawingView has cyclomatic complexity 122 (threshold 15). Of this number, 36 points are the body's own statements and 86 belong to 38 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.
ecad.addMotorWinding (cyclomatic 120) packages/mcp/src/tools/ecad.ts:11593— ecad.addMotorWinding has cyclomatic complexity 120 (threshold 15). To reduce it, separate the cases: extract each independent 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 (ecad.addMotorWinding::feedClear) 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.
server.createServer (cyclomatic 115) packages/mcp/src/server.ts:744— server.createServer has cyclomatic complexity 115 (threshold 15). Of this number, 20 points are the body's own statements and 95 belong to 15 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.
useToolDefinitions.useToolDefinitions.byTab (cyclomatic 106) packages/app/src/hooks/useToolDefinitions.tsx:281— useToolDefinitions.useToolDefinitions.byTab has cyclomatic complexity 106 (threshold 15). Of this number, 75 points are the body's own statements and 31 belong to 15 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.
ecad.fixDrc (cyclomatic 105) packages/mcp/src/tools/ecad.ts:15028— ecad.fixDrc has cyclomatic complexity 105 (threshold 15). Of this number, 82 points are the body's own statements and 23 belong to 14 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.
render.renderView (cyclomatic 105) packages/mcp/src/tools/render.ts:376— render.renderView has cyclomatic complexity 105 (threshold 15). Of this number, 103 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SceneMesh.SceneMesh (cyclomatic 100) packages/app/src/components/SceneMesh.tsx:496— SceneMesh.SceneMesh has cyclomatic complexity 100 (threshold 15). Of this number, 40 points are the body's own statements and 60 belong to 20 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.
ecad.placeComponents (cyclomatic 90) packages/mcp/src/tools/ecad.ts:2874— ecad.placeComponents has cyclomatic complexity 90 (threshold 15). Of this number, 56 points are the body's own statements and 34 belong to 10 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.
App.App (cyclomatic 88) packages/app/src/App.tsx:216— App.App has cyclomatic complexity 88 (threshold 15). Of this number, 24 points are the body's own statements and 64 belong to 13 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.
startHeroEngine (cyclomatic 87) www/src/hero-engine.js:16— startHeroEngine has cyclomatic complexity 87 (threshold 15). Most of this is not in the body itself: 2 of the 87 points are its own statements and the rest belongs to 42 function items inside it that branch (extractEdges, a function literal at line 383, meshBounds, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ReleasedOverlayView.viewport (cyclomatic 83) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:997— ReleasedOverlayView.viewport has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FeatureInput::to_crdt_params (cyclomatic 80) crates/vcad-app/src/feature.rs:552— FeatureInput::to_crdt_params 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.
annotate.generateSyntheticDescription (cyclomatic 76) packages/training/src/annotate.ts:237— annotate.generateSyntheticDescription has cyclomatic complexity 76 (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.
evaluate.evaluateOp (cyclomatic 75) packages/engine/src/evaluate.ts:715— evaluate.evaluateOp has cyclomatic complexity 75 (threshold 15). Of this number, 72 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
PcbScene.PcbScene (cyclomatic 71) packages/app/src/components/electronics/pcb3d/PcbScene.tsx:26— PcbScene.PcbScene has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 12 of the 71 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 84, 272, 250, …). 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.
ElectronicsCanvas.body (cyclomatic 66) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:473— ElectronicsCanvas.body has cyclomatic complexity 66 (threshold 15). Of this number, 65 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.
protocol-2026.handleModernRequest (cyclomatic 64) packages/mcp/src/protocol-2026.ts:543— protocol-2026.handleModernRequest has cyclomatic complexity 64 (threshold 15). Of this number, 56 points are the body's own statements and 8 belong to 2 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.
ReleasedARView.rebuild (cyclomatic 63) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2149— ReleasedARView.rebuild has cyclomatic complexity 63 (threshold 15). Of this number, 62 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.
ecad.layoutLint (cyclomatic 62) packages/mcp/src/tools/ecad.ts:5391— ecad.layoutLint has cyclomatic complexity 62 (threshold 15). Of this number, 58 points are the body's own statements and 4 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.
FeatureTree.TreeNode (cyclomatic 61) packages/app/src/components/FeatureTree.tsx:485— FeatureTree.TreeNode has cyclomatic complexity 61 (threshold 15). Of this number, 39 points are the body's own statements and 22 belong to 7 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.
animate.exportVideo (cyclomatic 61) packages/mcp/src/tools/animate.ts:1034— animate.exportVideo has cyclomatic complexity 61 (threshold 15). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Repl::execute (cyclomatic 59) crates/vcad-cli/src/repl.rs:81— Repl::execute 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.
ecad.addCoil (cyclomatic 59) packages/mcp/src/tools/ecad.ts:7744— ecad.addCoil has cyclomatic complexity 59 (threshold 15). Of this number, 58 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.
ReleasedOverlayView.tapSelect (cyclomatic 58) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1548— ReleasedOverlayView.tapSelect has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommandPalette.CommandPalette (cyclomatic 58) packages/app/src/components/CommandPalette.tsx:141— CommandPalette.CommandPalette has cyclomatic complexity 58 (threshold 15). Of this number, 27 points are the body's own statements and 31 belong to 14 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
useCameraControls.useCameraControls (cyclomatic 58) packages/app/src/hooks/useCameraControls.ts:6— useCameraControls.useCameraControls has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 1 of the 58 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 14, 64, 244, …). 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.
vcad_kernel_wasm.__wbg_get_imports (cyclomatic 58) packages/kernel-wasm/vcad_kernel_wasm.js:9345— vcad_kernel_wasm.__wbg_get_imports has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 1 of the 58 points is its own statement and the rest belongs to 48 function literals inside it that branch (lines 9377, 9371, 9430, …). 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.
ecad.buildSheetBody (cyclomatic 58) packages/mcp/src/tools/ecad.ts:2108— ecad.buildSheetBody has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 15 of the 58 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 2177, a function literal at line 2146, a function literal at line 2227, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AssemblyReader::read_structure (cyclomatic 57) crates/vcad-kernel-step/src/assembly.rs:301— AssemblyReader::read_structure has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
order.quoteManufacturing (cyclomatic 57) packages/mcp/src/tools/order.ts:204— order.quoteManufacturing has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CNCOverlay.swift.syncCNCOverlay (cyclomatic 56) apple/VcadApp/Sources/VcadApp/CNCOverlay.swift:10— CNCOverlay.swift.syncCNCOverlay 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.
vcad_kernel_photon_dose::transport::run (cyclomatic 55) crates/vcad-kernel-photon-dose/src/transport.rs:329— vcad_kernel_photon_dose::transport::run 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.
ecad.calcMotor (cyclomatic 54) packages/mcp/src/tools/ecad.ts:12513— ecad.calcMotor has cyclomatic complexity 54 (threshold 15). Of this number, 50 points are the body's own statements and 4 belong to 2 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.
AgentTools.call (cyclomatic 53) apple/VcadApp/Sources/VcadApp/AgentBridge.swift:239— AgentTools.call has cyclomatic complexity 53 (threshold 15). Of this number, 49 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.
scrub-input.ScrubInput (cyclomatic 53) packages/app/src/components/ui/scrub-input.tsx:77— scrub-input.ScrubInput has cyclomatic complexity 53 (threshold 15). Of this number, 28 points are the body's own statements and 25 belong to 10 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.
index.parseGeometryOpcode (cyclomatic 53) packages/ir/src/index.ts:1481— index.parseGeometryOpcode 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.
RayTracedViewport.RayTracedViewportOverlay (cyclomatic 52) packages/app/src/components/RayTracedViewport.tsx:406— RayTracedViewport.RayTracedViewportOverlay has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 2 of the 52 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 731, 497, 608, …). 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.
vcad_ecad_export::gerber::write_gerber_layer (cyclomatic 51) crates/vcad-ecad-export/src/gerber.rs:545— vcad_ecad_export::gerber::write_gerber_layer has cyclomatic complexity 51 (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.
Embedding::route (cyclomatic 49) crates/vcad-ecad-pcb/src/router/flow/embed.rs:397— Embedding::route 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.
StepReader::read_solid (cyclomatic 49) crates/vcad-kernel-step/src/reader.rs:709— StepReader::read_solid 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.
usePcbCamera.usePcbCamera (cyclomatic 49) packages/app/src/components/electronics/pcb3d/usePcbCamera.ts:30— usePcbCamera.usePcbCamera has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 46, 277, 212, …). 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.
App::process_command (cyclomatic 48) crates/vcad-cli/src/app.rs:1095— App::process_command has cyclomatic complexity 48 (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.
clearance.checkClearance (cyclomatic 48) packages/mcp/src/tools/clearance.ts:626— clearance.checkClearance has cyclomatic complexity 48 (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.
PlanarMagnetostatics::build_system (cyclomatic 47) crates/vcad-kernel-em/src/planar.rs:306— PlanarMagnetostatics::build_system 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.
ecad.verifyReceipt (cyclomatic 47) packages/mcp/src/tools/ecad.ts:14693— ecad.verifyReceipt has cyclomatic complexity 47 (threshold 15). Of this number, 46 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RayTracedViewport.RayTracedViewportSync (cyclomatic 46) packages/app/src/components/RayTracedViewport.tsx:70— RayTracedViewport.RayTracedViewportSync has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 91, 317, 143, …). 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.
useCanvasRecorder.useCanvasRecorder (cyclomatic 46) packages/app/src/hooks/useCanvasRecorder.ts:88— useCanvasRecorder.useCanvasRecorder has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 103, 261, 305, …). 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.
vcad_kernel_export::build_glb (cyclomatic 45) crates/vcad-kernel-export/src/lib.rs:250— vcad_kernel_export::build_glb 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.
CNCController.simulateCommand (cyclomatic 45) apple/VcadApp/Sources/VcadApp/CNC.swift:523— CNCController.simulateCommand 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.
NativeElectronicsView.inspector (cyclomatic 45) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:238— NativeElectronicsView.inspector 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.
AccessMarket::build (cyclomatic 44) crates/vcad-ecad-pcb/src/router/flow/access.rs:195— AccessMarket::build 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.
CNCImport.parse (cyclomatic 44) apple/VcadApp/Sources/VcadApp/CNCImport.swift:7— CNCImport.parse 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.
ElectronicsCanvas.installMonitor (cyclomatic 44) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:808— ElectronicsCanvas.installMonitor 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.
GizmoView.swift.buildGizmo (cyclomatic 44) apple/VcadApp/Sources/VcadApp/GizmoView.swift:100— GizmoView.swift.buildGizmo has cyclomatic complexity 44 (threshold 15). Of this number, 40 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.
XRGestures.XRGestures (cyclomatic 44) packages/app/src/components/xr/XRGestures.tsx:163— XRGestures.XRGestures has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 199, 255, 258, …). 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.
carry-electronics.carryElectronics (cyclomatic 44) packages/mcp/src/tools/carry-electronics.ts:23— carry-electronics.carryElectronics has cyclomatic complexity 44 (threshold 15). Of this number, 34 points are the body's own statements and 10 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.
SketchSession.loopRegions (cyclomatic 43) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1270— SketchSession.loopRegions has cyclomatic complexity 43 (threshold 15). Of this number, 33 points are the body's own statements and 10 belong to 4 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.
ToolPalette.ToolPalette (cyclomatic 43) packages/app/src/components/ToolPalette.tsx:26— ToolPalette.ToolPalette has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 5 of the 43 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 132, a function literal at line 102, a function literal at line 217, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vcad_slicer_gcode::lint::lint (cyclomatic 42) crates/vcad-slicer-gcode/src/lint.rs:95— vcad_slicer_gcode::lint::lint 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.
PropertyPanel.PropertyPanel (cyclomatic 42) packages/app/src/components/PropertyPanel.tsx:1540— PropertyPanel.PropertyPanel has cyclomatic complexity 42 (threshold 15). Of this number, 39 points are the body's own statements and 3 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.
matrix-cli.main (cyclomatic 41) mecheval/harness/src/matrix-cli.ts:198— matrix-cli.main has cyclomatic complexity 41 (threshold 15). Of this number, 28 points are the body's own statements and 13 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.
ecad.sizeImpedance (cyclomatic 41) packages/mcp/src/tools/ecad.ts:7129— ecad.sizeImpedance has cyclomatic complexity 41 (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.
record.recordSimulation (cyclomatic 41) packages/mcp/src/tools/record.ts:168— record.recordSimulation 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.
distill_lambda.distill (cyclomatic 40) packages/training/src/lambda/distill_lambda.py:78— distill_lambda.distill 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.
PrintPanel.PrintPanel (cyclomatic 40) packages/app/src/components/print/PrintPanel.tsx:50— PrintPanel.PrintPanel has cyclomatic complexity 40 (threshold 15). Of this number, 18 points are the body's own statements and 22 belong to 7 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.
parameters.setParameters (cyclomatic 40) packages/mcp/src/tools/parameters.ts:237— parameters.setParameters has cyclomatic complexity 40 (threshold 15). Of this number, 33 points are the body's own statements and 7 belong to 4 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.
ecad.deriveNets (cyclomatic 40) packages/mcp/src/tools/ecad.ts:525— ecad.deriveNets has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 belong to 2 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.
source-parser.parseRustSourceContentWithInference (cyclomatic 40) REDACTED:535— source-parser.parseRustSourceContentWithInference 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.
vcad_kernel_constraints::residual::compute_constraint_residuals (cyclomatic 39) crates/vcad-kernel-constraints/src/residual.rs:20— vcad_kernel_constraints::residual::compute_constraint_residuals has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AgentCore.answer (cyclomatic 39) apple/VcadApp/Sources/VcadApp/AgentCore.swift:208— AgentCore.answer has cyclomatic complexity 39 (threshold 15). Of this number, 38 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.
clearance.computeInterferenceAudit (cyclomatic 39) packages/mcp/src/tools/clearance.ts:482— clearance.computeInterferenceAudit has cyclomatic complexity 39 (threshold 15). Of this number, 35 points are the body's own statements and 4 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.
InteractiveRouter::shortest_path (cyclomatic 38) crates/vcad-ecad-fabprep/src/verdict.rs:772— InteractiveRouter::shortest_path 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.
SketchSession.ink (cyclomatic 38) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1406— SketchSession.ink 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.
EmbroideryPanel.EmbroideryPanel (cyclomatic 38) packages/app/src/components/embroidery/EmbroideryPanel.tsx:19— EmbroideryPanel.EmbroideryPanel has cyclomatic complexity 38 (threshold 15). Of this number, 23 points are the body's own statements and 15 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.
ecad.addViaArray (cyclomatic 38) packages/mcp/src/tools/ecad.ts:11318— ecad.addViaArray 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.
ecad.buildReceipt (cyclomatic 38) packages/mcp/src/tools/ecad.ts:14504— ecad.buildReceipt 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.
vcad_kernel_neutronics::transport::run (cyclomatic 37) crates/vcad-kernel-neutronics/src/transport.rs:318— vcad_kernel_neutronics::transport::run 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.
integrity.computeIntegrity (cyclomatic 37) packages/mcp/src/tools/integrity.ts:244— integrity.computeIntegrity 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.
CNCController.ingest (cyclomatic 36) apple/VcadApp/Sources/VcadApp/CNC.swift:309— CNCController.ingest 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.
PcbFootprintGroup.PcbFootprintGroup (cyclomatic 36) packages/app/src/components/electronics/PcbFootprintGroup.tsx:19— PcbFootprintGroup.PcbFootprintGroup has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 57, a function literal at line 159, isNetHighlighted, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useAppCommands.useAppCommands (cyclomatic 36) packages/app/src/hooks/useAppCommands.ts:65— useAppCommands.useAppCommands has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 20 function literals inside it that branch (lines 75, 265, 126, …). 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.
ecad.sizePdn (cyclomatic 36) packages/mcp/src/tools/ecad.ts:7281— ecad.sizePdn has cyclomatic complexity 36 (threshold 15). Of this number, 24 points are the body's own statements and 12 belong to 6 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.
ecad.getCopper (cyclomatic 36) packages/mcp/src/tools/ecad.ts:10395— ecad.getCopper has cyclomatic complexity 36 (threshold 15). Of this number, 18 points are the body's own statements and 18 belong to 4 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.
AxisymMagnetostatics::build_system (cyclomatic 35) crates/vcad-kernel-em/src/axisym.rs:421— AxisymMagnetostatics::build_system 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.
Device3d::validate (cyclomatic 35) crates/vcad-kernel-particle/src/wire3d.rs:395— Device3d::validate 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.
HaloInput.handle (cyclomatic 35) apple/VcadApp/Sources/VcadApp/NavigationViews.swift:541— HaloInput.handle 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.
SketchInference.infer (cyclomatic 35) apple/VcadApp/Sources/VcadApp/SketchInference.swift:64— SketchInference.infer 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.
SketchViews.swift.buildSketchRoot (cyclomatic 35) apple/VcadApp/Sources/VcadApp/SketchViews.swift:377— SketchViews.swift.buildSketchRoot has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body's own statements and 10 belong to 2 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.
commands.createCommandRegistry (cyclomatic 35) packages/core/src/commands.ts:180— commands.createCommandRegistry 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.
PartStockClient.check (cyclomatic 35) packages/mcp/src/tools/part-stock.ts:384— PartStockClient.check has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RecordReader::next_record (cyclomatic 34) crates/vcad-gdsii/src/record.rs:196— RecordReader::next_record 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.
useEngine.useEngine (cyclomatic 34) packages/app/src/hooks/useEngine.ts:31— useEngine.useEngine has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 35, 86, 157, …). 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.
index.fromVCode (cyclomatic 34) packages/ir/src/index.ts:369— index.fromVCode 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.
StatusBar.StatusBar (cyclomatic 33) packages/app/src/components/StatusBar.tsx:67— StatusBar.StatusBar has cyclomatic complexity 33 (threshold 15). Of this number, 23 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
expression-input.ExpressionInput (cyclomatic 33) packages/app/src/components/ui/expression-input.tsx:45— expression-input.ExpressionInput has cyclomatic complexity 33 (threshold 15). Of this number, 21 points are the body's own statements and 12 belong to 4 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.
PathTracer.step (cyclomatic 32) apple/VcadApp/Sources/VcadApp/PathTracer.swift:174— PathTracer.step has cyclomatic complexity 32 (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.
launch.stitchTJunctions (cyclomatic 32) packages/app/public/launch/launch.js:99— launch.stitchTJunctions 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentPicker.DocumentPicker (cyclomatic 32) packages/app/src/components/DocumentPicker.tsx:223— DocumentPicker.DocumentPicker has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 311, 346, 255, …). 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.
electronics-store.useElectronicsStore (cyclomatic 32) packages/app/src/stores/electronics-store.ts:320— electronics-store.useElectronicsStore has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 19 function literals inside it that branch (lines 635, 392, 443, …). 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.
index.formatSceneSettings (cyclomatic 32) packages/ir/src/index.ts:935— index.formatSceneSettings 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.
gallery.stitchTJunctions (cyclomatic 32) www/public/kit/gallery.js:211— gallery.stitchTJunctions 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
hero-app.init (cyclomatic 32) www/src/hero-app.js:9— hero-app.init has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 15 function items inside it that branch (play, setReceipt, el, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LayerCdt::build (cyclomatic 31) crates/vcad-ecad-pcb/src/router/flow/cdt.rs:532— LayerCdt::build 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.
LinuxCncPost::segment (cyclomatic 31) crates/vcad-kernel-cam/src/post/linuxcnc.rs:164— LinuxCncPost::segment 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.
FeSystem::build (cyclomatic 31) crates/vcad-kernel-topopt/src/fea.rs:154— FeSystem::build has cyclomatic complexity 31 (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.
AgentTools.setPose (cyclomatic 31) apple/VcadApp/Sources/VcadApp/AgentBridge.swift:186— AgentTools.setPose has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FeatureOpSheet.apply (cyclomatic 31) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:450— FeatureOpSheet.apply 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.
NavigationScheme.action (cyclomatic 31) apple/VcadApp/Sources/VcadApp/NavigationScheme.swift:81— NavigationScheme.action 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.
pass_k.failureReason (cyclomatic 31) mecheval/harness/src/pass_k.ts:58— pass_k.failureReason 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.
SketchPropertyPanel.SketchPropertyPanel (cyclomatic 31) packages/app/src/components/SketchPropertyPanel.tsx:403— SketchPropertyPanel.SketchPropertyPanel has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 469, 439, 467). 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.
index.toVCode (cyclomatic 31) packages/ir/src/index.ts:525— index.toVCode 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.
next-actions.suggestNextActions (cyclomatic 31) packages/mcp/src/tools/next-actions.ts:47— next-actions.suggestNextActions 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.
ecad.setPlacement (cyclomatic 31) packages/mcp/src/tools/ecad.ts:9761— ecad.setPlacement 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.
SketchSession.constrainSelectionNow (cyclomatic 30) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1129— SketchSession.constrainSelectionNow 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.
SketchPlane3D.SketchGeometry3D (cyclomatic 30) packages/app/src/components/SketchPlane3D.tsx:275— SketchPlane3D.SketchGeometry3D has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 378, 288, 348, …). 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.
index.formatOp (cyclomatic 30) packages/ir/src/index.ts:831— index.formatOp has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
bom.buildLine (cyclomatic 30) packages/mcp/src/tools/bom.ts:252— bom.buildLine 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.
ecad.deleteNetTie (cyclomatic 30) packages/mcp/src/tools/ecad.ts:10751— ecad.deleteNetTie has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 belong to 2 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.
vcad_kernel_adjoint::couple::solve_coupled (cyclomatic 29) crates/vcad-kernel-adjoint/src/couple.rs:287— vcad_kernel_adjoint::couple::solve_coupled 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.
GrblPost::segment (cyclomatic 29) crates/vcad-kernel-cam/src/post/grbl.rs:112— GrblPost::segment 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.
Tracer::trace_impl (cyclomatic 29) crates/vcad-kernel-particle/src/trace.rs:482— Tracer::trace_impl 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.
GpuScene::from_brep (cyclomatic 29) crates/vcad-kernel-raytrace/src/gpu/buffers.rs:635— GpuScene::from_brep has cyclomatic complexity 29 (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.
ElectronicsWorkspace.tidySchematic (cyclomatic 29) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:313— ElectronicsWorkspace.tidySchematic has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to 2 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.
FeatureOpSheet.fields (cyclomatic 29) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:289— FeatureOpSheet.fields 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.
TransformGizmo.TransformGizmo (cyclomatic 29) packages/app/src/components/TransformGizmo.tsx:63— TransformGizmo.TransformGizmo has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 105, 187, 147, …). 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.
claims-ledger.importMeasurement (cyclomatic 29) packages/mcp/src/tools/claims-ledger.ts:858— claims-ledger.importMeasurement has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mech-parts.searchMechCatalog (cyclomatic 29) packages/mcp/src/tools/mech-parts.ts:139— mech-parts.searchMechCatalog has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ecad.addZone (cyclomatic 29) packages/mcp/src/tools/ecad.ts:9951— ecad.addZone has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
main.handleToolResult (cyclomatic 29) packages/mcp/viewer-app/main.ts:2000— main.handleToolResult 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.
PeriodicTrim::build (cyclomatic 28) crates/vcad-kernel-raytrace/src/trim.rs:168— PeriodicTrim::build 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.
AnalysisSmoke.swift.analysisSmoke (cyclomatic 28) apple/VcadApp/Sources/VcadApp/AnalysisSmoke.swift:14— AnalysisSmoke.swift.analysisSmoke has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 2 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.
SketchPlane3D.SketchPlane3D (cyclomatic 28) packages/app/src/components/SketchPlane3D.tsx:731— SketchPlane3D.SketchPlane3D has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 773, 905, 951, …). 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.
CamPanel.CamPanel (cyclomatic 28) packages/app/src/components/cam/CamPanel.tsx:36— CamPanel.CamPanel has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 59, 237). 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.
ElectronicsPanelHeader.BoardSizeControl (cyclomatic 28) packages/app/src/components/electronics/ElectronicsPanelHeader.tsx:68— ElectronicsPanelHeader.BoardSizeControl has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (fitToEnclosure, commit, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
enclosure.sealedWallOpenings (cyclomatic 28) packages/mcp/src/tools/enclosure.ts:232— enclosure.sealedWallOpenings 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.
source-parser.parseRustSourceContent (cyclomatic 28) REDACTED:100— source-parser.parseRustSourceContent 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.
Ctx::elaborate (cyclomatic 27) crates/vcad-ecad-schematic/src/hierarchy.rs:205— Ctx::elaborate 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.
vcad_kernel_calibration::build_calibration_report (cyclomatic 27) crates/vcad-kernel-calibration/src/lib.rs:492— vcad_kernel_calibration::build_calibration_report 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.
make_figures.figA (cyclomatic 27) docs/compression-math-survey/launch-figures/make_figures.py:139— make_figures.figA 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.
CNCController.connect (cyclomatic 27) apple/VcadApp/Sources/VcadApp/CNC.swift:193— CNCController.connect 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.
NavSmoke.swift.navSmoke (cyclomatic 27) apple/VcadApp/Sources/VcadApp/NavSmoke.swift:13— NavSmoke.swift.navSmoke has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 3 function items inside it that branch (drag, send, check). 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.
build.modelIdentity (cyclomatic 27) mecheval/leaderboard/src/build.ts:230— build.modelIdentity 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.
circuit-build.buildCircuitSpec (cyclomatic 27) packages/app/src/lib/circuit-build.ts:75— circuit-build.buildCircuitSpec has cyclomatic complexity 27 (threshold 15). Of this number, 16 points are the body's own statements and 11 belong to 4 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.
analyze-store.useAnalyzeStore (cyclomatic 27) packages/app/src/stores/analyze-store.ts:236— analyze-store.useAnalyzeStore has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 261, 392, 376, …). 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.
registry-dispatch.runMutationViaEngine (cyclomatic 27) packages/mcp/src/tools/registry-dispatch.ts:679— registry-dispatch.runMutationViaEngine 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.
joint-range.checkJointRange (cyclomatic 27) packages/mcp/src/tools/joint-range.ts:211— joint-range.checkJointRange has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 5 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.
ecad.applyDesignRuleArgs (cyclomatic 27) packages/mcp/src/tools/ecad.ts:190— ecad.applyDesignRuleArgs has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 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.
ecad.runErc (cyclomatic 27) packages/mcp/src/tools/ecad.ts:5788— ecad.runErc has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ecad.windingLayout (cyclomatic 27) packages/mcp/src/tools/ecad.ts:8268— ecad.windingLayout 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, 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.
ecad.describePcb (cyclomatic 27) packages/mcp/src/tools/ecad.ts:9209— ecad.describePcb has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to 3 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.
ecad.boardFromSolid (cyclomatic 27) packages/mcp/src/tools/ecad.ts:13677— ecad.boardFromSolid has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong 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.
Builder::build (cyclomatic 26) crates/vcad-ffi/src/features.rs:302— Builder::build 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.
Proxy::spawn (cyclomatic 26) crates/vcad-mcp/src/proxy.rs:198— Proxy::spawn 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.
EditorModel.paletteCommands (cyclomatic 26) apple/VcadApp/Sources/VcadApp/FeatureOpsPalette.swift:19— EditorModel.paletteCommands 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.
SketchSession.tapNow (cyclomatic 26) apple/VcadApp/Sources/VcadApp/SketchSession.swift:616— SketchSession.tapNow 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.
AnalysisOverlay.swift.syncAnalysisOverlay (cyclomatic 26) apple/VcadApp/Sources/VcadApp/AnalysisOverlay.swift:127— AnalysisOverlay.swift.syncAnalysisOverlay 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.
SoundPanel.swift.syncSoundOverlay (cyclomatic 26) apple/VcadApp/Sources/VcadApp/SoundPanel.swift:471— SoundPanel.swift.syncSoundOverlay has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 belong to 2 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.
launch-animatic.html.chrome (cyclomatic 26) docs/launch/launch-animatic.html:169— launch-animatic.html.chrome has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
launch.hero (cyclomatic 26) packages/app/public/launch/launch.js:517— launch.hero has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 566, colorize, a function literal at line 537, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CircuitTabTools.PcbConstrainControls (cyclomatic 26) packages/app/src/components/electronics/CircuitTabTools.tsx:372— CircuitTabTools.PcbConstrainControls has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 384, 421, 475, …). 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.
usePhysicsSimulation.usePhysicsSimulation (cyclomatic 26) packages/app/src/hooks/usePhysicsSimulation.ts:29— usePhysicsSimulation.usePhysicsSimulation has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 213, 73, 59, …). 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.
build.normalizeGlue (cyclomatic 26) packages/kernel-wasm/scripts/build.mjs:76— build.normalizeGlue 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.
claims-ledger.ledgerReceiptClaim (cyclomatic 26) packages/mcp/src/tools/claims-ledger.ts:593— claims-ledger.ledgerReceiptClaim 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.
assemble.assembleInto (cyclomatic 26) packages/mcp/src/tools/assemble.ts:65— assemble.assembleInto has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
schematic-hierarchy.flattenSchematic::elaborate (cyclomatic 26) packages/mcp/src/tools/schematic-hierarchy.ts:150— schematic-hierarchy.flattenSchematic::elaborate 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.
ecad.solidFromBoard (cyclomatic 26) packages/mcp/src/tools/ecad.ts:14099— ecad.solidFromBoard 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.
LinearDimension::render (cyclomatic 25) crates/vcad-kernel-drafting/src/dimension/linear.rs:134— LinearDimension::render 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.
make_figures.figB (cyclomatic 25) docs/compression-math-survey/launch-figures/make_figures.py:203— make_figures.figB 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.
ElectronicsCanvas.copperAt (cyclomatic 25) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:713— ElectronicsCanvas.copperAt 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.
build.toolSummary (cyclomatic 25) mecheval/leaderboard/src/build.ts:2221— build.toolSummary has cyclomatic complexity 25 (threshold 15). Of this number, 24 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.
DfmDrawer.DfmDrawer (cyclomatic 25) packages/app/src/components/DfmDrawer.tsx:36— DfmDrawer.DfmDrawer has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DocTitle.DocTitle (cyclomatic 25) packages/app/src/components/DocTitle.tsx:34— DocTitle.DocTitle has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 5 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.
part-summary.getPartSummary (cyclomatic 25) packages/app/src/components/tree/part-summary.ts:9— part-summary.getPartSummary 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.
FeatureTree.SketchTreeSection (cyclomatic 25) packages/app/src/components/FeatureTree.tsx:134— FeatureTree.SketchTreeSection has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 4 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.
ParametersPanel.ParameterRow (cyclomatic 25) packages/app/src/components/ParametersPanel.tsx:151— ParametersPanel.ParameterRow has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (commitValue, commitName, a function literal at line 229, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PcbKernelBoard.PcbKernelBoard (cyclomatic 25) packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx:103— PcbKernelBoard.PcbKernelBoard has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 216, 146, 261, …). 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.
Viewport.Viewport (cyclomatic 25) packages/app/src/components/Viewport.tsx:232— Viewport.Viewport has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 386, 353, 274, …). 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.
EcadFeatureInspector.ComponentFootprintPanel (cyclomatic 25) packages/app/src/components/electronics/EcadFeatureInspector.tsx:154— EcadFeatureInspector.ComponentFootprintPanel has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
claims-ledger.extractClaims::visit (cyclomatic 25) packages/mcp/src/tools/claims-ledger.ts:251— claims-ledger.extractClaims::visit 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.
claims-ledger.attachClaims (cyclomatic 25) packages/mcp/src/tools/claims-ledger.ts:343— claims-ledger.attachClaims 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.
ecad.addCoilArray (cyclomatic 25) packages/mcp/src/tools/ecad.ts:8098— ecad.addCoilArray has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ecad.setBoardOutline (cyclomatic 25) packages/mcp/src/tools/ecad.ts:8457— ecad.setBoardOutline has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
animate.buildSequenceGlb (cyclomatic 25) packages/mcp/src/tools/animate.ts:527— animate.buildSequenceGlb has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.analyzeRustSource (cyclomatic 25) packages/wasmosis/src/cli.ts:199— cli.analyzeRustSource has cyclomatic complexity 25 (threshold 15). Of this number, 19 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.
receipt-art.init (cyclomatic 25) www/src/receipt-art.js:9— receipt-art.init has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (play, el, drawPart, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Regions::new (cyclomatic 24) crates/vcad-kernel-dfm/src/geom/probe.rs:466— Regions::new 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.
CNCStatus.ingest (cyclomatic 24) apple/VcadApp/Sources/VcadApp/CNC.swift:34— CNCStatus.ingest 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.
CNCController.setOverride (cyclomatic 24) apple/VcadApp/Sources/VcadApp/CNC.swift:429— CNCController.setOverride 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.
EditorModel.promoteSandboxToDocument (cyclomatic 24) apple/VcadApp/Sources/VcadApp/Editor.swift:4902— EditorModel.promoteSandboxToDocument has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NativeElectronicsView.navigator (cyclomatic 24) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:141— NativeElectronicsView.navigator 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.
ReleasedOverlayView.marqueeOrOrbitGesture (cyclomatic 24) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1738— ReleasedOverlayView.marqueeOrOrbitGesture has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
build.taskPage (cyclomatic 24) mecheval/leaderboard/src/build.ts:2033— build.taskPage has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: 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.
DrawingToolbar.DrawingToolbar (cyclomatic 24) packages/app/src/components/DrawingToolbar.tsx:35— DrawingToolbar.DrawingToolbar has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 2 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.
SketchPlane3D.SketchCursor3D (cyclomatic 24) packages/app/src/components/SketchPlane3D.tsx:549— SketchPlane3D.SketchCursor3D has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CircuitAnalysisPanel.CircuitAnalysisPanel (cyclomatic 24) packages/app/src/components/electronics/CircuitAnalysisPanel.tsx:278— CircuitAnalysisPanel.CircuitAnalysisPanel has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sketch-math.computeSketchBounds (cyclomatic 24) packages/core/src/sketch-math.ts:411— sketch-math.computeSketchBounds has cyclomatic complexity 24 (threshold 15). Of this number, 20 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.
ecad.detectStaleNets (cyclomatic 24) packages/mcp/src/tools/ecad.ts:3600— ecad.detectStaleNets has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 6 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.
ecad.exportKicad (cyclomatic 24) packages/mcp/src/tools/ecad.ts:6251— ecad.exportKicad 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.
ecad.deletePcbElement (cyclomatic 24) packages/mcp/src/tools/ecad.ts:10117— ecad.deletePcbElement has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 2 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.
ecad.addMotorWinding::feedClear (cyclomatic 24) packages/mcp/src/tools/ecad.ts:12102— ecad.addMotorWinding::feedClear 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 shape REPEATS in the file: one other method here (ecad.addMotorWinding) 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.
ecad.findCavity (cyclomatic 24) packages/mcp/src/tools/ecad.ts:13350— ecad.findCavity has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
flat-pattern.flatPatternFromSolid (cyclomatic 24) packages/mcp/src/tools/flat-pattern.ts:176— flat-pattern.flatPatternFromSolid has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
infer.validateVCode (cyclomatic 24) packages/training/src/infer.ts:236— infer.validateVCode has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity· cli.program.command("infer").description("Generate VCode from a text prompt").requiredOption("-p, --prompt <prompt>","Text d (cyclomatic 24) · ×1
cli.program.command("infer").description("Generate VCode from a text prompt").requiredOption("-p, --prompt <prompt>","Text d (cyclomatic 24) packages/training/src/cli.ts:735— cli.program.command("infer").description("Generate VCode from a text prompt").requiredOption("-p, --prompt <prompt>","Text d 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.
SparseDiff::inner (cyclomatic 23) crates/vcad-ecad-pcb/src/router/claims_ir.rs:610— SparseDiff::inner 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.
vcad_slicer::analyze::analyze_for_printing (cyclomatic 23) crates/vcad-slicer/src/analyze.rs:74— vcad_slicer::analyze::analyze_for_printing 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.
CNCOutline.parseDXF (cyclomatic 23) apple/VcadApp/Sources/VcadApp/CNCOutline.swift:42— CNCOutline.parseDXF has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
EditorModel.navCommand (cyclomatic 23) apple/VcadApp/Sources/VcadApp/NavigationViews.swift:225— EditorModel.navCommand 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.
DockTools.design (cyclomatic 23) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:554— DockTools.design 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.
print-flow-mockup.html.document.addEventListener("click") (cyclomatic 23) docs/design/print-flow-mockup.html:226— print-flow-mockup.html.document.addEventListener("click") has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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: print-flow-mockup.html.render (cyclomatic 35) 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.
build.paretoScatter (cyclomatic 23) mecheval/leaderboard/src/build.ts:1561— build.paretoScatter has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1605, a function literal at line 1653, a function literal at line 1565, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Viewport.BoxSelectHandler (cyclomatic 23) packages/app/src/components/Viewport.tsx:65— Viewport.BoxSelectHandler has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 155, 125, 107, …). 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.
RaytraceChip.RaytraceChip (cyclomatic 23) packages/app/src/components/footer/RaytraceChip.tsx:36— RaytraceChip.RaytraceChip has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, 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.
PrinterSelect.PrinterSelect (cyclomatic 23) packages/app/src/components/print/PrinterSelect.tsx:12— PrinterSelect.PrinterSelect has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 4 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.
save-load.parseJsonVcadFile (cyclomatic 23) packages/core/src/utils/save-load.ts:327— save-load.parseJsonVcadFile 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.
pose.applyJointState (cyclomatic 23) packages/mcp/src/tools/pose.ts:87— pose.applyJointState has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
measure.measureSweepResult (cyclomatic 23) packages/mcp/src/tools/measure.ts:289— measure.measureSweepResult has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 2 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.
ecad.componentKeepouts (cyclomatic 23) packages/mcp/src/tools/ecad.ts:14008— ecad.componentKeepouts 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.
render.renderPcb (cyclomatic 23) packages/mcp/src/tools/render.ts:950— render.renderPcb has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FvSystem::solve (cyclomatic 22) crates/vcad-kernel-em/src/grid.rs:405— FvSystem::solve 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.
vcad_kernel_em::ac::solve_complex (cyclomatic 22) crates/vcad-kernel-em/src/ac.rs:124— vcad_kernel_em::ac::solve_complex 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.
Connection::handle_legacy (cyclomatic 22) crates/vcad-mcp/src/server.rs:1357— Connection::handle_legacy 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.
EditorModel.adoptRuntimeFrame (cyclomatic 22) apple/VcadApp/Sources/VcadApp/DocumentRuntime.swift:154— EditorModel.adoptRuntimeFrame 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.
EditorModel.measurement (cyclomatic 22) apple/VcadApp/Sources/VcadApp/Measure.swift:18— EditorModel.measurement has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SketchSession.lineTap (cyclomatic 22) apple/VcadApp/Sources/VcadApp/SketchSession.swift:789— SketchSession.lineTap has cyclomatic complexity 22 (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: SketchConstraintKind.label (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
build.runPage (cyclomatic 22) mecheval/leaderboard/src/build.ts:2271— build.runPage has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
render-task-assets.main (cyclomatic 22) mecheval/scripts/render-task-assets.mjs:72— render-task-assets.main has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompressedFieldOverlay.CompressedFieldHud (cyclomatic 22) packages/app/src/components/CompressedFieldOverlay.tsx:218— CompressedFieldOverlay.CompressedFieldHud has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 2 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.
InlineProperties.InlineProperties (cyclomatic 22) packages/app/src/components/InlineProperties.tsx:178— InlineProperties.InlineProperties has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
executors.tryExecuteViaEngine (cyclomatic 22) packages/core/src/commands/executors.ts:214— executors.tryExecuteViaEngine 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.
clearance.computeGroupClearance (cyclomatic 22) packages/mcp/src/tools/clearance.ts:252— clearance.computeGroupClearance 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.
claims-ledger.recordClaimMeasurements (cyclomatic 22) packages/mcp/src/tools/claims-ledger.ts:486— claims-ledger.recordClaimMeasurements 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.
print-check.recordMeasurement (cyclomatic 22) packages/mcp/src/tools/print-check.ts:309— print-check.recordMeasurement 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.
loon.hasRootWithoutMaterial (cyclomatic 22) packages/mcp/src/tools/loon.ts:295— loon.hasRootWithoutMaterial has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 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.
trust-boundary.checkCommerceBoundary (cyclomatic 22) packages/mcp/src/trust-boundary.ts:145— trust-boundary.checkCommerceBoundary 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.
part-stock.annotateBomStock (cyclomatic 22) packages/mcp/src/tools/part-stock.ts:569— part-stock.annotateBomStock 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.
ecad.aggregateDrc (cyclomatic 22) packages/mcp/src/tools/ecad.ts:4630— ecad.aggregateDrc 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.
Key::parse (cyclomatic 21) crates/vcad-app/src/keybinding.rs:40— Key::parse 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.
ShellCase::validate (cyclomatic 21) crates/vcad-kernel-fea/src/shell.rs:171— ShellCase::validate 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.
EditorModel.beginManip (cyclomatic 21) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:141— EditorModel.beginManip 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.
BoardPainter.draw (cyclomatic 21) apple/VcadApp/Sources/VcadApp/ElectronicsBoardLayer.swift:47— BoardPainter.draw 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.
build.main (cyclomatic 21) mecheval/leaderboard/src/build.ts:2474— build.main has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 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.
launch.component (cyclomatic 21) packages/app/public/launch/launch.js:373— launch.component 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.
DocumentPicker.DocumentRow (cyclomatic 21) packages/app/src/components/DocumentPicker.tsx:91— DocumentPicker.DocumentRow has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
slicer-worker.onmessage (cyclomatic 21) packages/app/src/lib/slicer-worker.ts:141— slicer-worker.onmessage 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.
registry-dispatch.engineArgs (cyclomatic 21) packages/mcp/src/tools/registry-dispatch.ts:612— registry-dispatch.engineArgs 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.
registry-dispatch.sameUnderSerdeDefaults (cyclomatic 21) packages/mcp/src/tools/registry-dispatch.ts:792— registry-dispatch.sameUnderSerdeDefaults has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 belong to one function item 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.
topopt.topologyOptimizeTool (cyclomatic 21) packages/mcp/src/tools/topopt.ts:280— topopt.topologyOptimizeTool 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.
gym.gymStep (cyclomatic 21) packages/mcp/src/tools/gym.ts:637— gym.gymStep has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
ecad.summarizePlacementDrc (cyclomatic 21) packages/mcp/src/tools/ecad.ts:5586— ecad.summarizePlacementDrc has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 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.
ecad.validateForFab (cyclomatic 21) packages/mcp/src/tools/ecad.ts:6607— ecad.validateForFab 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.
ecad.setStackup (cyclomatic 21) packages/mcp/src/tools/ecad.ts:9642— ecad.setStackup 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.
ecad.addNetTie (cyclomatic 21) packages/mcp/src/tools/ecad.ts:10617— ecad.addNetTie 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.
ecad.checkSelfStart (cyclomatic 21) packages/mcp/src/tools/ecad.ts:12872— ecad.checkSelfStart has cyclomatic complexity 21 (threshold 15). Of this number, 19 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.
ecad.traceGridBoundaries (cyclomatic 21) packages/mcp/src/tools/ecad.ts:13191— ecad.traceGridBoundaries has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 2 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.
gallery.component (cyclomatic 21) www/public/kit/gallery.js:546— gallery.component 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.
vcad_runtime::run (cyclomatic 20) crates/vcad-runtime/src/lib.rs:553— vcad_runtime::run 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.
SmartDimension.plan (cyclomatic 20) apple/VcadApp/Sources/VcadApp/SketchInference.swift:159— SmartDimension.plan 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.
SketchFill.triangulate (cyclomatic 20) apple/VcadApp/Sources/VcadApp/SketchInference.swift:249— SketchFill.triangulate has cyclomatic complexity 20 (threshold 15). Of this number, 18 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.
claude-mcp.makeClaudeMcpSolver.solve (cyclomatic 20) mecheval/harness/src/solvers/claude-mcp.ts:312— claude-mcp.makeClaudeMcpSolver.solve has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 2 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.
gateway-mcp.makeGatewayMcpSolver.solve (cyclomatic 20) mecheval/harness/src/solvers/gateway-mcp.ts:96— gateway-mcp.makeGatewayMcpSolver.solve has cyclomatic complexity 20 (threshold 15). Of this number, 16 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.
engine-host.handleEngineRequest (cyclomatic 20) packages/engine/src/engine-host.ts:109— engine-host.handleEngineRequest 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.
preview.generateGlbPreview (cyclomatic 20) packages/mcp/src/tools/preview.ts:155— preview.generateGlbPreview 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.
ecad.calcRf (cyclomatic 20) packages/mcp/src/tools/ecad.ts:7631— ecad.calcRf has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 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.
TerminalCaps::detect (cyclomatic 19) crates/termview/src/terminal.rs:53— TerminalCaps::detect 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.
vcad_atoms::optimize::optimize_parameters (cyclomatic 19) crates/vcad-atoms/src/optimize.rs:335— vcad_atoms::optimize::optimize_parameters 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.
GridRouter::route_net (cyclomatic 19) crates/vcad-ecad-pcb/src/router/grid.rs:130— GridRouter::route_net 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.
CircuitEnv::attempt_step (cyclomatic 19) crates/vcad-ecad-sim/src/circuit/mod.rs:500— CircuitEnv::attempt_step 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.
Loop::new (cyclomatic 19) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:709— Loop::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.
Electrostatics::solve (cyclomatic 19) crates/vcad-kernel-em/src/electro.rs:176— Electrostatics::solve 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.
Profile::validate (cyclomatic 19) crates/vcad-kernel-fea/src/section.rs:118— Profile::validate 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.
Stackup::validate (cyclomatic 19) crates/vcad-kernel-tolerance/src/stackup.rs:333— Stackup::validate 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.
WorkspaceHeader.body (cyclomatic 19) apple/VcadApp/Sources/VcadApp/CNCStudio.swift:14— WorkspaceHeader.body 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.
EditorModel.placedSpurGear (cyclomatic 19) apple/VcadApp/Sources/VcadApp/Gears.swift:83— EditorModel.placedSpurGear has cyclomatic complexity 19 (threshold 15). Of this number, 18 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.
ElectronicsWorkspace.annotate (cyclomatic 19) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:834— ElectronicsWorkspace.annotate has cyclomatic complexity 19 (threshold 15). Of this number, 15 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.
ReleasedOverlayView.commitTopologyMarquee (cyclomatic 19) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1863— ReleasedOverlayView.commitTopologyMarquee 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.
SketchSession.dimensionTap (cyclomatic 19) apple/VcadApp/Sources/VcadApp/SketchSession.swift:699— SketchSession.dimensionTap has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: SketchConstraintKind.label (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
solver.getSolver (cyclomatic 19) mecheval/harness/src/solver.ts:147— solver.getSolver 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.
Header.Header (cyclomatic 19) packages/app/src/components/Header.tsx:355— Header.Header has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 375, handleExport, a function literal at line 415, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ElectronicsPanelHeader.ElectronicsPanelHeader (cyclomatic 19) packages/app/src/components/electronics/ElectronicsPanelHeader.tsx:207— ElectronicsPanelHeader.ElectronicsPanelHeader 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.
toolbar.MoreDropdown (cyclomatic 19) packages/app/src/components/ui/toolbar.tsx:245— toolbar.MoreDropdown has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useBackgroundLuminance.useBackgroundLuminance (cyclomatic 19) packages/app/src/hooks/useBackgroundLuminance.ts:8— useBackgroundLuminance.useBackgroundLuminance has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 17, 90, 94, …). 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.
useElectronicsSync.useElectronicsSync (cyclomatic 19) packages/app/src/hooks/useElectronicsSync.ts:31— useElectronicsSync.useElectronicsSync has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 110, 104, 41, …). 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.
ui-store.useUiStore (cyclomatic 19) packages/core/src/stores/ui-store.ts:299— ui-store.useUiStore has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 426, 474, 556, …). 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.
executors.executePlacePart (cyclomatic 19) packages/core/src/commands/executors.ts:554— executors.executePlacePart 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.
chat-store.useChatStore (cyclomatic 19) packages/core/src/stores/chat-store.ts:304— chat-store.useChatStore has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 402, 464, 371, …). 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.
receipt-unified.unifiedFromSpec (cyclomatic 19) packages/mcp/src/receipt-unified.ts:444— receipt-unified.unifiedFromSpec 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.
registry-dispatch.snapshotParts::canon (cyclomatic 19) packages/mcp/src/tools/registry-dispatch.ts:323— registry-dispatch.snapshotParts::canon 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.
loon.addLoonToSession (cyclomatic 19) packages/mcp/src/tools/loon.ts:34— loon.addLoonToSession has cyclomatic complexity 19 (threshold 15). Of this number, 18 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.
parts.placePartTool (cyclomatic 19) packages/mcp/src/tools/parts.ts:191— parts.placePartTool 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.
acoustics.simulateStrike (cyclomatic 19) packages/mcp/src/tools/acoustics.ts:216— acoustics.simulateStrike 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.
server.slimPreviewForInlineUi (cyclomatic 19) packages/mcp/src/server.ts:1683— server.slimPreviewForInlineUi has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
server.resolvePreviewDocumentId (cyclomatic 19) packages/mcp/src/server.ts:1927— server.resolvePreviewDocumentId 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.
Roughing3D::generate_level_passes (cyclomatic 18) crates/vcad-kernel-cam/src/operation/roughing3d.rs:163— Roughing3D::generate_level_passes 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.
Probe::new (cyclomatic 18) crates/vcad-kernel-dfm/src/geom/probe.rs:82— Probe::new has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_kernel_gpu::wavefront_batch::distance_fields_batch_async (cyclomatic 18) crates/vcad-kernel-gpu/src/wavefront_batch.rs:74— vcad_kernel_gpu::wavefront_batch::distance_fields_batch_async 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.
DeviceSpec3d::parameter_roles (cyclomatic 18) crates/vcad-kernel-particle/src/spec3d.rs:389— DeviceSpec3d::parameter_roles has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StepWriter::write_loops (cyclomatic 18) crates/vcad-kernel-step/src/writer.rs:845— StepWriter::write_loops has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MeshRayIndex::new (cyclomatic 18) crates/vcad-kernel-tessellate/src/mesh_ray.rs:190— MeshRayIndex::new has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
vcad_receipt_verify::verify (cyclomatic 18) crates/vcad-receipt-verify/src/lib.rs:126— vcad_receipt_verify::verify 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.
AgentViewer.filletEdges (cyclomatic 18) apple/VcadApp/Sources/VcadApp/AgentResources.swift:173— AgentViewer.filletEdges 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.
EditorModel.featureHandles (cyclomatic 18) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:96— EditorModel.featureHandles 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.
SafeWriter.write (cyclomatic 18) apple/VcadApp/Sources/VcadApp/LocalHistory.swift:41— SafeWriter.write 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.
ReleaseWindowController.show (cyclomatic 18) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:137— ReleaseWindowController.show 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.
ReleasedOverlayView.body (cyclomatic 18) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:867— ReleasedOverlayView.body 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.
ReleasedARView.updateNSView (cyclomatic 18) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2048— ReleasedARView.updateNSView 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.
SoundPanel.swift.nearestPartHit (cyclomatic 18) apple/VcadApp/Sources/VcadApp/SoundPanel.swift:765— SoundPanel.swift.nearestPartHit 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.
launch.dressBoard (cyclomatic 18) packages/app/public/launch/launch.js:426— launch.dressBoard has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 427, 459). 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.
AtomInstances.AtomInstances (cyclomatic 18) packages/app/src/components/AtomInstances.tsx:201— AtomInstances.AtomInstances has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 308, handlePick, a function literal at line 363, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FeatureTree.getPartIcon (cyclomatic 18) packages/app/src/components/FeatureTree.tsx:394— FeatureTree.getPartIcon 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.
PropertyPanel.SubFeatureInspector (cyclomatic 18) packages/app/src/components/PropertyPanel.tsx:1338— PropertyPanel.SubFeatureInspector has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, 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.
QuotePanel.QuotePanel (cyclomatic 18) packages/app/src/components/QuotePanel.tsx:102— QuotePanel.QuotePanel has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 135, a function literal at line 176, a function literal at line 187, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useAutoSave.useAutoSave (cyclomatic 18) packages/app/src/hooks/useAutoSave.ts:42— useAutoSave.useAutoSave has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 155, 94, 103, …). 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.
useCircuitSim.useCircuitSim (cyclomatic 18) packages/app/src/hooks/useCircuitSim.ts:22— useCircuitSim.useCircuitSim has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 41, 30, 62, …). 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.
Navigation.Navigation (cyclomatic 18) packages/docs/src/components/Navigation.tsx:172— Navigation.Navigation has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (renderNavItem, a function literal at line 182, isActive, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vcad_kernel_wasm.debugString (cyclomatic 18) packages/kernel-wasm/vcad_kernel_wasm.js:11400— vcad_kernel_wasm.debugString 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.
clearance.verifyClearanceClaims (cyclomatic 18) packages/mcp/src/tools/clearance.ts:1052— clearance.verifyClearanceClaims 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.
print-check.parseMeasurables (cyclomatic 18) packages/mcp/src/tools/print-check.ts:157— print-check.parseMeasurables has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 160). 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.
Lattice.cast (cyclomatic 18) packages/mcp/src/tools/joint-range.ts:82— Lattice.cast 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.
ecad.inspectSchematic (cyclomatic 18) packages/mcp/src/tools/ecad.ts:2506— ecad.inspectSchematic has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 4 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.
ecad.forceDirectedRefine (cyclomatic 18) packages/mcp/src/tools/ecad.ts:2657— ecad.forceDirectedRefine has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ecad.lengthMatchTraces (cyclomatic 18) packages/mcp/src/tools/ecad.ts:4815— ecad.lengthMatchTraces has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
main.applySimFrame (cyclomatic 18) packages/mcp/viewer-app/main.ts:1617— main.applySimFrame 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.
gallery.dressBoard (cyclomatic 18) www/public/kit/gallery.js:599— gallery.dressBoard has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 600, 632). 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.
vcad_termview::braille::buffer_to_braille (cyclomatic 17) crates/termview/src/braille.rs:11— vcad_termview::braille::buffer_to_braille 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.
RouteSession::from_pcb (cyclomatic 17) crates/vcad-ecad-pcb/src/session.rs:282— RouteSession::from_pcb has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Mesh::build (cyclomatic 17) crates/vcad-kernel-antenna/src/geometry.rs:254— Mesh::build 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.
vcad_kernel_optics::optimize::minimize (cyclomatic 17) crates/vcad-kernel-optics/src/optimize.rs:55— vcad_kernel_optics::optimize::minimize 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.
WireField::surface_residual (cyclomatic 17) crates/vcad-kernel-particle/src/bem.rs:821— WireField::surface_residual 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.
MarchingCubes::extract (cyclomatic 17) crates/vcad-kernel-stocksim/src/marching_cubes.rs:15— MarchingCubes::extract 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.
PatternFit::monte_carlo (cyclomatic 17) crates/vcad-kernel-tolerance/src/gdt.rs:290— PatternFit::monte_carlo 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.
vcad_process::sim::simulate (cyclomatic 17) crates/vcad-process/src/sim.rs:147— vcad_process::sim::simulate 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.
vcad_receipt::mechanical::mass_properties_claims (cyclomatic 17) crates/vcad-receipt/src/mechanical.rs:276— vcad_receipt::mechanical::mass_properties_claims 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.
vcad_torture::run (cyclomatic 17) crates/vcad-torture/src/main.rs:173— vcad_torture::run 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.
AgentEdits.adoptDocument (cyclomatic 17) apple/VcadApp/Sources/VcadApp/AgentEdits.swift:121— AgentEdits.adoptDocument 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.
AgentSession.submit (cyclomatic 17) apple/VcadApp/Sources/VcadApp/AgentPanel.swift:51— AgentSession.submit 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.
DeepLink.init (cyclomatic 17) apple/VcadApp/Sources/VcadApp/AppInstance.swift:134— DeepLink.init 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.
EditorModel.cubeFaceKind (cyclomatic 17) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:338— EditorModel.cubeFaceKind 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.
EditorModel.applyBlend (cyclomatic 17) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:85— EditorModel.applyBlend 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.
BoardPainter.drawPads (cyclomatic 17) apple/VcadApp/Sources/VcadApp/ElectronicsBoardLayer.swift:183— BoardPainter.drawPads 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.
SchematicPainter.drawGlyph (cyclomatic 17) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:256— SchematicPainter.drawGlyph 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.
SketchSession.filletTap (cyclomatic 17) apple/VcadApp/Sources/VcadApp/SketchSession.swift:962— SketchSession.filletTap 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. This is NOT this file's highest cyclomatic complexity: SketchConstraintKind.label (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
WelcomeView.move (cyclomatic 17) apple/VcadApp/Sources/VcadApp/WelcomeWindow.swift:572— WelcomeView.move 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.
launch-animatic.html.render (cyclomatic 17) docs/launch/launch-animatic.html:193— launch-animatic.html.render has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
launch.autoSmooth (cyclomatic 17) packages/app/public/launch/launch.js:171— launch.autoSmooth has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AnalyzePanel.StudyCard (cyclomatic 17) packages/app/src/components/AnalyzePanel.tsx:510— AnalyzePanel.StudyCard has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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.
KoanChip.KoanChip (cyclomatic 17) packages/app/src/components/footer/KoanChip.tsx:63— KoanChip.KoanChip has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DfmOverlay.DfmOverlay (cyclomatic 17) packages/app/src/components/print/DfmOverlay.tsx:36— DfmOverlay.DfmOverlay 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 4 function items inside it that branch (a function literal at line 43, severityIcon, a function literal at line 74, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
usePcbAutoFit.usePcbAutoFit (cyclomatic 17) packages/app/src/hooks/usePcbAutoFit.ts:26— usePcbAutoFit.usePcbAutoFit has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 36, 32). 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.
sketch-constraint-persist.sketchConstraintToDesign (cyclomatic 17) packages/core/src/sketch-constraint-persist.ts:42— sketch-constraint-persist.sketchConstraintToDesign 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.
sheet-metal.buildSheetMetalChain (cyclomatic 17) packages/engine/src/sheet-metal.ts:419— sheet-metal.buildSheetMetalChain 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.
evaluate.evaluateDocumentTS (cyclomatic 17) packages/engine/src/evaluate.ts:542— evaluate.evaluateDocumentTS 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: evaluate.remapNodeIds (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.
index.parseJoint (cyclomatic 17) packages/ir/src/index.ts:1100— index.parseJoint 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, separate the cases: extract each independent 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: index.getChildren (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
ecad.schematicSummary (cyclomatic 17) packages/mcp/src/tools/ecad.ts:2572— ecad.schematicSummary 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.
ecad.drcPcb (cyclomatic 17) packages/mcp/src/tools/ecad.ts:4941— ecad.drcPcb 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.
ecad.polygonOverlapBbox (cyclomatic 17) packages/mcp/src/tools/ecad.ts:13151— ecad.polygonOverlapBbox 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.
import-urdf.importUrdf (cyclomatic 17) packages/mcp/src/tools/import-urdf.ts:183— import-urdf.importUrdf 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.
changelog.getChangelog (cyclomatic 17) packages/mcp/src/tools/changelog.ts:58— changelog.getChangelog has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
animate.validateTimeline (cyclomatic 17) packages/mcp/src/tools/animate.ts:81— animate.validateTimeline has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 95). 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.
gallery.autoSmooth (cyclomatic 17) www/public/kit/gallery.js:283— gallery.autoSmooth has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PairProblem::add_clearance (cyclomatic 16) crates/vcad-ecad-pcb/src/router/descent.rs:605— PairProblem::add_clearance 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.
TriangleMesh::edge_segments (cyclomatic 16) crates/vcad-kernel-tessellate/src/lib.rs:312— TriangleMesh::edge_segments 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.
PrinterStatus::from_mqtt_payload (cyclomatic 16) crates/vcad-slicer-bambu/src/status.rs:154— PrinterStatus::from_mqtt_payload 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.
AnalysisAgentTools.call (cyclomatic 16) apple/VcadApp/Sources/VcadApp/AnalysisAgentTools.swift:17— AnalysisAgentTools.call 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.
FeaSection.body (cyclomatic 16) apple/VcadApp/Sources/VcadApp/AnalysisPanel.swift:142— FeaSection.body 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.
DeepLink.gunzip (cyclomatic 16) apple/VcadApp/Sources/VcadApp/AppInstance.swift:225— DeepLink.gunzip 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.
ElectronicsWorkspace.commitRoute (cyclomatic 16) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:143— ElectronicsWorkspace.commitRoute 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.
ElectronicsWorkspace.saveFootprintToLibrary (cyclomatic 16) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:699— ElectronicsWorkspace.saveFootprintToLibrary has cyclomatic complexity 16 (threshold 15). Of this number, 13 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.
launch.creaseGeometry (cyclomatic 16) packages/app/public/launch/launch.js:221— launch.creaseGeometry has cyclomatic complexity 16 (threshold 15). Of this number, 15 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.
FeatureTree.FeatureTree (cyclomatic 16) packages/app/src/components/FeatureTree.tsx:1127— FeatureTree.FeatureTree has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 4 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.
KeyboardPrefsPanel.CommandRow (cyclomatic 16) packages/app/src/components/KeyboardPrefsPanel.tsx:209— KeyboardPrefsPanel.CommandRow has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Header.RayTracingSubmenu (cyclomatic 16) packages/app/src/components/Header.tsx:254— Header.RayTracingSubmenu has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 298, qualityLabel, a function literal at line 286, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CircuitTabTools.CircuitTabTools (cyclomatic 16) packages/app/src/components/electronics/CircuitTabTools.tsx:44— CircuitTabTools.CircuitTabTools has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActionResultCard.ActionResultCard (cyclomatic 16) packages/app/src/components/ui/notifications/ActionResultCard.tsx:58— ActionResultCard.ActionResultCard has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
drawing-sheet.buildDrawingSheetSpec (cyclomatic 16) packages/app/src/lib/drawing-sheet.ts:223— drawing-sheet.buildDrawingSheetSpec 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.
sub-feature-picking.pickSubFeature (cyclomatic 16) packages/app/src/lib/sub-feature-picking.ts:99— sub-feature-picking.pickSubFeature 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.
camera-framing.expandBboxFromPositions (cyclomatic 16) packages/core/src/camera-framing.ts:75— camera-framing.expandBboxFromPositions 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.
app-link.deliverPush (cyclomatic 16) packages/mcp/src/app-link.ts:261— app-link.deliverPush 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.
inspect.computeInspection (cyclomatic 16) packages/mcp/src/tools/inspect.ts:145— inspect.computeInspection has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sweep.resolveSweepAxes (cyclomatic 16) packages/mcp/src/tools/sweep.ts:126— sweep.resolveSweepAxes has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
measure.measure (cyclomatic 16) packages/mcp/src/tools/measure.ts:417— measure.measure 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.
pcb-validate.validatePcb (cyclomatic 16) packages/mcp/src/tools/pcb-validate.ts:33— pcb-validate.validatePcb 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.
constraint-claims.verifyConstraintClaims (cyclomatic 16) packages/mcp/src/tools/constraint-claims.ts:171— constraint-claims.verifyConstraintClaims 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.
ecad.legalizeCrossNetClearance (cyclomatic 16) packages/mcp/src/tools/ecad.ts:2773— ecad.legalizeCrossNetClearance has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
ecad.lmSolve (cyclomatic 16) packages/mcp/src/tools/ecad.ts:6823— ecad.lmSolve has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
ecad.getFootprint (cyclomatic 16) packages/mcp/src/tools/ecad.ts:9016— ecad.getFootprint 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.
ecad.rasterizeSection (cyclomatic 16) packages/mcp/src/tools/ecad.ts:13302— ecad.rasterizeSection 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.
ecad.largestComponent (cyclomatic 16) packages/mcp/src/tools/ecad.ts:13433— ecad.largestComponent 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.
ecad.sealedCavityFromMesh (cyclomatic 16) packages/mcp/src/tools/ecad.ts:13562— ecad.sealedCavityFromMesh has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
animate.compileJointKeyframes (cyclomatic 16) packages/mcp/src/tools/animate.ts:231— animate.compileJointKeyframes 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.
version-check.compareVersions (cyclomatic 16) packages/mcp/src/version-check.ts:38— version-check.compareVersions 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.
gallery.creaseGeometry (cyclomatic 16) www/public/kit/gallery.js:333— gallery.creaseGeometry has cyclomatic complexity 16 (threshold 15). Of this number, 15 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.
galleryFigure (cyclomatic 16) www/public/kit/gallery.js:467— galleryFigure 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 7 function items inside it that branch (a function literal at line 480, a function literal at line 476, a function literal at line 507, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SchematicCanvas.SchematicCanvas (cognitive 249) packages/app/src/components/electronics/SchematicCanvas.tsx:230— SchematicCanvas.SchematicCanvas has cognitive complexity 249 (threshold 15). Drivers by points: if/else 74 (108 pts), ternaries 46 (61 pts), boolean chains 45, loops 15 (35 pts) (nesting depth added 69). Of this number, 21 points are the body's own statements and 228 belong to 41 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.
ecad.routeNets (cognitive 239) packages/mcp/src/tools/ecad.ts:3811— ecad.routeNets has cognitive complexity 239 (threshold 15). Drivers by points: if/else 63 (117 pts), loops 27 (52 pts), boolean chains 38, ternaries 26 (32 pts) (nesting depth added 85). Of this number, 213 points are the body's own statements and 26 belong to 5 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.
ViewportContent.ViewportContent (cognitive 228) packages/app/src/components/ViewportContent.tsx:366— ViewportContent.ViewportContent has cognitive complexity 228 (threshold 15). Drivers by points: if/else 103 (145 pts), boolean chains 40, loops 14 (30 pts), ternaries 7 (10 pts), match/switch 2 (3 pts) (nesting depth added 62). Of this number, 20 points are the body's own statements and 208 belong to 45 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.
document-store.useDocumentStore (cognitive 215) packages/core/src/stores/document-store.ts:948— document-store.useDocumentStore has cognitive complexity 215 (threshold 15). Drivers by points: if/else 119 (148 pts), boolean chains 30, error handling 12 (17 pts), loops 7 (10 pts), ternaries 9, match/switch 1 (nesting depth added 37). None of this is in the body itself: all 215 points belong to 53 function literals inside it that branch (lines 1656, 1263, 1584, …). 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.
ecad.addMotorWinding (cognitive 211) packages/mcp/src/tools/ecad.ts:11593— ecad.addMotorWinding has cognitive complexity 211 (threshold 15). Drivers by points: if/else 76 (189 pts), loops 39 (94 pts), boolean chains 38, ternaries 15 (22 pts) (nesting depth added 175). To reduce it, split the body into named stages: move each independent 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: 2 other methods here (ecad.addMotorWinding::buildFeed, ecad.addMotorWinding::feedClear) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
ecad.fixDrc (cognitive 191) packages/mcp/src/tools/ecad.ts:15028— ecad.fixDrc has cognitive complexity 191 (threshold 15). Drivers by points: if/else 51 (109 pts), ternaries 22 (45 pts), loops 12 (20 pts), boolean chains 17 (nesting depth added 89). Of this number, 161 points are the body's own statements and 30 belong to 14 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.
useKeyboardShortcuts.useKeyboardShortcuts (cognitive 186) packages/app/src/hooks/useKeyboardShortcuts.ts:15— useKeyboardShortcuts.useKeyboardShortcuts has cognitive complexity 186 (threshold 15). Drivers by points: if/else 70 (111 pts), boolean chains 54, ternaries 6 (21 pts) (nesting depth added 56). None of this is in the body itself: all 186 points belong to one function literal inside it that branches (line 17). 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.
server.createServer (cognitive 150) packages/mcp/src/server.ts:744— server.createServer has cognitive complexity 150 (threshold 15). Drivers by points: if/else 56 (79 pts), ternaries 13 (21 pts), error handling 13 (20 pts), boolean chains 18, loops 9 (12 pts) (nesting depth added 41). Of this number, 24 points are the body's own statements and 126 belong to 15 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.
Embedding::route (cognitive 142) crates/vcad-ecad-pcb/src/router/flow/embed.rs:397— Embedding::route has cognitive complexity 142 (threshold 15). Drivers by points: if/else 22 (79 pts), loops 14 (43 pts), match/switch 7 (16 pts), boolean chains 4 (nesting depth added 95). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useToolDefinitions.useToolDefinitions.byTab (cognitive 126) packages/app/src/hooks/useToolDefinitions.tsx:281— useToolDefinitions.useToolDefinitions.byTab has cognitive complexity 126 (threshold 15). Drivers by points: ternaries 36 (46 pts), if/else 36 (42 pts), boolean chains 36, error handling 1, loops 1 (nesting depth added 16). Of this number, 74 points are the body's own statements and 52 belong to 15 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.
AssemblyReader::read_structure (cognitive 124) crates/vcad-kernel-step/src/assembly.rs:301— AssemblyReader::read_structure has cognitive complexity 124 (threshold 15). Drivers by points: if/else 34 (76 pts), loops 20 (30 pts), match/switch 6 (18 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DrawingView.DrawingView (cognitive 124) packages/app/src/components/DrawingView.tsx:121— DrawingView.DrawingView has cognitive complexity 124 (threshold 15). Drivers by points: if/else 46 (54 pts), boolean chains 36, ternaries 26 (29 pts), error handling 4, loops 1 (nesting depth added 11). Of this number, 34 points are the body's own statements and 90 belong to 38 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.
ReleasedOverlayView.viewport (cognitive 122) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:997— ReleasedOverlayView.viewport has cognitive complexity 122 (threshold 15). Drivers by points: if/else 54 (81 pts), ternaries 11 (20 pts), boolean chains 18, match/switch 2 (3 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PcbScene.PcbScene (cognitive 111) packages/app/src/components/electronics/pcb3d/PcbScene.tsx:26— PcbScene.PcbScene has cognitive complexity 111 (threshold 15). Drivers by points: if/else 33 (69 pts), loops 12 (25 pts), boolean chains 12, ternaries 5 (nesting depth added 49). Most of this is not in the body itself: 15 of the 111 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 84, 272, 250, …). 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.
ecad.layoutLint (cognitive 110) packages/mcp/src/tools/ecad.ts:5391— ecad.layoutLint has cognitive complexity 110 (threshold 15). Drivers by points: if/else 22 (60 pts), loops 14 (28 pts), boolean chains 19, ternaries 1 (3 pts) (nesting depth added 54). Of this number, 106 points are the body's own statements and 4 belong to 3 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.
App.App (cognitive 108) packages/app/src/App.tsx:216— App.App has cognitive complexity 108 (threshold 15). Drivers by points: if/else 40 (49 pts), ternaries 15 (27 pts), boolean chains 20, error handling 7 (12 pts) (nesting depth added 26). Of this number, 16 points are the body's own statements and 92 belong to 13 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.
vcad_ecad_export::gerber::write_gerber_layer (cognitive 106) crates/vcad-ecad-export/src/gerber.rs:545— vcad_ecad_export::gerber::write_gerber_layer has cognitive complexity 106 (threshold 15). Drivers by points: loops 27 (64 pts), if/else 18 (35 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 58). 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.
ecad.placeComponents (cognitive 105) packages/mcp/src/tools/ecad.ts:2874— ecad.placeComponents has cognitive complexity 105 (threshold 15). Drivers by points: if/else 38 (51 pts), ternaries 23 (30 pts), boolean chains 20, loops 2, match/switch 2 (nesting depth added 20). Of this number, 72 points are the body's own statements and 33 belong to 10 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.
render.renderView (cognitive 102) packages/mcp/src/tools/render.ts:376— render.renderView has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 37 (51 pts), boolean chains 32, if/else 15 (17 pts), error handling 2 (nesting depth added 16). Of this number, 100 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CNCImport.parse (cognitive 100) apple/VcadApp/Sources/VcadApp/CNCImport.swift:7— CNCImport.parse has cognitive complexity 100 (threshold 15). Drivers by points: if/else 27 (70 pts), ternaries 3 (12 pts), loops 4 (8 pts), boolean chains 6, match/switch 1 (4 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.
source-parser.parseRustSourceContentWithInference (cognitive 97) REDACTED:535— source-parser.parseRustSourceContentWithInference has cognitive complexity 97 (threshold 15). Drivers by points: if/else 28 (82 pts), loops 4 (7 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 59). 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.
ecad.addCoil (cognitive 88) packages/mcp/src/tools/ecad.ts:7744— ecad.addCoil has cognitive complexity 88 (threshold 15). Drivers by points: if/else 23 (40 pts), loops 8 (17 pts), ternaries 10 (17 pts), boolean chains 14 (nesting depth added 33). Of this number, 86 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.
ElectronicsCanvas.body (cognitive 87) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:473— ElectronicsCanvas.body has cognitive complexity 87 (threshold 15). Drivers by points: if/else 34 (50 pts), ternaries 9 (15 pts), boolean chains 14, loops 4 (6 pts), match/switch 2 (nesting depth added 24). Of this number, 86 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.
SketchSession.loopRegions (cognitive 87) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1270— SketchSession.loopRegions has cognitive complexity 87 (threshold 15). Drivers by points: if/else 16 (43 pts), loops 10 (20 pts), boolean chains 16, ternaries 2 (8 pts) (nesting depth added 43). Of this number, 77 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_slicer_gcode::lint::lint (cognitive 86) crates/vcad-slicer-gcode/src/lint.rs:95— vcad_slicer_gcode::lint::lint has cognitive complexity 86 (threshold 15). Drivers by points: if/else 30 (78 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (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.
CNCController.simulateCommand (cognitive 85) apple/VcadApp/Sources/VcadApp/CNC.swift:523— CNCController.simulateCommand has cognitive complexity 85 (threshold 15). Drivers by points: if/else 23 (40 pts), ternaries 6 (24 pts), match/switch 3 (9 pts), loops 4 (7 pts), boolean chains 5 (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.
ReleasedARView.rebuild (cognitive 85) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2149— ReleasedARView.rebuild has cognitive complexity 85 (threshold 15). Drivers by points: if/else 34 (51 pts), boolean chains 24, ternaries 3 (6 pts), loops 3 (4 pts) (nesting depth added 21). Of this number, 84 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.
SceneMesh.SceneMesh (cognitive 85) packages/app/src/components/SceneMesh.tsx:496— SceneMesh.SceneMesh has cognitive complexity 85 (threshold 15). Drivers by points: if/else 46 (51 pts), boolean chains 32, loops 1, ternaries 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 66 belong to 20 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.
animate.exportVideo (cognitive 82) packages/mcp/src/tools/animate.ts:1034— animate.exportVideo has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 20 (31 pts), if/else 19 (25 pts), boolean chains 18, error handling 3 (7 pts), loops 1 (nesting depth added 21). Of this number, 81 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.
CNCOverlay.swift.syncCNCOverlay (cognitive 80) apple/VcadApp/Sources/VcadApp/CNCOverlay.swift:10— CNCOverlay.swift.syncCNCOverlay has cognitive complexity 80 (threshold 15). Drivers by points: boolean chains 33, if/else 16 (27 pts), ternaries 4 (13 pts), loops 3 (7 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.
ecad.calcMotor (cognitive 78) packages/mcp/src/tools/ecad.ts:12513— ecad.calcMotor has cognitive complexity 78 (threshold 15). Drivers by points: if/else 22 (43 pts), ternaries 15 (26 pts), boolean chains 9 (nesting depth added 32). Of this number, 73 points are the body's own statements and 5 belong to 2 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.
FeatureInput::to_crdt_params (cognitive 77) crates/vcad-app/src/feature.rs:552— FeatureInput::to_crdt_params has cognitive complexity 77 (threshold 15). Drivers by points: if/else 44 (74 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
clearance.computeInterferenceAudit (cognitive 76) packages/mcp/src/tools/clearance.ts:482— clearance.computeInterferenceAudit has cognitive complexity 76 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 10 (22 pts), boolean chains 8, loops 5 (8 pts), error handling 3 (7 pts) (nesting depth added 38). Of this number, 72 points are the body's own statements and 4 belong to 3 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.
GizmoView.swift.buildGizmo (cognitive 75) apple/VcadApp/Sources/VcadApp/GizmoView.swift:100— GizmoView.swift.buildGizmo has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 19 (41 pts), if/else 12 (18 pts), loops 6 (10 pts), boolean chains 6 (nesting depth added 32). Of this number, 69 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.
Repl::execute (cognitive 74) crates/vcad-cli/src/repl.rs:81— Repl::execute has cognitive complexity 74 (threshold 15). Drivers by points: if/else 23 (50 pts), loops 9 (18 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tracer::trace_impl (cognitive 74) crates/vcad-kernel-particle/src/trace.rs:482— Tracer::trace_impl has cognitive complexity 74 (threshold 15). Drivers by points: if/else 21 (64 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (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.
ReleasedOverlayView.tapSelect (cognitive 74) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1548— ReleasedOverlayView.tapSelect has cognitive complexity 74 (threshold 15). Drivers by points: if/else 28 (42 pts), boolean chains 32 (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.
protocol-2026.handleModernRequest (cognitive 72) packages/mcp/src/protocol-2026.ts:543— protocol-2026.handleModernRequest has cognitive complexity 72 (threshold 15). Drivers by points: if/else 29 (39 pts), ternaries 12 (18 pts), boolean chains 14, error handling 1 (nesting depth added 16). Of this number, 66 points are the body's own statements and 6 belong to 2 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.
enclosure.sealedWallOpenings (cognitive 72) packages/mcp/src/tools/enclosure.ts:232— enclosure.sealedWallOpenings has cognitive complexity 72 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 7 (19 pts), ternaries 5 (19 pts), boolean chains 5 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
order.quoteManufacturing (cognitive 71) packages/mcp/src/tools/order.ts:204— order.quoteManufacturing has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (33 pts), ternaries 18 (24 pts), boolean chains 9, error handling 3 (5 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.
useCanvasRecorder.useCanvasRecorder (cognitive 68) packages/app/src/hooks/useCanvasRecorder.ts:88— useCanvasRecorder.useCanvasRecorder has cognitive complexity 68 (threshold 15). Drivers by points: if/else 21 (35 pts), error handling 7 (14 pts), boolean chains 11, ternaries 3 (8 pts) (nesting depth added 26). None of this is in the body itself: all 68 points belong to 7 function literals inside it that branch (lines 103, 261, 305, …). 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.
index.parseGeometryOpcode (cognitive 67) packages/ir/src/index.ts:1481— index.parseGeometryOpcode has cognitive complexity 67 (threshold 15). Drivers by points: if/else 29 (63 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 35). 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.
ecad.deriveNets (cognitive 67) packages/mcp/src/tools/ecad.ts:525— ecad.deriveNets has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 17 (27 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 28). Of this number, 63 points are the body's own statements and 4 belong to 2 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.
RayTracedViewport.RayTracedViewportSync (cognitive 66) packages/app/src/components/RayTracedViewport.tsx:70— RayTracedViewport.RayTracedViewportSync has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (34 pts), error handling 5 (13 pts), boolean chains 8, ternaries 3 (6 pts), loops 3 (5 pts) (nesting depth added 27). None of this is in the body itself: all 66 points belong to 4 function literals inside it that branch (lines 91, 317, 158, …). 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.
Device3d::validate (cognitive 65) crates/vcad-kernel-particle/src/wire3d.rs:395— Device3d::validate has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 8, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchSession.ink (cognitive 65) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1406— SketchSession.ink has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (42 pts), loops 4 (12 pts), boolean chains 7, match/switch 2 (4 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.
usePcbCamera.usePcbCamera (cognitive 65) packages/app/src/components/electronics/pcb3d/usePcbCamera.ts:30— usePcbCamera.usePcbCamera has cognitive complexity 65 (threshold 15). Drivers by points: if/else 37 (52 pts), boolean chains 8, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 17). None of this is in the body itself: all 65 points belong to 12 function literals inside it that branch (lines 46, 277, 229, …). 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.
ElectronicsCanvas.installMonitor (cognitive 64) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:808— ElectronicsCanvas.installMonitor has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 16, ternaries 3 (5 pts), match/switch 1 (2 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.
SketchInference.infer (cognitive 64) apple/VcadApp/Sources/VcadApp/SketchInference.swift:64— SketchInference.infer has cognitive complexity 64 (threshold 15). Drivers by points: if/else 17 (34 pts), ternaries 5 (18 pts), boolean chains 12 (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.
XRGestures.XRGestures (cognitive 64) packages/app/src/components/xr/XRGestures.tsx:163— XRGestures.XRGestures has cognitive complexity 64 (threshold 15). Drivers by points: if/else 25 (42 pts), boolean chains 12, ternaries 4 (9 pts), loops 1 (nesting depth added 22). None of this is in the body itself: all 64 points belong to 4 function literals inside it that branch (lines 199, 255, 258, …). 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.
distill_lambda.distill (cognitive 63) packages/training/src/lambda/distill_lambda.py:78— distill_lambda.distill has cognitive complexity 63 (threshold 15). Drivers by points: if/else 33 (51 pts), ternaries 3 (5 pts), loops 3 (4 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.
useCameraControls.useCameraControls (cognitive 63) packages/app/src/hooks/useCameraControls.ts:6— useCameraControls.useCameraControls has cognitive complexity 63 (threshold 15). Drivers by points: if/else 28 (34 pts), boolean chains 13, loops 6 (13 pts), ternaries 3 (nesting depth added 13). None of this is in the body itself: all 63 points belong to 8 function literals inside it that branch (lines 64, 14, 244, …). 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.
Roughing3D::generate_level_passes (cognitive 62) crates/vcad-kernel-cam/src/operation/roughing3d.rs:163— Roughing3D::generate_level_passes has cognitive complexity 62 (threshold 15). Drivers by points: if/else 20 (52 pts), loops 4 (10 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.
AgentTools.call (cognitive 62) apple/VcadApp/Sources/VcadApp/AgentBridge.swift:239— AgentTools.call has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (45 pts), ternaries 6 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 30). Of this number, 53 points are the body's own statements and 9 belong to one function item inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
index.toVCode (cognitive 61) packages/ir/src/index.ts:525— index.toVCode has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 11 (24 pts), boolean chains 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.buildSheetBody (cognitive 61) packages/mcp/src/tools/ecad.ts:2108— ecad.buildSheetBody has cognitive complexity 61 (threshold 15). Drivers by points: boolean chains 27, if/else 13 (17 pts), ternaries 11 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 43 belong to 9 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.
index.formatSceneSettings (cognitive 59) packages/ir/src/index.ts:935— index.formatSceneSettings has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 4 (12 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
animate.buildSequenceGlb (cognitive 59) packages/mcp/src/tools/animate.ts:527— animate.buildSequenceGlb has cognitive complexity 59 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 7 (17 pts), ternaries 3 (9 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 35). Of this number, 58 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.analyzeRustSource (cognitive 59) packages/wasmosis/src/cli.ts:199— cli.analyzeRustSource has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 6 (17 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 31). Of this number, 49 points are the body's own statements and 10 belong to 3 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.
CNCController.ingest (cognitive 58) apple/VcadApp/Sources/VcadApp/CNC.swift:309— CNCController.ingest has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 11 (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.
vcad_kernel_wasm.__wbg_get_imports (cognitive 58) packages/kernel-wasm/vcad_kernel_wasm.js:9345— vcad_kernel_wasm.__wbg_get_imports has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 48 (49 pts), error handling 8, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 58 points belong to 48 function literals inside it that branch (lines 9377, 9371, 9430, …). 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.
carry-electronics.carryElectronics (cognitive 58) packages/mcp/src/tools/carry-electronics.ts:23— carry-electronics.carryElectronics has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 13, loops 6 (9 pts), ternaries 4 (6 pts) (nesting depth added 18). Of this number, 40 points are the body's own statements and 18 belong to 3 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.
NativeElectronicsView.inspector (cognitive 57) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:238— NativeElectronicsView.inspector has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 16, ternaries 11 (14 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.
sketch-math.computeSketchBounds (cognitive 56) packages/core/src/sketch-math.ts:411— sketch-math.computeSketchBounds has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 6 (24 pts), boolean chains 3 (nesting depth added 34). Of this number, 52 points are the body's own statements and 4 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.
MarchingCubes::extract (cognitive 55) crates/vcad-kernel-stocksim/src/marching_cubes.rs:15— MarchingCubes::extract has cognitive complexity 55 (threshold 15). Drivers by points: if/else 7 (30 pts), loops 9 (24 pts), boolean chains 1 (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.
FeatureTree.TreeNode (cognitive 55) packages/app/src/components/FeatureTree.tsx:485— FeatureTree.TreeNode has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 21, if/else 18 (19 pts), ternaries 9 (13 pts), match/switch 1 (2 pts) (nesting depth added 6). Of this number, 33 points are the body's own statements and 22 belong to 7 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.
build.normalizeGlue (cognitive 55) packages/kernel-wasm/scripts/build.mjs:76— build.normalizeGlue has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source-parser.parseRustSourceContent (cognitive 55) REDACTED:100— source-parser.parseRustSourceContent has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (42 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.verifyReceipt (cognitive 54) packages/mcp/src/tools/ecad.ts:14693— ecad.verifyReceipt has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 13 (17 pts), boolean chains 15 (nesting depth added 10). Of this number, 53 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.
CommandPalette.CommandPalette (cognitive 53) packages/app/src/components/CommandPalette.tsx:141— CommandPalette.CommandPalette has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 21, ternaries 2 (6 pts), error handling 1, match/switch 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 36 belong to 14 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.
FvSystem::solve (cognitive 52) crates/vcad-kernel-em/src/grid.rs:405— FvSystem::solve has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (45 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HaloInput.handle (cognitive 52) apple/VcadApp/Sources/VcadApp/NavigationViews.swift:541— HaloInput.handle has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 13, match/switch 2 (3 pts) (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.
SketchPlane3D.SketchGeometry3D (cognitive 52) packages/app/src/components/SketchPlane3D.tsx:275— SketchPlane3D.SketchGeometry3D has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (35 pts), ternaries 5 (9 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 22). None of this is in the body itself: all 52 points belong to 4 function literals inside it that branch (lines 378, 288, 348, …). 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.
evaluate.evaluateOp (cognitive 52) packages/engine/src/evaluate.ts:715— evaluate.evaluateOp has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 13, ternaries 1 (2 pts), match/switch 1 (nesting depth added 19). Of this number, 47 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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.
clearance.checkClearance (cognitive 52) packages/mcp/src/tools/clearance.ts:626— clearance.checkClearance has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 21 (27 pts), if/else 12 (13 pts), boolean chains 11, error handling 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.
bom.buildLine (cognitive 51) packages/mcp/src/tools/bom.ts:252— bom.buildLine has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 7 (10 pts), boolean chains 3 (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.
ecad.buildReceipt (cognitive 51) packages/mcp/src/tools/ecad.ts:14504— ecad.buildReceipt has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 20 (28 pts), if/else 13 (18 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalysisOverlay.swift.syncAnalysisOverlay (cognitive 50) apple/VcadApp/Sources/VcadApp/AnalysisOverlay.swift:127— AnalysisOverlay.swift.syncAnalysisOverlay has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 3 (12 pts), loops 3 (7 pts), boolean chains 5, 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.
launch.stitchTJunctions (cognitive 50) packages/app/public/launch/launch.js:99— launch.stitchTJunctions has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 10 (14 pts), boolean chains 5, ternaries 3 (nesting depth added 18). Of this number, 49 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.
mech-parts.searchMechCatalog (cognitive 50) packages/mcp/src/tools/mech-parts.ts:139— mech-parts.searchMechCatalog has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 10, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 23). Of this number, 49 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
record.recordSimulation (cognitive 50) packages/mcp/src/tools/record.ts:168— record.recordSimulation has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 9 (13 pts), boolean chains 7, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gallery.stitchTJunctions (cognitive 50) www/public/kit/gallery.js:211— gallery.stitchTJunctions has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 10 (14 pts), boolean chains 5, ternaries 3 (nesting depth added 18). Of this number, 49 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.
useAppCommands.useAppCommands (cognitive 49) packages/app/src/hooks/useAppCommands.ts:65— useAppCommands.useAppCommands has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (25 pts), ternaries 12 (17 pts), boolean chains 5, error handling 2 (nesting depth added 10). None of this is in the body itself: all 49 points belong to 20 function literals inside it that branch (lines 265, 75, 373, …). 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.
ecad.applyDesignRuleArgs (cognitive 49) packages/mcp/src/tools/ecad.ts:190— ecad.applyDesignRuleArgs has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 9 (25 pts), if/else 16 (22 pts), loops 1 (2 pts) (nesting depth added 23). Of this number, 46 points are the body's own statements and 3 belong to 2 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.
ecad.addViaArray (cognitive 49) packages/mcp/src/tools/ecad.ts:11318— ecad.addViaArray has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 10, loops 5 (9 pts), ternaries 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.
Proxy::spawn (cognitive 48) crates/vcad-mcp/src/proxy.rs:198— Proxy::spawn has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (38 pts), loops 5, match/switch 2 (5 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.
parameters.setParameters (cognitive 48) packages/mcp/src/tools/parameters.ts:237— parameters.setParameters has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (24 pts), ternaries 8 (10 pts), boolean chains 8, loops 4 (6 pts) (nesting depth added 10). Of this number, 41 points are the body's own statements and 7 belong to 4 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.
AgentCore.answer (cognitive 47) apple/VcadApp/Sources/VcadApp/AgentCore.swift:208— AgentCore.answer has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (32 pts), ternaries 4 (9 pts), boolean chains 5, match/switch 1 (nesting depth added 19). Of this number, 46 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.
build.modelIdentity (cognitive 47) mecheval/leaderboard/src/build.ts:230— build.modelIdentity has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (34 pts), boolean chains 8, if/else 5 (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.
RayTracedViewport.RayTracedViewportOverlay (cognitive 47) packages/app/src/components/RayTracedViewport.tsx:406— RayTracedViewport.RayTracedViewportOverlay has cognitive complexity 47 (threshold 15). Drivers by points: if/else 38 (41 pts), boolean chains 4, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 731, 497, 461, …). 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.
SketchPropertyPanel.SketchPropertyPanel (cognitive 47) packages/app/src/components/SketchPropertyPanel.tsx:403— SketchPropertyPanel.SketchPropertyPanel has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (24 pts), ternaries 10 (17 pts), boolean chains 5, error handling 1 (nesting depth added 13). Most of this is not in the body itself: 8 of the 47 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 469, 439, 467). 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.
annotate.generateSyntheticDescription (cognitive 47) packages/training/src/annotate.ts:237— annotate.generateSyntheticDescription has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 10 (19 pts) (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.
make_figures.figB (cognitive 46) docs/compression-math-survey/launch-figures/make_figures.py:203— make_figures.figB has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 4 (10 pts), loops 5 (8 pts), boolean chains 2 (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.
ElectronicsWorkspace.tidySchematic (cognitive 46) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:313— ElectronicsWorkspace.tidySchematic has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 10 (15 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 18). Of this number, 40 points are the body's own statements and 6 belong to 2 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.
ElectronicsCanvas.copperAt (cognitive 45) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:713— ElectronicsCanvas.copperAt has cognitive complexity 45 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 11, ternaries 2 (10 pts), loops 4 (7 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.
ecad.setPlacement (cognitive 45) packages/mcp/src/tools/ecad.ts:9761— ecad.setPlacement has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (31 pts), ternaries 5 (7 pts), boolean chains 5, loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchViews.swift.buildSketchRoot (cognitive 44) apple/VcadApp/Sources/VcadApp/SketchViews.swift:377— SketchViews.swift.buildSketchRoot has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 5 (8 pts), boolean chains 7, loops 5 (6 pts), match/switch 1 (nesting depth added 11). Of this number, 33 points are the body's own statements and 11 belong to 2 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.
pass_k.failureReason (cognitive 44) mecheval/harness/src/pass_k.ts:58— pass_k.failureReason has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 5 (12 pts), loops 2 (5 pts), boolean chains 4, match/switch 1 (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.
build.paretoScatter (cognitive 44) mecheval/leaderboard/src/build.ts:1561— build.paretoScatter has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 18 (39 pts), if/else 2 (3 pts), loops 2 (nesting depth added 22). Most of this is not in the body itself: 7 of the 44 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1605, a function literal at line 1653, a function literal at line 1565, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
StatusBar.StatusBar (cognitive 44) packages/app/src/components/StatusBar.tsx:67— StatusBar.StatusBar has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 13 (23 pts), boolean chains 12, if/else 5 (8 pts), loops 1 (nesting depth added 13). Of this number, 32 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scrub-input.ScrubInput (cognitive 44) packages/app/src/components/ui/scrub-input.tsx:77— scrub-input.ScrubInput has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 14, ternaries 8 (9 pts) (nesting depth added 3). Of this number, 18 points are the body's own statements and 26 belong to 10 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.
ecad.runErc (cognitive 44) packages/mcp/src/tools/ecad.ts:5788— ecad.runErc has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 6 (9 pts), ternaries 4 (8 pts), boolean chains 2 (nesting depth added 19). Of this number, 43 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.
ecad.traceGridBoundaries (cognitive 44) packages/mcp/src/tools/ecad.ts:13191— ecad.traceGridBoundaries has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 27). Of this number, 39 points are the body's own statements and 5 belong to 2 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.
Electrostatics::solve (cognitive 43) crates/vcad-kernel-em/src/electro.rs:176— Electrostatics::solve has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 7 (12 pts), boolean chains 1 (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.
PeriodicTrim::build (cognitive 43) crates/vcad-kernel-raytrace/src/trim.rs:168— PeriodicTrim::build has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 4 (7 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
integrity.computeIntegrity (cognitive 43) packages/mcp/src/tools/integrity.ts:244— integrity.computeIntegrity has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 8 (11 pts), loops 4 (7 pts), boolean chains 5, error handling 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.
LinuxCncPost::segment (cognitive 42) crates/vcad-kernel-cam/src/post/linuxcnc.rs:164— LinuxCncPost::segment has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 5 (10 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.
ReleasedOverlayView.commitTopologyMarquee (cognitive 42) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1863— ReleasedOverlayView.commitTopologyMarquee has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalysisSmoke.swift.analysisSmoke (cognitive 42) apple/VcadApp/Sources/VcadApp/AnalysisSmoke.swift:14— AnalysisSmoke.swift.analysisSmoke has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 9, ternaries 4 (7 pts), error handling 3 (6 pts) (nesting depth added 14). Of this number, 39 points are the body's own statements and 3 belong to 2 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.
Regions::new (cognitive 41) crates/vcad-kernel-dfm/src/geom/probe.rs:466— Regions::new has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 8 (10 pts), boolean chains 5 (nesting depth added 17). Of this number, 40 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.
Loop::new (cognitive 41) crates/vcad-kernel-dfm/src/rules/hobby_mill.rs:709— Loop::new has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 5 (8 pts), boolean chains 2 (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.
GpuScene::from_brep (cognitive 41) crates/vcad-kernel-raytrace/src/gpu/buffers.rs:635— GpuScene::from_brep has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 6 (11 pts), match/switch 5 (11 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.
NativeElectronicsView.navigator (cognitive 41) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:141— NativeElectronicsView.navigator has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 8 (15 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.sizePdn (cognitive 41) packages/mcp/src/tools/ecad.ts:7281— ecad.sizePdn has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 8 (13 pts), boolean chains 8, loops 1 (nesting depth added 7). Of this number, 28 points are the body's own statements and 13 belong to 6 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.
SixelEncoder::encode (cognitive 40) crates/termview/src/protocols/sixel.rs:30— SixelEncoder::encode has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 5 (11 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.
CNCController.connect (cognitive 40) apple/VcadApp/Sources/VcadApp/CNC.swift:193— CNCController.connect has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 12, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PropertyPanel.PropertyPanel (cognitive 40) packages/app/src/components/PropertyPanel.tsx:1540— PropertyPanel.PropertyPanel has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 20, if/else 13 (17 pts), ternaries 3 (nesting depth added 4). Of this number, 37 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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.
PcbFootprintGroup.PcbFootprintGroup (cognitive 40) packages/app/src/components/electronics/PcbFootprintGroup.tsx:19— PcbFootprintGroup.PcbFootprintGroup has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (13 pts), ternaries 7 (12 pts), match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 6 of the 40 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 159, a function literal at line 57, isNetHighlighted, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
part-stock.annotateBomStock (cognitive 40) packages/mcp/src/tools/part-stock.ts:569— part-stock.annotateBomStock has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (12 pts), boolean chains 3 (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.
ecad.deleteNetTie (cognitive 40) packages/mcp/src/tools/ecad.ts:10751— ecad.deleteNetTie has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (27 pts), ternaries 4 (7 pts), boolean chains 6 (nesting depth added 12). Of this number, 28 points are the body's own statements and 12 belong to 2 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.
ecad.componentKeepouts (cognitive 40) packages/mcp/src/tools/ecad.ts:14008— ecad.componentKeepouts has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 3 (4 pts), ternaries 2 (4 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity· cli.program.command("infer").description("Generate VCode from a text prompt").requiredOption("-p, --prompt <prompt>","Text d (cognitive 40) · ×1
cli.program.command("infer").description("Generate VCode from a text prompt").requiredOption("-p, --prompt <prompt>","Text d (cognitive 40) packages/training/src/cli.ts:735— cli.program.command("infer").description("Generate VCode from a text prompt").requiredOption("-p, --prompt <prompt>","Text d has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (23 pts), error handling 5 (9 pts), ternaries 3 (6 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.
ToolPalette.ToolPalette (cognitive 39) packages/app/src/components/ToolPalette.tsx:26— ToolPalette.ToolPalette has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 15, if/else 15, ternaries 8 (9 pts) (nesting depth added 1). Most of this is not in the body itself: 4 of the 39 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 132, a function literal at line 102, a function literal at line 217, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PrintPanel.PrintPanel (cognitive 39) packages/app/src/components/print/PrintPanel.tsx:50— PrintPanel.PrintPanel has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 14, ternaries 8 (11 pts), if/else 9, error handling 5 (nesting depth added 3). Most of this is not in the body itself: 15 of the 39 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 80, handleStartPrint, a function literal at line 149, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
electronics-store.useElectronicsStore (cognitive 39) packages/app/src/stores/electronics-store.ts:320— electronics-store.useElectronicsStore has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 14 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). None of this is in the body itself: all 39 points belong to 19 function literals inside it that branch (lines 635, 392, 443, …). 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.
ecad.exportKicad (cognitive 39) packages/mcp/src/tools/ecad.ts:6251— ecad.exportKicad has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 7 (13 pts), boolean chains 2, error handling 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.
GrblPost::segment (cognitive 38) crates/vcad-kernel-cam/src/post/grbl.rs:112— GrblPost::segment has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 5 (10 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.
BoardPainter.draw (cognitive 38) apple/VcadApp/Sources/VcadApp/ElectronicsBoardLayer.swift:47— BoardPainter.draw has cognitive complexity 38 (threshold 15). Drivers by points: loops 11 (16 pts), if/else 6 (12 pts), ternaries 4 (10 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.
usePhysicsSimulation.usePhysicsSimulation (cognitive 38) packages/app/src/hooks/usePhysicsSimulation.ts:29— usePhysicsSimulation.usePhysicsSimulation has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 4 (12 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 13). None of this is in the body itself: all 38 points belong to 7 function literals inside it that branch (lines 213, 73, 59, …). 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.
evaluate.evaluateDocumentTS (cognitive 38) packages/engine/src/evaluate.ts:542— evaluate.evaluateDocumentTS has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 3 (11 pts), loops 4 (9 pts), error handling 1 (3 pts), boolean chains 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.
loon.hasRootWithoutMaterial (cognitive 38) packages/mcp/src/tools/loon.ts:295— loon.hasRootWithoutMaterial has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 16). Of this number, 35 points are the body's own statements and 3 belong to 2 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.
ecad.getCopper (cognitive 38) packages/mcp/src/tools/ecad.ts:10395— ecad.getCopper has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 7 (10 pts), boolean chains 6, loops 1, match/switch 1 (nesting depth added 10). Of this number, 19 points are the body's own statements and 19 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SoundPanel.swift.nearestPartHit (cognitive 37) apple/VcadApp/Sources/VcadApp/SoundPanel.swift:765— SoundPanel.swift.nearestPartHit has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 5, 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.
render-task-assets.main (cognitive 37) mecheval/scripts/render-task-assets.mjs:72— render-task-assets.main has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (7 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 18). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claims-ledger.attachClaims (cognitive 37) packages/mcp/src/tools/claims-ledger.ts:343— claims-ledger.attachClaims has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 7 (15 pts), boolean chains 3, loops 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.
claims-ledger.importMeasurement (cognitive 37) packages/mcp/src/tools/claims-ledger.ts:858— claims-ledger.importMeasurement has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 10 (15 pts), boolean chains 4 (nesting depth added 13). Of this number, 35 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
joint-range.checkJointRange (cognitive 37) packages/mcp/src/tools/joint-range.ts:211— joint-range.checkJointRange has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (10 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 14). Of this number, 26 points are the body's own statements and 11 belong to 5 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.
ecad.detectStaleNets (cognitive 37) packages/mcp/src/tools/ecad.ts:3600— ecad.detectStaleNets has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 7 (9 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 16). Of this number, 21 points are the body's own statements and 16 belong to 6 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.
ecad.sizeImpedance (cognitive 37) packages/mcp/src/tools/ecad.ts:7129— ecad.sizeImpedance has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 16 (17 pts), if/else 12, 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.
PatternFit::monte_carlo (cognitive 36) crates/vcad-kernel-tolerance/src/gdt.rs:290— PatternFit::monte_carlo has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (9 pts), boolean chains 3 (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.
make_figures.figA (cognitive 36) docs/compression-math-survey/launch-figures/make_figures.py:139— make_figures.figA has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 18 (26 pts), loops 6, if/else 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CNCController.setOverride (cognitive 36) apple/VcadApp/Sources/VcadApp/CNC.swift:429— CNCController.setOverride has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 5 (9 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-mcp.makeClaudeMcpSolver.solve (cognitive 36) mecheval/harness/src/solvers/claude-mcp.ts:312— claude-mcp.makeClaudeMcpSolver.solve has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (5 pts), ternaries 3, error handling 2, boolean chains 1 (nesting depth added 15). Of this number, 30 points are the body's own statements and 6 belong to 2 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.
launch.autoSmooth (cognitive 36) packages/app/public/launch/launch.js:171— launch.autoSmooth has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 4 (10 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 20). 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.
expression-input.ExpressionInput (cognitive 36) packages/app/src/components/ui/expression-input.tsx:45— expression-input.ExpressionInput has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 19 (23 pts), if/else 6, boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 14 belong to 4 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.
next-actions.suggestNextActions (cognitive 36) packages/mcp/src/tools/next-actions.ts:47— next-actions.suggestNextActions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 5 (9 pts), boolean chains 7 (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.
flat-pattern.flatPatternFromSolid (cognitive 36) packages/mcp/src/tools/flat-pattern.ts:176— flat-pattern.flatPatternFromSolid has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 17 (28 pts), if/else 4 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 13). Of this number, 32 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.
gallery.autoSmooth (cognitive 36) www/public/kit/gallery.js:283— gallery.autoSmooth has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 4 (10 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 20). 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.
System::apply (cognitive 35) crates/vcad-kernel-thermal/src/solve.rs:499— System::apply has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 5 (11 pts), match/switch 1 (5 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.
EditorModel.beginManip (cognitive 35) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:141— EditorModel.beginManip has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 8, ternaries 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchSession.tapNow (cognitive 35) apple/VcadApp/Sources/VcadApp/SketchSession.swift:616— SketchSession.tapNow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 1 (3 pts), boolean chains 1, 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.
matrix-cli.main (cognitive 35) mecheval/harness/src/matrix-cli.ts:198— matrix-cli.main has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (34 pts), ternaries 6 (12 pts), loops 7 (10 pts), boolean chains 4 (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. This shape REPEATS in the file: one other method here (matrix-cli.main::worker) 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.
CircuitTabTools.PcbConstrainControls (cognitive 35) packages/app/src/components/electronics/CircuitTabTools.tsx:372— CircuitTabTools.PcbConstrainControls has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 4 (8 pts), boolean chains 5 (nesting depth added 11). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 421, 384, 389, …). 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.
EmbroideryPanel.EmbroideryPanel (cognitive 35) packages/app/src/components/embroidery/EmbroideryPanel.tsx:19— EmbroideryPanel.EmbroideryPanel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 12, loops 2 (3 pts), ternaries 2, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 38, 60, 94, …). 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.
ecad.lmSolve (cognitive 35) packages/mcp/src/tools/ecad.ts:6823— ecad.lmSolve has cognitive complexity 35 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 4 (9 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 19). Of this number, 31 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ecad.findCavity (cognitive 35) packages/mcp/src/tools/ecad.ts:13350— ecad.findCavity has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 6 (8 pts), boolean chains 3, ternaries 1 (nesting depth added 11). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
init (cognitive 35) www/src/hero-app.js:9— init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (21 pts), ternaries 9, loops 4 (5 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 35 function items inside it that branch (play, setReceipt, el, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vcad_receipt_verify::verify (cognitive 34) crates/vcad-receipt-verify/src/lib.rs:126— vcad_receipt_verify::verify has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 4 (5 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.
DocumentPicker.DocumentRow (cognitive 34) packages/app/src/components/DocumentPicker.tsx:91— DocumentPicker.DocumentRow has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 4 (6 pts), boolean chains 5 (nesting depth added 14). Of this number, 26 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
analyze-store.useAnalyzeStore (cognitive 34) packages/app/src/stores/analyze-store.ts:236— analyze-store.useAnalyzeStore has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 9 (14 pts), boolean chains 5, error handling 1 (nesting depth added 8). None of this is in the body itself: all 34 points belong to 6 function literals inside it that branch (lines 261, 392, 376, …). 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.
commands.createCommandRegistry (cognitive 34) packages/core/src/commands.ts:180— commands.createCommandRegistry has cognitive complexity 34 (threshold 15). Drivers by points: if/else 34. 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.
clearance.verifyClearanceClaims (cognitive 34) packages/mcp/src/tools/clearance.ts:1052— clearance.verifyClearanceClaims has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 6 (14 pts), boolean chains 1, 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.
claims-ledger.ledgerReceiptClaim (cognitive 34) packages/mcp/src/tools/claims-ledger.ts:593— claims-ledger.ledgerReceiptClaim has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 17 (24 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartStockClient.check (cognitive 34) packages/mcp/src/tools/part-stock.ts:384— PartStockClient.check has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 7, ternaries 5 (7 pts), error handling 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.
ecad.legalizeCrossNetClearance (cognitive 34) packages/mcp/src/tools/ecad.ts:2773— ecad.legalizeCrossNetClearance has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 7 (12 pts), boolean chains 1 (nesting depth added 19). Of this number, 22 points are the body's own statements and 12 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.
ecad.validateForFab (cognitive 34) packages/mcp/src/tools/ecad.ts:6607— ecad.validateForFab has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 6 (9 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.
infer.validateVCode (cognitive 34) packages/training/src/infer.ts:236— infer.validateVCode has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 20). Of this number, 32 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LathePost::post (cognitive 33) crates/vcad-kernel-cam/src/turning/post.rs:113— LathePost::post has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 6 (15 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Domain::from_mesh (cognitive 33) crates/vcad-kernel-topopt/src/domain.rs:89— Domain::from_mesh has cognitive complexity 33 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 4 (14 pts) (nesting depth added 20). 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.
AgentTools.setPose (cognitive 33) apple/VcadApp/Sources/VcadApp/AgentBridge.swift:186— AgentTools.setPose has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 10, loops 2, match/switch 1, ternaries 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.
pose.applyJointState (cognitive 33) packages/mcp/src/tools/pose.ts:87— pose.applyJointState has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 4 (8 pts), boolean chains 3, loops 3 (nesting depth added 12). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry-dispatch.runMutationViaEngine (cognitive 33) packages/mcp/src/tools/registry-dispatch.ts:679— registry-dispatch.runMutationViaEngine has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 4, ternaries 3 (4 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claims-ledger.recordClaimMeasurements (cognitive 33) packages/mcp/src/tools/claims-ledger.ts:486— claims-ledger.recordClaimMeasurements has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 4 (8 pts), boolean chains 5, loops 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.
ecad.drcPcb (cognitive 33) packages/mcp/src/tools/ecad.ts:4941— ecad.drcPcb has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (11 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.addZone (cognitive 33) packages/mcp/src/tools/ecad.ts:9951— ecad.addZone has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 7, boolean chains 6, loops 1 (2 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.
GridRouter::route_net (cognitive 32) crates/vcad-ecad-pcb/src/router/grid.rs:130— GridRouter::route_net has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (5 pts), boolean chains 4, match/switch 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.
DeviceSpec3d::parameter_roles (cognitive 32) crates/vcad-kernel-particle/src/spec3d.rs:389— DeviceSpec3d::parameter_roles has cognitive complexity 32 (threshold 15). Drivers by points: loops 10 (28 pts), if/else 2, match/switch 1 (2 pts) (nesting depth added 19). 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.
MeshRayIndex::new (cognitive 32) crates/vcad-kernel-tessellate/src/mesh_ray.rs:190— MeshRayIndex::new has cognitive complexity 32 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 10 (13 pts), boolean chains 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PathTracer.step (cognitive 32) apple/VcadApp/Sources/VcadApp/PathTracer.swift:174— PathTracer.step has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 13, ternaries 3 (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.
StrikeDetector.process (cognitive 32) apple/VcadApp/Sources/VcadApp/PitchDetector.swift:149— StrikeDetector.process has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, ternaries 1 (3 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.
build.runPage (cognitive 32) mecheval/leaderboard/src/build.ts:2271— build.runPage has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 19 (30 pts), boolean chains 2 (nesting depth added 11). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2311, 2351). 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.
ParametersPanel.ParameterRow (cognitive 32) packages/app/src/components/ParametersPanel.tsx:151— ParametersPanel.ParameterRow has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 6 (12 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (commitValue, a function literal at line 229, commitName, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
claims-ledger.extractClaims::visit (cognitive 32) packages/mcp/src/tools/claims-ledger.ts:251— claims-ledger.extractClaims::visit has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (6 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.forceDirectedRefine (cognitive 32) packages/mcp/src/tools/ecad.ts:2657— ecad.forceDirectedRefine has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 2 (6 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 17). Of this number, 21 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ecad.deletePcbElement (cognitive 32) packages/mcp/src/tools/ecad.ts:10117— ecad.deletePcbElement has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 9 (13 pts), boolean chains 5 (nesting depth added 9). Of this number, 27 points are the body's own statements and 5 belong to 2 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.
ecad.boardFromSolid (cognitive 32) packages/mcp/src/tools/ecad.ts:13677— ecad.boardFromSolid has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 11 (12 pts), boolean chains 5 (nesting depth added 5). Of this number, 24 points are the body's own statements and 8 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.
main.handleToolResult (cognitive 32) packages/mcp/viewer-app/main.ts:2000— main.handleToolResult has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentApi::exclusive_inputs_closure (cognitive 31) crates/vcad-app/src/document_api.rs:306— DocumentApi::exclusive_inputs_closure has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (9 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.
Raster::build (cognitive 31) crates/vcad-ecad-pcb/src/router/maze.rs:877— Raster::build has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 5 (14 pts), boolean chains 1 (nesting depth added 19). 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.
CNCStatus.ingest (cognitive 31) apple/VcadApp/Sources/VcadApp/CNC.swift:34— CNCStatus.ingest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 4, 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.
EditorModel.paletteCommands (cognitive 31) apple/VcadApp/Sources/VcadApp/FeatureOpsPalette.swift:19— EditorModel.paletteCommands has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, loops 7 (8 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.main (cognitive 31) mecheval/leaderboard/src/build.ts:2474— build.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 6 (10 pts), loops 7 (9 pts), boolean chains 1 (nesting depth added 12). Of this number, 29 points are the body's own statements and 2 belong to 3 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.
DocumentPicker.DocumentPicker (cognitive 31) packages/app/src/components/DocumentPicker.tsx:223— DocumentPicker.DocumentPicker has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 8 (9 pts), boolean chains 5, error handling 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 311, 255, 346, …). 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.
part-summary.getPartSummary (cognitive 31) packages/app/src/components/tree/part-summary.ts:9— part-summary.getPartSummary has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (29 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransformGizmo.TransformGizmo (cognitive 31) packages/app/src/components/TransformGizmo.tsx:63— TransformGizmo.TransformGizmo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 5 (6 pts), boolean chains 4 (nesting depth added 4). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 105, 187, 147, …). 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.
assemble.assembleInto (cognitive 31) packages/mcp/src/tools/assemble.ts:65— assemble.assembleInto has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 5 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 9). Of this number, 23 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.
ecad.setStackup (cognitive 31) packages/mcp/src/tools/ecad.ts:9642— ecad.setStackup has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
ecad.checkSelfStart (cognitive 31) packages/mcp/src/tools/ecad.ts:12872— ecad.checkSelfStart has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 8 (13 pts), boolean chains 4 (nesting depth added 10). Of this number, 29 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.
main.applySimFrame (cognitive 31) packages/mcp/viewer-app/main.ts:1617— main.applySimFrame has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 6, loops 1 (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.
App::get_triangles (cognitive 30) crates/vcad-cli/src/app.rs:951— App::get_triangles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_kernel_text::profile::text_to_profiles (cognitive 30) crates/vcad-kernel-text/src/profile.rs:29— vcad_kernel_text::profile::text_to_profiles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (6 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.
VariantSet::resolve (cognitive 30) crates/vcad-loon/src/variants.rs:680— VariantSet::resolve has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 4 (7 pts), match/switch 2 (5 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.
FeatureOpSheet.apply (cognitive 30) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:450— FeatureOpSheet.apply has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 5 (11 pts), boolean chains 2, match/switch 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.
DockTools.design (cognitive 30) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:554— DockTools.design has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (11 pts), if/else 4 (6 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.
SketchSession.constrainSelectionNow (cognitive 30) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1129— SketchSession.constrainSelectionNow has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 10, 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.
DocumentVolume.rebuild (cognitive 30) apple/VcadVision/Sources/VcadVision/DocumentVolume.swift:184— DocumentVolume.rebuild has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (8 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchPlane3D.SketchPlane3D (cognitive 30) packages/app/src/components/SketchPlane3D.tsx:731— SketchPlane3D.SketchPlane3D has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 5, loops 1 (nesting depth added 5). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 773, 905, 802, …). 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.
PcbKernelBoard.PcbKernelBoard (cognitive 30) packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx:103— PcbKernelBoard.PcbKernelBoard has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 5 (9 pts), boolean chains 6, ternaries 3 (nesting depth added 7). None of this is in the body itself: all 30 points belong to 6 function literals inside it that branch (lines 216, 146, 261, …). 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.
circuit-build.buildCircuitSpec (cognitive 30) packages/app/src/lib/circuit-build.ts:75— circuit-build.buildCircuitSpec has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 8 (9 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 9). Of this number, 15 points are the body's own statements and 15 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sheet-metal.buildSheetMetalChain (cognitive 30) packages/engine/src/sheet-metal.ts:419— sheet-metal.buildSheetMetalChain has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 10 (11 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.
receipt-unified.unifiedFromSpec (cognitive 30) packages/mcp/src/receipt-unified.ts:444— receipt-unified.unifiedFromSpec has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 7 (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.
registry-dispatch.snapshotParts (cognitive 30) packages/mcp/src/tools/registry-dispatch.ts:318— registry-dispatch.snapshotParts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 12, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 3 function items inside it that branch (canon, canon::isZero, canon::isOne). 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.
Lattice.cast (cognitive 30) packages/mcp/src/tools/joint-range.ts:82— Lattice.cast has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (9 pts), boolean chains 3, ternaries 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.
ecad.polygonOverlapBbox (cognitive 30) packages/mcp/src/tools/ecad.ts:13151— ecad.polygonOverlapBbox has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (7 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.
vcad_kernel_sweep::sweep::build_swept_solid (cognitive 29) crates/vcad-kernel-sweep/src/sweep.rs:122— vcad_kernel_sweep::sweep::build_swept_solid has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 6 (12 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.
Stackup::validate (cognitive 29) crates/vcad-kernel-tolerance/src/stackup.rs:333— Stackup::validate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, loops 2 (3 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.
Connection::handle_legacy (cognitive 29) crates/vcad-mcp/src/server.rs:1357— Connection::handle_legacy has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 2 (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.
CNCOutline.parseDXF (cognitive 29) apple/VcadApp/Sources/VcadApp/CNCOutline.swift:42— CNCOutline.parseDXF has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 9, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). Of this number, 28 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.
ReleasedOverlayView.marqueeOrOrbitGesture (cognitive 29) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:1738— ReleasedOverlayView.marqueeOrOrbitGesture has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 5, match/switch 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.
gateway-mcp.makeGatewayMcpSolver.solve (cognitive 29) mecheval/harness/src/solvers/gateway-mcp.ts:96— gateway-mcp.makeGatewayMcpSolver.solve has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (5 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 24 points are the body's own statements and 5 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.
EcadFeatureInspector.ComponentFootprintPanel (cognitive 29) packages/app/src/components/electronics/EcadFeatureInspector.tsx:154— EcadFeatureInspector.ComponentFootprintPanel has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 11, loops 2 (5 pts), ternaries 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 10 belong to 3 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.
measure.measureSweepResult (cognitive 29) packages/mcp/src/tools/measure.ts:289— measure.measureSweepResult has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (9 pts), boolean chains 4, error handling 3 (4 pts), loops 1 (nesting depth added 8). Of this number, 27 points are the body's own statements and 2 belong to 2 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.
preview.generateGlbPreview (cognitive 29) packages/mcp/src/tools/preview.ts:155— preview.generateGlbPreview has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 5 (10 pts), loops 3, boolean chains 2, error handling 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.
ecad.solidFromBoard (cognitive 29) packages/mcp/src/tools/ecad.ts:14099— ecad.solidFromBoard has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 7, boolean chains 5, error handling 1 (2 pts), 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.
sim-replay.getSimReplay (cognitive 29) packages/mcp/src/tools/sim-replay.ts:147— sim-replay.getSimReplay has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (9 pts), error handling 1 (2 pts), boolean chains 1, ternaries 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.
FeatureOpSheet.fields (cognitive 28) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:289— FeatureOpSheet.fields has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 6 (11 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.
SketchFill.triangulate (cognitive 28) apple/VcadApp/Sources/VcadApp/SketchInference.swift:249— SketchFill.triangulate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 8). Of this number, 26 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.
NavSmoke.swift.navSmoke (cognitive 28) apple/VcadApp/Sources/VcadApp/NavSmoke.swift:13— NavSmoke.swift.navSmoke has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 6, loops 3 (nesting depth added 2). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (drag, send, check). 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.
ElectronicsPanelHeader.BoardSizeControl (cognitive 28) packages/app/src/components/electronics/ElectronicsPanelHeader.tsx:68— ElectronicsPanelHeader.BoardSizeControl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 4 (nesting depth added 4). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (fitToEnclosure, commit, a function literal at line 104, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ecad.schematicSummary (cognitive 28) packages/mcp/src/tools/ecad.ts:2572— ecad.schematicSummary has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (15 pts), ternaries 6 (7 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.setBoardOutline (cognitive 28) packages/mcp/src/tools/ecad.ts:8457— ecad.setBoardOutline has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, ternaries 4, loops 1 (nesting depth added 5). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.largestComponent (cognitive 28) packages/mcp/src/tools/ecad.ts:13433— ecad.largestComponent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (8 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
init (cognitive 28) www/src/receipt-art.js:9— init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 5, ternaries 5, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 25 function items inside it that branch (play, a function literal at line 188, el, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CellBuffer::flush (cognitive 27) crates/vcad-cli/src/ui/buffer.rs:175— CellBuffer::flush has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SparseDiff::inner (cognitive 27) crates/vcad-ecad-pcb/src/router/claims_ir.rs:610— SparseDiff::inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 2, 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.
FeaSection.body (cognitive 27) apple/VcadApp/Sources/VcadApp/AnalysisPanel.swift:142— FeaSection.body has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 10 (13 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.
EditorModel.placedSpurGear (cognitive 27) apple/VcadApp/Sources/VcadApp/Gears.swift:83— EditorModel.placedSpurGear has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FieldHud.body (cognitive 27) apple/VcadApp/Sources/VcadApp/FieldOverlay.swift:471— FieldHud.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchConstraintPanel.body (cognitive 27) apple/VcadApp/Sources/VcadApp/SketchViews.swift:304— SketchConstraintPanel.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (12 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.
SoundPanel.swift.syncSoundOverlay (cognitive 27) apple/VcadApp/Sources/VcadApp/SoundPanel.swift:471— SoundPanel.swift.syncSoundOverlay has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, loops 5, ternaries 2 (3 pts) (nesting depth added 2). Of this number, 17 points are the body's own statements and 10 belong to 2 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.
launch-animatic.html.chrome (cognitive 27) docs/launch/launch-animatic.html:169— launch-animatic.html.chrome has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 5 (9 pts), boolean chains 5, loops 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 11 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.
ecad.describePcb (cognitive 27) packages/mcp/src/tools/ecad.ts:9209— ecad.describePcb has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 16 (17 pts), boolean chains 4, loops 4, if/else 2 (nesting depth added 1). Of this number, 19 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FlowNet::mcmf (cognitive 26) crates/vcad-ecad-pcb/src/router/escape.rs:242— FlowNet::mcmf has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 5 (10 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.
LinearDimension::render (cognitive 26) crates/vcad-kernel-drafting/src/dimension/linear.rs:134— LinearDimension::render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 8 (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.
EditorModel.promoteSandboxToDocument (cognitive 26) apple/VcadApp/Sources/VcadApp/Editor.swift:4902— EditorModel.promoteSandboxToDocument has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, match/switch 2 (5 pts), error handling 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.
EditorModel.measurement (cognitive 26) apple/VcadApp/Sources/VcadApp/Measure.swift:18— EditorModel.measurement has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, ternaries 3 (6 pts), match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to one function item inside it that branches (describe). 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.
build.taskPage (cognitive 26) mecheval/leaderboard/src/build.ts:2033— build.taskPage has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14 (17 pts), boolean chains 6, if/else 3 (nesting depth added 3). Of this number, 21 points are the body's own statements and 5 belong to 2 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.
launch.creaseGeometry (cognitive 26) packages/app/public/launch/launch.js:221— launch.creaseGeometry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (6 pts), ternaries 4 (6 pts), boolean chains 1 (nesting depth added 11). Of this number, 25 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.
CamPanel.CamPanel (cognitive 26) packages/app/src/components/cam/CamPanel.tsx:36— CamPanel.CamPanel has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts), ternaries 5 (6 pts), match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 59, 237). 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.
circuit-analysis.computeMapOptions (cognitive 26) packages/app/src/lib/circuit-analysis.ts:44— circuit-analysis.computeMapOptions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 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.
compressed-field.buildSkin (cognitive 26) packages/app/src/lib/compressed-field.ts:234— compressed-field.buildSkin has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 2 (9 pts), boolean chains 1 (nesting depth added 17). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
slicer-worker.onmessage (cognitive 26) packages/app/src/lib/slicer-worker.ts:141— slicer-worker.onmessage has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (10 pts), error handling 2 (3 pts), boolean chains 1, 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.
clearance.computeGroupClearance (cognitive 26) packages/mcp/src/tools/clearance.ts:252— clearance.computeGroupClearance has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 4 (6 pts), error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.aggregateDrc (cognitive 26) packages/mcp/src/tools/ecad.ts:4630— ecad.aggregateDrc has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.summarizePlacementDrc (cognitive 26) packages/mcp/src/tools/ecad.ts:5586— ecad.summarizePlacementDrc has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 4 (5 pts), ternaries 2 (3 pts) (nesting depth added 8). Of this number, 21 points are the body's own statements and 5 belong to 3 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.
ecad.addCoilArray (cognitive 26) packages/mcp/src/tools/ecad.ts:8098— ecad.addCoilArray has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 8 (9 pts), boolean chains 6, loops 1 (nesting depth added 3). Of this number, 21 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ecad.windingLayout (cognitive 26) packages/mcp/src/tools/ecad.ts:8268— ecad.windingLayout has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 8 (9 pts), boolean chains 3, loops 2 (nesting depth added 2). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
gallery.creaseGeometry (cognitive 26) www/public/kit/gallery.js:333— gallery.creaseGeometry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (6 pts), ternaries 4 (6 pts), boolean chains 1 (nesting depth added 11). Of this number, 25 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.
Pocket2D::generate (cognitive 25) crates/vcad-kernel-cam/src/operation/pocket.rs:51— Pocket2D::generate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (6 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.
vcad_kernel_stocksim::verify::verify_stock_against_mesh (cognitive 25) crates/vcad-kernel-stocksim/src/verify.rs:104— vcad_kernel_stocksim::verify::verify_stock_against_mesh has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
make_figures.fig_rd_grid (cognitive 25) docs/compression-math-survey/paper-draft-figures/make_figures.py:86— make_figures.fig_rd_grid has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 3 (9 pts), loops 4 (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.
DeepLink.init (cognitive 25) apple/VcadApp/Sources/VcadApp/AppInstance.swift:134— DeepLink.init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, loops 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.
CNCMachineBar.jobStatus (cognitive 25) apple/VcadApp/Sources/VcadApp/CNCMachineBar.swift:197— CNCMachineBar.jobStatus has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 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.
EditorModel.cubeFaceKind (cognitive 25) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:338— EditorModel.cubeFaceKind has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.adoptRuntimeFrame (cognitive 25) apple/VcadApp/Sources/VcadApp/DocumentRuntime.swift:154— EditorModel.adoptRuntimeFrame has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, 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.
EditorModel.explodedTransforms (cognitive 25) apple/VcadApp/Sources/VcadApp/PoseStudio.swift:186— EditorModel.explodedTransforms has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (6 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.
matrix-cli.main::worker (cognitive 25) mecheval/harness/src/matrix-cli.ts:284— matrix-cli.main::worker has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 2 (5 pts), loops 2 (3 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 (matrix-cli.main) 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.
RaytraceChip.RaytraceChip (cognitive 25) packages/app/src/components/footer/RaytraceChip.tsx:36— RaytraceChip.RaytraceChip has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 4, if/else 2 (nesting depth added 4). Of this number, 21 points are the body's own statements and 4 belong to 3 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.
useBackgroundLuminance.useBackgroundLuminance (cognitive 25) packages/app/src/hooks/useBackgroundLuminance.ts:8— useBackgroundLuminance.useBackgroundLuminance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 8). None of this is in the body itself: all 25 points belong to 4 function literals inside it that branch (lines 17, 90, 116, …). 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.
executors.tryExecuteViaEngine (cognitive 25) packages/core/src/commands/executors.ts:214— executors.tryExecuteViaEngine has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 6 (7 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
trust-boundary.checkCommerceBoundary (cognitive 25) packages/mcp/src/trust-boundary.ts:145— trust-boundary.checkCommerceBoundary has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.exportGerber (cognitive 25) packages/mcp/src/tools/ecad.ts:5965— ecad.exportGerber has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 8 (10 pts), error handling 1 (2 pts), loops 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.
ecad.projectionGrid (cognitive 25) packages/mcp/src/tools/ecad.ts:13627— ecad.projectionGrid has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (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.
record.resolveActions (cognitive 25) packages/mcp/src/tools/record.ts:437— record.resolveActions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 1 (4 pts), loops 2 (3 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.
vcad_gdsii::flatten::flatten_cell (cognitive 24) crates/vcad-gdsii/src/flatten.rs:124— vcad_gdsii::flatten::flatten_cell has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (8 pts), boolean chains 2, 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.
ShellCase::validate (cognitive 24) crates/vcad-kernel-fea/src/shell.rs:171— ShellCase::validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, match/switch 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.
Material::from_constituents (cognitive 24) crates/vcad-kernel-neutronics/src/materials.rs:292— Material::from_constituents has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (7 pts), match/switch 1 (4 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.
FluxTubeAccumulator::measure (cognitive 24) crates/vcad-kernel-qcd/src/fields.rs:140— FluxTubeAccumulator::measure has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (24 pts) (nesting depth added 16). 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.
vcad_sound::to_render_vertices (cognitive 24) crates/vcad-sound/src/lib.rs:514— vcad_sound::to_render_vertices has cognitive complexity 24 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 3 (8 pts) (nesting depth added 14). 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.
PrintWorkbench.orientStep (cognitive 24) apple/VcadApp/Sources/VcadApp/PrintWorkbench.swift:580— PrintWorkbench.orientStep has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 8 (10 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.
ReleasedARView.updateNSView (cognitive 24) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2048— ReleasedARView.updateNSView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, 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.
DrawingToolbar.DrawingToolbar (cognitive 24) packages/app/src/components/DrawingToolbar.tsx:35— DrawingToolbar.DrawingToolbar has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, ternaries 9, if/else 5, error handling 1. Of this number, 18 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
vcad_kernel_wasm.debugString (cognitive 24) packages/kernel-wasm/vcad_kernel_wasm.js:11400— vcad_kernel_wasm.debugString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
receipt-unified.unifiedFromPcbReceipt (cognitive 24) packages/mcp/src/receipt-unified.ts:149— receipt-unified.unifiedFromPcbReceipt has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (17 pts), loops 3 (4 pts), if/else 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.
print-check.recordMeasurement (cognitive 24) packages/mcp/src/tools/print-check.ts:309— print-check.recordMeasurement has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
constraint-claims.verifyConstraintClaims (cognitive 24) packages/mcp/src/tools/constraint-claims.ts:171— constraint-claims.verifyConstraintClaims has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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.
design-constraints.validateAnchors (cognitive 24) packages/mcp/src/tools/design-constraints.ts:190— design-constraints.validateAnchors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, loops 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.
acoustics.simulateStrike (cognitive 24) packages/mcp/src/tools/acoustics.ts:216— acoustics.simulateStrike has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Builder::build (cognitive 23) crates/vcad-ffi/src/features.rs:302— Builder::build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 3 (5 pts), boolean chains 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.
SketchProfile::tessellate (cognitive 23) crates/vcad-kernel-sketch/src/profile.rs:318— SketchProfile::tessellate has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 4 (9 pts), match/switch 1 (2 pts) (nesting depth added 14). 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.
distill.distill (cognitive 23) packages/training/src/modal/distill.py:71— distill.distill has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NavigationScheme.action (cognitive 23) apple/VcadApp/Sources/VcadApp/NavigationScheme.swift:81— NavigationScheme.action has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (18 pts), boolean chains 2, if/else 1 (2 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.
DocTitle.DocTitle (cognitive 23) packages/app/src/components/DocTitle.tsx:34— DocTitle.DocTitle has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 5 (7 pts) (nesting depth added 3). Of this number, 15 points are the body's own statements and 8 belong to 5 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.
sub-feature-picking.pickSubFeature (cognitive 23) packages/app/src/lib/sub-feature-picking.ts:99— sub-feature-picking.pickSubFeature has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 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.
registry-dispatch.engineArgs (cognitive 23) packages/mcp/src/tools/registry-dispatch.ts:612— registry-dispatch.engineArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.updateSchematic (cognitive 23) packages/mcp/src/tools/ecad.ts:2444— ecad.updateSchematic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render.renderPcb (cognitive 23) packages/mcp/src/tools/render.ts:950— render.renderPcb has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 8 (9 pts), boolean chains 3, error handling 1 (nesting depth added 2). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
version-check.compareVersions (cognitive 23) packages/mcp/src/version-check.ts:38— version-check.compareVersions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 2, 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.
crate-generator.generateTypeScriptLoader (cognitive 23) packages/wasmosis/src/crate-generator.ts:318— crate-generator.generateTypeScriptLoader has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (6 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeybindingRegistry::load_overrides (cognitive 22) crates/vcad-app/src/registry.rs:175— KeybindingRegistry::load_overrides has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (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.
CapacityMesh::assign (cognitive 22) crates/vcad-ecad-pcb/src/router/global.rs:117— CapacityMesh::assign has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lattice::cast (cognitive 22) crates/vcad-kernel-assembly/src/joint_range.rs:489— Lattice::cast has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Face::generate (cognitive 22) crates/vcad-kernel-cam/src/operation/face.rs:41— Face::generate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Skyline::factor (cognitive 22) crates/vcad-kernel-fea/src/modal.rs:537— Skyline::factor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 6 (10 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.
Profile::validate (cognitive 22) crates/vcad-kernel-fea/src/section.rs:118— Profile::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, 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.
vcad_kernel_orbit::pass::predict_passes (cognitive 22) crates/vcad-kernel-orbit/src/pass.rs:43— vcad_kernel_orbit::pass::predict_passes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3, 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.
vcad_receipt::mechanical::mass_properties_claims (cognitive 22) crates/vcad-receipt/src/mechanical.rs:276— vcad_receipt::mechanical::mass_properties_claims has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentViewer.call (cognitive 22) apple/VcadApp/Sources/VcadApp/AgentResources.swift:122— AgentViewer.call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (5 pts), boolean chains 2, 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.
BoardPainter.drawPads (cognitive 22) apple/VcadApp/Sources/VcadApp/ElectronicsBoardLayer.swift:183— BoardPainter.drawPads has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, match/switch 1 (2 pts), ternaries 1 (2 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.
ElectronicsWorkspace.deleteSheetSelection (cognitive 22) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:584— ElectronicsWorkspace.deleteSheetSelection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (9 pts), boolean chains 4 (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.
ObjectInspectorWindow.documentSections (cognitive 22) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2523— ObjectInspectorWindow.documentSections has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 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.
SketchSession.lineTap (cognitive 22) apple/VcadApp/Sources/VcadApp/SketchSession.swift:789— SketchSession.lineTap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 2 (5 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.modelDisplayName (cognitive 22) mecheval/leaderboard/src/build.ts:177— build.modelDisplayName has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (13 pts), loops 2 (4 pts), if/else 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.renderHeroMetric (cognitive 22) mecheval/leaderboard/src/build.ts:1748— build.renderHeroMetric has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 5 (7 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompressedFieldOverlay.CompressedFieldHud (cognitive 22) packages/app/src/components/CompressedFieldOverlay.tsx:218— CompressedFieldOverlay.CompressedFieldHud has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 9, if/else 2 (nesting depth added 3). Of this number, 16 points are the body's own statements and 6 belong to 2 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.
executors.executePlacePart (cognitive 22) packages/core/src/commands/executors.ts:554— executors.executePlacePart has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 8 (9 pts), boolean chains 3 (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.
engine-host.handleEngineRequest (cognitive 22) packages/engine/src/engine-host.ts:109— engine-host.handleEngineRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 1 (2 pts), error handling 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.
sweep.resolveSweepAxes (cognitive 22) packages/mcp/src/tools/sweep.ts:126— sweep.resolveSweepAxes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
loon.addLoonToSession (cognitive 22) packages/mcp/src/tools/loon.ts:34— loon.addLoonToSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 6 (8 pts), boolean chains 2 (nesting depth added 6). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ecad.calcRf (cognitive 22) packages/mcp/src/tools/ecad.ts:7631— ecad.calcRf has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 7 (8 pts), boolean chains 3, loops 1 (nesting depth added 3). Of this number, 19 points are the body's own statements and 3 belong to 2 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.
ecad.addNetTie (cognitive 22) packages/mcp/src/tools/ecad.ts:10617— ecad.addNetTie has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ecad.rasterizeSection (cognitive 22) packages/mcp/src/tools/ecad.ts:13302— ecad.rasterizeSection has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (8 pts), loops 3 (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.
ecad.sealedCavityFromMesh (cognitive 22) packages/mcp/src/tools/ecad.ts:13562— ecad.sealedCavityFromMesh has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 8). 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.
import-urdf.importUrdf (cognitive 22) packages/mcp/src/tools/import-urdf.ts:183— import-urdf.importUrdf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 5, 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.
animate.compileJointKeyframes (cognitive 22) packages/mcp/src/tools/animate.ts:231— animate.compileJointKeyframes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
startHeroEngine::extractEdges (cognitive 22) www/src/hero-engine.js:233— startHeroEngine::extractEdges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 pts), ternaries 2 (5 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.
extractEdges (cognitive 22) www/src/wireframe.js:8— extractEdges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 pts), ternaries 2 (5 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.
FractionalIndex::between (cognitive 21) crates/vcad-crdt/src/fractional_index.rs:22— FractionalIndex::between has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 1, 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.
SketchSession::on_click (cognitive 21) crates/vcad-kernel-constraints/src/session.rs:465— SketchSession::on_click has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 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.
FidelityMatrix::to_markdown (cognitive 21) crates/vcad-torture/src/fidelity.rs:228— FidelityMatrix::to_markdown has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 3 (6 pts), match/switch 2 (6 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.
AnalysisAgentTools.call (cognitive 21) apple/VcadApp/Sources/VcadApp/AnalysisAgentTools.swift:17— AnalysisAgentTools.call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, 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.
CNCStudioInspector.selected (cognitive 21) apple/VcadApp/Sources/VcadApp/CNCStudio.swift:374— CNCStudioInspector.selected has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 4 (9 pts), boolean chains 2, 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.
EditorModel.navCommand (cognitive 21) apple/VcadApp/Sources/VcadApp/NavigationViews.swift:225— EditorModel.navCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EditorModel.pathTraceGeometry (cognitive 21) apple/VcadApp/Sources/VcadApp/PathTracer.swift:392— EditorModel.pathTraceGeometry has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (7 pts), boolean chains 5, if/else 3 (5 pts), ternaries 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.
ElectronicsWorkspace.annotate (cognitive 21) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:834— ElectronicsWorkspace.annotate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 4, ternaries 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 4 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.
FieldSkin.init (cognitive 21) apple/VcadApp/Sources/VcadApp/FieldOverlay.swift:245— FieldSkin.init has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (15 pts), boolean chains 6 (nesting depth added 10). Of this number, 15 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AgentShimmerOverlay.rect (cognitive 21) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:1596— AgentShimmerOverlay.rect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (6 pts), ternaries 1 (5 pts), boolean chains 4 (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.
SectionPlane.clip (cognitive 21) apple/VcadApp/Sources/VcadApp/Section.swift:30— SectionPlane.clip has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmartDimension.plan (cognitive 21) apple/VcadApp/Sources/VcadApp/SketchInference.swift:159— SmartDimension.plan has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (9 pts), boolean chains 1, 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.
SketchSession.dimensionTap (cognitive 21) apple/VcadApp/Sources/VcadApp/SketchSession.swift:699— SketchSession.dimensionTap has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (10 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
print-flow-mockup.html.document.addEventListener("click") (cognitive 21) docs/design/print-flow-mockup.html:226— print-flow-mockup.html.document.addEventListener("click") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19 (20 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.
SketchPlane3D.SketchCursor3D (cognitive 21) packages/app/src/components/SketchPlane3D.tsx:549— SketchPlane3D.SketchCursor3D has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 5, loops 1. Of this number, 14 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Viewport.BoxSelectHandler (cognitive 21) packages/app/src/components/Viewport.tsx:65— Viewport.BoxSelectHandler has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 2. None of this is in the body itself: all 21 points belong to 6 function literals inside it that branch (lines 125, 155, 107, …). 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.
camera-framing.expandBboxFromPositions (cognitive 21) packages/core/src/camera-framing.ts:75— camera-framing.expandBboxFromPositions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6, 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.
CommandRegistry.buildSystemPrompt (cognitive 21) packages/core/src/commands/registry.ts:468— CommandRegistry.buildSystemPrompt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (6 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 8). Of this number, 14 points are the body's own statements and 7 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.
clearance.measureGroups (cognitive 21) packages/mcp/src/tools/clearance.ts:326— clearance.measureGroups has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). Of this number, 18 points are the body's own statements and 3 belong to 2 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.
server.slimPreviewForInlineUi (cognitive 21) packages/mcp/src/server.ts:1683— server.slimPreviewForInlineUi has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
annotate.annotate (cognitive 21) packages/training/src/annotate.ts:150— annotate.annotate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (5 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 10). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 175). 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.
validate.validateExample (cognitive 21) packages/training/src/validate.ts:23— validate.validateExample has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), error handling 2 (3 pts), boolean chains 2, loops 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.
Obstacle::intersects_segment (cognitive 20) REDACTED:51— Obstacle::intersects_segment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 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.
PushShoveRouter::build_visibility_path (cognitive 20) REDACTED:229— PushShoveRouter::build_visibility_path has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 6 (10 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.
Pcb::infer_layer_roles (cognitive 20) crates/vcad-ir/src/ecad.rs:1646— Pcb::infer_layer_roles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GpuRouterState::apply_deltas (cognitive 20) crates/vcad-kernel-gpu/src/router_state.rs:151— GpuRouterState::apply_deltas has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PointGrid::two_nearest (cognitive 20) crates/vcad-kernel-tessellate/src/frozen.rs:889— PointGrid::two_nearest has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 pts), match/switch 1 (5 pts) (nesting depth added 14). 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.
vcad_parts::vacuum::flange_at (cognitive 20) crates/vcad-parts/src/vacuum/mod.rs:894— vcad_parts::vacuum::flange_at has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (7 pts) (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.
Polygon::dedupe_collinear (cognitive 20) crates/vcad-slicer/src/path.rs:192— Polygon::dedupe_collinear has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
eval.validate_references (cognitive 20) packages/training/src/modal/eval.py:99— eval.validate_references has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (18 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.
AgentSelection.resolve (cognitive 20) apple/VcadApp/Sources/VcadApp/AgentCore.swift:447— AgentSelection.resolve 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). 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.
ContactShadow.layer (cognitive 20) apple/VcadApp/Sources/VcadApp/ContactShadow.swift:129— ContactShadow.layer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 3, ternaries 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.
ElectronicsBoardPreview.updateNSView (cognitive 20) apple/VcadApp/Sources/VcadApp/ElectronicsBoardPreview.swift:16— ElectronicsBoardPreview.updateNSView has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 pts), loops 4 (5 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.
FieldOverlayStore.showSolved (cognitive 20) apple/VcadApp/Sources/VcadApp/AnalysisStore.swift:275— FieldOverlayStore.showSolved has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SafeWriter.write (cognitive 20) apple/VcadApp/Sources/VcadApp/LocalHistory.swift:41— SafeWriter.write has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PickingState.prewarm (cognitive 20) apple/VcadApp/Sources/VcadApp/Picking.swift:319— PickingState.prewarm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchSession.constructionInk (cognitive 20) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1470— SketchSession.constructionInk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 4, match/switch 1 (2 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.
solver.getSolver (cognitive 20) mecheval/harness/src/solver.ts:147— solver.getSolver has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
pass_k.loadAllRuns (cognitive 20) mecheval/harness/src/pass_k.ts:141— pass_k.loadAllRuns has cognitive complexity 20 (threshold 15). Drivers by points: error handling 3 (6 pts), loops 3 (6 pts), if/else 1 (4 pts), ternaries 1 (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.
Viewport.Viewport (cognitive 20) packages/app/src/components/Viewport.tsx:232— Viewport.Viewport has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 8, ternaries 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 386, 353, 274, …). 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.
CircuitTabTools.CircuitTabTools (cognitive 20) packages/app/src/components/electronics/CircuitTabTools.tsx:44— CircuitTabTools.CircuitTabTools has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 4 (5 pts), boolean chains 3 (nesting depth added 5). Of this number, 15 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.
DfmChip.DfmChip (cognitive 20) packages/app/src/components/footer/DfmChip.tsx:16— DfmChip.DfmChip has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 5 (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.
KoanChip.KoanChip (cognitive 20) packages/app/src/components/footer/KoanChip.tsx:63— KoanChip.KoanChip has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
usePerfMonitor.usePerfMonitor (cognitive 20) packages/app/src/components/footer/usePerfMonitor.ts:48— usePerfMonitor.usePerfMonitor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 8). None of this is in the body itself: all 20 points belong to 3 function literals inside it that branch (lines 84, 51, 131). 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.renderReceiptText (cognitive 20) packages/core/src/utils/receipt/render.ts:64— render.renderReceiptText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (7 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Navigation.Navigation (cognitive 20) packages/docs/src/components/Navigation.tsx:172— Navigation.Navigation has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 5, if/else 4 (nesting depth added 3). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (renderNavItem, a function literal at line 182, isActive, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
analyze-worker.onmessage (cognitive 20) packages/engine/src/analyze-worker.ts:32— analyze-worker.onmessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (6 pts), ternaries 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.
index.fromVCode (cognitive 20) packages/ir/src/index.ts:369— index.fromVCode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), boolean chains 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.
index.splitLineRespectingQuotes (cognitive 20) packages/ir/src/index.ts:679— index.splitLineRespectingQuotes 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.
vcad_kernel_wasm.__wbg_load (cognitive 20) packages/kernel-wasm/vcad_kernel_wasm.js:11771— vcad_kernel_wasm.__wbg_load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). 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.
loon.composeLoonModules (cognitive 20) packages/mcp/src/tools/loon.ts:249— loon.composeLoonModules has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), boolean chains 2, 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.
pcb-validate.validatePcb (cognitive 20) packages/mcp/src/tools/pcb-validate.ts:33— pcb-validate.validatePcb has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, 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.
part-stock.parseCsv (cognitive 20) packages/mcp/src/tools/part-stock.ts:627— part-stock.parseCsv has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, 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.
parts.placePartTool (cognitive 20) packages/mcp/src/tools/parts.ts:191— parts.placePartTool has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4, if/else 4 (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.
animate.validateTimeline (cognitive 20) packages/mcp/src/tools/animate.ts:81— animate.validateTimeline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 95). 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.
server.resolvePreviewDocumentId (cognitive 20) packages/mcp/src/server.ts:1927— server.resolvePreviewDocumentId has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 2, ternaries 1 (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.
vcad_kernel_atoms::inspect::report (cognitive 19) crates/vcad-kernel-atoms/src/inspect.rs:33— vcad_kernel_atoms::inspect::report has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 5 (6 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.
OrdinateDimension::render (cognitive 19) crates/vcad-kernel-drafting/src/dimension/ordinate.rs:77— OrdinateDimension::render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (19 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.
IronStack::expand (cognitive 19) crates/vcad-kernel-magnetostatic/src/iron.rs:153— IronStack::expand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 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.
vcad_process::sim::simulate (cognitive 19) crates/vcad-process/src/sim.rs:147— vcad_process::sim::simulate has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_slicer_bambu::discovery::collect (cognitive 19) crates/vcad-slicer-bambu/src/discovery.rs:69— vcad_slicer_bambu::discovery::collect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
make_figures.fig_aggregate (cognitive 19) docs/compression-math-survey/paper-draft-figures/make_figures.py:178— make_figures.fig_aggregate has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 2 (6 pts), ternaries 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentSession.submit (cognitive 19) apple/VcadApp/Sources/VcadApp/AgentPanel.swift:51— AgentSession.submit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 2 (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.
WorkspaceHeader.body (cognitive 19) apple/VcadApp/Sources/VcadApp/CNCStudio.swift:14— WorkspaceHeader.body has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 7, 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, 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.
SchematicPainter.drawWires (cognitive 19) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:125— SchematicPainter.drawWires has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (8 pts), ternaries 3 (6 pts), if/else 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.
FrogAgent.send (cognitive 19) apple/VcadApp/Sources/VcadApp/FrogAgent.swift:189— FrogAgent.send has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (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.
PrintWorkbench.printerStep (cognitive 19) apple/VcadApp/Sources/VcadApp/PrintWorkbench.swift:697— PrintWorkbench.printerStep has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (6 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.
RuntimeScrubBench.runIfRequested (cognitive 19) apple/VcadApp/Sources/VcadApp/RuntimeBench.swift:16— RuntimeScrubBench.runIfRequested has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 6 (7 pts), ternaries 2 (3 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.
SketchSession.inferenceModel (cognitive 19) apple/VcadApp/Sources/VcadApp/SketchSession.swift:754— SketchSession.inferenceModel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 1 (4 pts), boolean chains 3, match/switch 1 (2 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.
SketchSession.polyline (cognitive 19) apple/VcadApp/Sources/VcadApp/SketchSession.swift:1527— SketchSession.polyline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
launch-animatic.html.topo (cognitive 19) docs/launch/launch-animatic.html:105— launch-animatic.html.topo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-mcp.applyConversationCacheBreakpoints (cognitive 19) mecheval/harness/src/solvers/claude-mcp.ts:264— claude-mcp.applyConversationCacheBreakpoints has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalyzePanel.useSelectedFaceRegion (cognitive 19) packages/app/src/components/AnalyzePanel.tsx:127— AnalyzePanel.useSelectedFaceRegion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 9). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 134). 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.
molecule-store.buckyball (cognitive 19) packages/app/src/stores/molecule-store.ts:113— molecule-store.buckyball has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 2 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ContextMenu.dispatchDesignPcbForSelection (cognitive 19) packages/app/src/components/ContextMenu.tsx:52— ContextMenu.dispatchDesignPcbForSelection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeatureTree.SketchTreeSection (cognitive 19) packages/app/src/components/FeatureTree.tsx:134— FeatureTree.SketchTreeSection has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, ternaries 6, if/else 2. Of this number, 18 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
QuotePanel.QuotePanel (cognitive 19) packages/app/src/components/QuotePanel.tsx:102— QuotePanel.QuotePanel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 135, a function literal at line 176, a function literal at line 187, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SplashMolecule.buildC60 (cognitive 19) packages/app/src/components/SplashMolecule.tsx:10— SplashMolecule.buildC60 has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 2 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PrinterSelect.PrinterSelect (cognitive 19) packages/app/src/components/print/PrinterSelect.tsx:12— PrinterSelect.PrinterSelect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 3 (4 pts), error handling 2 (nesting depth added 2). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (handleConnect, handleDiscover, a function literal at line 30, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useElectronicsSync.useElectronicsSync (cognitive 19) packages/app/src/hooks/useElectronicsSync.ts:31— useElectronicsSync.useElectronicsSync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 104, 110, 41, …). 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.
useEngine.useEngine (cognitive 19) packages/app/src/hooks/useEngine.ts:31— useEngine.useEngine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9 (nesting depth added 1). None of this is in the body itself: all 19 points belong to 12 function literals inside it that branch (lines 35, 157, 180, …). 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.
usePcbAutoFit.usePcbAutoFit (cognitive 19) packages/app/src/hooks/usePcbAutoFit.ts:26— usePcbAutoFit.usePcbAutoFit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 36, 32). 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.
useTimelinePlayback.useTimelinePlayback (cognitive 19) packages/app/src/hooks/useTimelinePlayback.ts:24— useTimelinePlayback.useTimelinePlayback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, loops 1 (nesting depth added 4). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 39). 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.
ui-store.useUiStore (cognitive 19) packages/core/src/stores/ui-store.ts:299— ui-store.useUiStore has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (10 pts), error handling 6, if/else 2, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 19 points belong to 14 function literals inside it that branch (lines 426, 474, 556, …). 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.
index.parseJoint (cognitive 19) packages/ir/src/index.ts:1100— index.parseJoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (5 pts), match/switch 1 (nesting depth added 8). Of this number, 18 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.
inspect.computeInspection (cognitive 19) packages/mcp/src/tools/inspect.ts:145— inspect.computeInspection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3, boolean chains 2, loops 2 (nesting depth added 4). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
topopt.topologyOptimizeTool (cognitive 19) packages/mcp/src/tools/topopt.ts:280— topopt.topologyOptimizeTool has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, ternaries 6, boolean chains 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.
protocol-2026.handleTaskMethod (cognitive 19) packages/mcp/src/protocol-2026.ts:1036— protocol-2026.handleTaskMethod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), boolean chains 3, ternaries 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.
ecad.largestRectangle (cognitive 19) packages/mcp/src/tools/ecad.ts:13496— ecad.largestRectangle has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 1 (4 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render.renderStackup (cognitive 19) packages/mcp/src/tools/render.ts:1357— render.renderStackup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (5 pts), error handling 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.
D2 · Cognitive Complexity· cli.program.command("convert-conversations").description("Convert multi-turn conversations to flat training examples").requi (cognitive 19) · ×1
cli.program.command("convert-conversations").description("Convert multi-turn conversations to flat training examples").requi (cognitive 19) packages/training/src/cli.ts:931— cli.program.command("convert-conversations").description("Convert multi-turn conversations to flat training examples").requi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 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.
vcad_chat::prompt::type_catalog (cognitive 18) crates/vcad-chat/src/prompt.rs:147— vcad_chat::prompt::type_catalog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lu::factor (cognitive 18) crates/vcad-kernel-acoustics/src/linalg.rs:42— Lu::factor has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (7 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.
Contour2D::contour_to_points (cognitive 18) crates/vcad-kernel-cam/src/operation/contour.rs:285— Contour2D::contour_to_points has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Contour::to_geo_polygon (cognitive 18) crates/vcad-kernel-cam/src/operation.rs:238— Contour::to_geo_polygon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TurnProfile::role_of (cognitive 18) crates/vcad-kernel-cam/src/turning/profile.rs:301— TurnProfile::role_of has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElectroSolution::charge (cognitive 18) crates/vcad-kernel-em/src/electro.rs:323— ElectroSolution::charge has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (6 pts), boolean chains 4 (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.
StateVector::to_elements (cognitive 18) crates/vcad-kernel-orbit/src/state.rs:71— StateVector::to_elements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
make_figures.fig_heatmap (cognitive 18) docs/compression-math-survey/paper-draft-figures/make_figures.py:132— make_figures.fig_heatmap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 5 (7 pts), ternaries 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentViewer.filletEdges (cognitive 18) apple/VcadApp/Sources/VcadApp/AgentResources.swift:173— AgentViewer.filletEdges has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8, if/else 5 (6 pts), boolean chains 4 (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.
ClearanceSection.body (cognitive 18) apple/VcadApp/Sources/VcadApp/AnalysisPanel.swift:288— ClearanceSection.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (5 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.
DeepLink.gunzip (cognitive 18) apple/VcadApp/Sources/VcadApp/AppInstance.swift:225— DeepLink.gunzip has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, loops 2 (4 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.
EditorModel.applyBlend (cognitive 18) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:85— EditorModel.applyBlend has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 6, 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.
EditorModel.applyHole (cognitive 18) apple/VcadApp/Sources/VcadApp/FeatureOps.swift:162— EditorModel.applyHole has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (nesting depth added 4). 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.
BoardPainter.drawArt (cognitive 18) apple/VcadApp/Sources/VcadApp/ElectronicsBoardLayer.swift:159— BoardPainter.drawArt has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 3 (5 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.
SchematicPainter.draw (cognitive 18) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:73— SchematicPainter.draw has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 4 (6 pts), ternaries 1 (2 pts), boolean chains 1 (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, 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.
ElectronicsWorkspace.saveFootprintToLibrary (cognitive 18) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:699— ElectronicsWorkspace.saveFootprintToLibrary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, loops 2, match/switch 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 4). Of this number, 15 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.
DecodedField.planeCGImage (cognitive 18) apple/VcadApp/Sources/VcadApp/FieldOverlay.swift:214— DecodedField.planeCGImage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReleasedOverlayView.body (cognitive 18) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:867— ReleasedOverlayView.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (2 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.
DockIcon.contentBounds (cognitive 18) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2955— DockIcon.contentBounds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SweepPlan.sample (cognitive 18) apple/VcadApp/Sources/VcadApp/SweepPlan.swift:89— SweepPlan.sample has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 8). 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.
TimelineVideoExporter.export (cognitive 18) apple/VcadApp/Sources/VcadApp/TimelineEditor.swift:191— TimelineVideoExporter.export has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 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.
WelcomeThumbnailRenderer.draw (cognitive 18) apple/VcadApp/Sources/VcadApp/WelcomeWindow.swift:311— WelcomeThumbnailRenderer.draw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 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.
ReleasedDesktop.swift.topologyOverlayEntity (cognitive 18) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:3041— ReleasedDesktop.swift.topologyOverlayEntity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 4). Of this number, 9 points are the body's own statements and 9 belong to 2 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.
build.toolSummary (cognitive 18) mecheval/leaderboard/src/build.ts:2221— build.toolSummary has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 3, match/switch 1 (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.
CompressedFieldOverlay.planeImage (cognitive 18) packages/app/src/components/CompressedFieldOverlay.tsx:33— CompressedFieldOverlay.planeImage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 3 (nesting depth added 9). Of this number, 13 points are the body's own statements and 5 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.
ExportAllPage.ExportAllPage (cognitive 18) packages/app/src/components/ExportAllPage.tsx:110— ExportAllPage.ExportAllPage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 4, if/else 2, error handling 1 (nesting depth added 5). Of this number, 11 points are the body's own statements and 7 belong to 2 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.
Header.Header (cognitive 18) packages/app/src/components/Header.tsx:355— Header.Header has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 6, boolean chains 3, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 415, a function literal at line 375, handleExport, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CircuitAnalysisPanel.CircuitAnalysisPanel (cognitive 18) packages/app/src/components/electronics/CircuitAnalysisPanel.tsx:278— CircuitAnalysisPanel.CircuitAnalysisPanel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, ternaries 3, if/else 2. Of this number, 13 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
toolbar.MoreDropdown (cognitive 18) packages/app/src/components/ui/toolbar.tsx:245— toolbar.MoreDropdown has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 7, if/else 2 (nesting depth added 1). Of this number, 10 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
backfill.runIdbBackfill (cognitive 18) packages/app/src/lib/backfill.ts:39— backfill.runIdbBackfill has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 3 (6 pts), boolean chains 2, ternaries 1 (2 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.
pcb-interference.aabbOfPositions (cognitive 18) packages/app/src/lib/pcb-interference.ts:28— pcb-interference.aabbOfPositions 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.
save-load.parseJsonVcadFile (cognitive 18) packages/core/src/utils/save-load.ts:327— save-load.parseJsonVcadFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 6, ternaries 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.
chat-store.useChatStore (cognitive 18) packages/core/src/stores/chat-store.ts:304— chat-store.useChatStore has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 3. None of this is in the body itself: all 18 points belong to 9 function literals inside it that branch (lines 402, 464, 371, …). 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.
evaluate.evaluateDocument (cognitive 18) packages/engine/src/evaluate.ts:121— evaluate.evaluateDocument has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 159). 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.
index.parseLight (cognitive 18) packages/ir/src/index.ts:1278— index.parseLight has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app-link.deliverPush (cognitive 18) packages/mcp/src/app-link.ts:261— app-link.deliverPush has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (6 pts), boolean chains 4 (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.
sweep.withComponentBodies (cognitive 18) packages/mcp/src/tools/sweep.ts:266— sweep.withComponentBodies has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 5 (6 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
print-check.parseMeasurables (cognitive 18) packages/mcp/src/tools/print-check.ts:157— print-check.parseMeasurables has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 160). 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.
loon-assets.resolveLoonAssets (cognitive 18) packages/mcp/src/tools/loon-assets.ts:93— loon-assets.resolveLoonAssets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, error handling 1 (3 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.
gym.gymStep (cognitive 18) packages/mcp/src/tools/gym.ts:637— gym.gymStep has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (5 pts), boolean chains 4, error handling 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.
next-actions.enrichSuccessResult (cognitive 18) packages/mcp/src/tools/next-actions.ts:364— next-actions.enrichSuccessResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 1 (2 pts), 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.
ecad.inspectSchematic (cognitive 18) packages/mcp/src/tools/ecad.ts:2506— ecad.inspectSchematic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 4, loops 2 (nesting depth added 2). Of this number, 13 points are the body's own statements and 5 belong to 4 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.
ecad.getFootprint (cognitive 18) packages/mcp/src/tools/ecad.ts:9016— ecad.getFootprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 6 (7 pts), boolean chains 4 (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.
splitter.splitWasm (cognitive 18) packages/wasmosis/src/splitter.ts:289— splitter.splitWasm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (6 pts), boolean chains 1, 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.
cli.analyzeWasmBinary (cognitive 18) packages/wasmosis/src/cli.ts:305— cli.analyzeWasmBinary has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 6 (8 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.
GearSpec::profile (cognitive 17) crates/vcad-ir/src/gear.rs:264— GearSpec::profile has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 6 (8 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.
CouplingLedger::completeness (cognitive 17) crates/vcad-kernel-adjoint/src/ledger.rs:383— CouplingLedger::completeness has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 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.
CpuRenderer::render_samples (cognitive 17) crates/vcad-kernel-raytrace/src/cpu.rs:72— CpuRenderer::render_samples has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (7 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.
TaskStore::handle (cognitive 17) crates/vcad-mcp/src/tasks.rs:288— TaskStore::handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vcad_sim::rl::train_curriculum (cognitive 17) crates/vcad-sim/src/rl.rs:745— vcad_sim::rl::train_curriculum has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (7 pts) (nesting depth added 8). 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.
AgentCore.engineTool (cognitive 17) apple/VcadApp/Sources/VcadApp/AgentCore.swift:307— AgentCore.engineTool has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.chainLoops (cognitive 17) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:463— EditorModel.chainLoops has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 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.
NativeElectronicsView.body (cognitive 17) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:12— NativeElectronicsView.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, ternaries 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.
NativeElectronicsView.statusPill (cognitive 17) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:111— NativeElectronicsView.statusPill has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 4 (5 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.
ElectronicsWorkspace.commitRoute (cognitive 17) apple/VcadApp/Sources/VcadApp/ElectronicsWorkspace.swift:143— ElectronicsWorkspace.commitRoute has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ElicitationBanner.body (cognitive 17) apple/VcadApp/Sources/VcadApp/Elicitation.swift:267— ElicitationBanner.body has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 2, if/else 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.
FeatureTree.getPartIcon (cognitive 17) packages/app/src/components/FeatureTree.tsx:394— FeatureTree.getPartIcon has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
EcadFeatureInspector.EcadFeatureInspector (cognitive 17) packages/app/src/components/electronics/EcadFeatureInspector.tsx:19— EcadFeatureInspector.EcadFeatureInspector has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (nesting depth added 4). Of this number, 13 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.
useUrlSync.useUrlSync (cognitive 17) packages/app/src/hooks/useUrlSync.ts:42— useUrlSync.useUrlSync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, ternaries 1. None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 86, 52). 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.
drawing-sheet.buildDrawingSheetSpec (cognitive 17) packages/app/src/lib/drawing-sheet.ts:223— drawing-sheet.buildDrawingSheetSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, loops 2, ternaries 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
lazy-with-retry.lazyWithRetry (cognitive 17) packages/app/src/lib/lazy-with-retry.ts:33— lazy-with-retry.lazyWithRetry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (5 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 37). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
document-store.applyLegacyResult (cognitive 17) packages/core/src/stores/document-store.ts:773— document-store.applyLegacyResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evaluate.expandPartInstances (cognitive 17) packages/engine/src/evaluate.ts:1156— evaluate.expandPartInstances has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), error handling 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
clearance.clearanceReceiptClaims (cognitive 17) packages/mcp/src/tools/clearance.ts:913— clearance.clearanceReceiptClaims has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 4). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 917). 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.
registry-dispatch.normalizeNodeRefs (cognitive 17) packages/mcp/src/tools/registry-dispatch.ts:154— registry-dispatch.normalizeNodeRefs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FulfillmentBroker.quote (cognitive 17) packages/mcp/src/fabricate/broker.ts:58— FulfillmentBroker.quote has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 3 (4 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
preview.sceneBounds (cognitive 17) packages/mcp/src/tools/preview.ts:341— preview.sceneBounds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (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.
preview.decimateMesh (cognitive 17) packages/mcp/src/tools/preview.ts:369— preview.decimateMesh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (6 pts), boolean chains 3 (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.
joint-range.overlap (cognitive 17) packages/mcp/src/tools/joint-range.ts:162— joint-range.overlap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (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.
ecad.splitAtRepeatedVertices (cognitive 17) packages/mcp/src/tools/ecad.ts:13260— ecad.splitAtRepeatedVertices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 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.
ecad.copperAreaByLayer (cognitive 17) packages/mcp/src/tools/ecad.ts:13895— ecad.copperAreaByLayer has cognitive complexity 17 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
changelog.getChangelog (cognitive 17) packages/mcp/src/tools/changelog.ts:58— changelog.getChangelog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5 (nesting depth added 1). Of this number, 10 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
source-parser.parseFunction (cognitive 17) REDACTED:269— source-parser.parseFunction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GraphicsOutput::display_halfblock (cognitive 16) crates/termview/src/output.rs:103— GraphicsOutput::display_halfblock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (vcad_termview::output::buffer_to_halfblock) 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.
TerminalCaps::detect (cognitive 16) crates/termview/src/terminal.rs:53— TerminalCaps::detect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 2 (4 pts), boolean chains 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.
Requirement::ztip (cognitive 16) crates/vcad-kernel-cam/src/turning/rotary.rs:209— Requirement::ztip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 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.
vcad_kernel_geom::invert_surface_point (cognitive 16) crates/vcad-kernel-geom/src/lib.rs:105— vcad_kernel_geom::invert_surface_point has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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.
Distribution::check (cognitive 16) crates/vcad-kernel-tolerance/src/dist.rs:177— Distribution::check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, 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.
PrinterStatus::from_mqtt_payload (cognitive 16) crates/vcad-slicer-bambu/src/status.rs:154— PrinterStatus::from_mqtt_payload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
make_demos.at_rate (cognitive 16) docs/compression-math-survey/paper-draft-figures/make_demos.py:67— make_demos.at_rate has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (6 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.
AgentEdits.adoptDocument (cognitive 16) apple/VcadApp/Sources/VcadApp/AgentEdits.swift:121— AgentEdits.adoptDocument has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 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.
AppStore.selection (cognitive 16) apple/VcadApp/Sources/VcadApp/AppStore.swift:103— AppStore.selection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (6 pts), loops 1 (2 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.
CamJobPanel.body (cognitive 16) apple/VcadApp/Sources/VcadApp/CamJobPanel.swift:135— CamJobPanel.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 2 (4 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.
DocumentEngine.send (cognitive 16) apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:202— DocumentEngine.send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, match/switch 1, ternaries 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.
EditorModel.featureHandles (cognitive 16) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:96— EditorModel.featureHandles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 2 (3 pts), match/switch 1 (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.
EditorModel.faceProfile (cognitive 16) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:412— EditorModel.faceProfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.fillPartMeshes (cognitive 16) apple/VcadApp/Sources/VcadApp/DocumentRuntime.swift:80— EditorModel.fillPartMeshes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorModel.documentBytes (cognitive 16) apple/VcadApp/Sources/VcadApp/PoseStudio.swift:31— EditorModel.documentBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6 (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.
BoardPainter.drawRoutePreview (cognitive 16) apple/VcadApp/Sources/VcadApp/ElectronicsBoardLayer.swift:119— BoardPainter.drawRoutePreview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (6 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.
SchematicPainter.drawBox (cognitive 16) apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:230— SchematicPainter.drawBox has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 2 (4 pts), boolean chains 2, 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.
ElectronicsCanvas.bodyAt (cognitive 16) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:743— ElectronicsCanvas.bodyAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, 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.
ElectronicsWorkspace.buildSchematicFromBoard (cognitive 16) apple/VcadApp/Sources/VcadApp/ElectronicsView.swift:393— ElectronicsWorkspace.buildSchematicFromBoard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 6). Of this number, 14 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.
PathTraceNSView.tick (cognitive 16) apple/VcadApp/Sources/VcadApp/PathTracer.swift:541— PathTraceNSView.tick has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (4 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.
ReleaseWindowController.show (cognitive 16) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:137— ReleaseWindowController.show has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 3, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SketchSession.filletTap (cognitive 16) apple/VcadApp/Sources/VcadApp/SketchSession.swift:962— SketchSession.filletTap has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 4, if/else 3, loops 2. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RingsAtCard.pitchRow (cognitive 16) apple/VcadApp/Sources/VcadApp/SoundPanel.swift:690— RingsAtCard.pitchRow has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (6 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.
FieldOverlay.swift.solidMask (cognitive 16) apple/VcadApp/Sources/VcadApp/FieldOverlay.swift:117— FieldOverlay.swift.solidMask has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), boolean chains 2, if/else 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). 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.
FieldOverlay.swift.makeFieldEntity (cognitive 16) apple/VcadApp/Sources/VcadApp/FieldOverlay.swift:417— FieldOverlay.swift.makeFieldEntity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (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.
DocumentVolume.body (cognitive 16) apple/VcadVision/Sources/VcadVision/DocumentVolume.swift:21— DocumentVolume.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
launch-animatic.html.stator (cognitive 16) docs/launch/launch-animatic.html:75— launch-animatic.html.stator has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), ternaries 1 (4 pts), if/else 2 (3 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.
AtomInstances.AtomInstances (cognitive 16) packages/app/src/components/AtomInstances.tsx:201— AtomInstances.AtomInstances has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 4, boolean chains 2, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 308, handlePick, a function literal at line 363, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FeatureTree.FeatureTree (cognitive 16) packages/app/src/components/FeatureTree.tsx:1127— FeatureTree.FeatureTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1. Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (handleDragEnd, a function literal at line 1198, a function literal at line 1210, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
KeyboardPrefsPanel.KeyboardPrefsPanel (cognitive 16) packages/app/src/components/KeyboardPrefsPanel.tsx:52— KeyboardPrefsPanel.KeyboardPrefsPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 4 (5 pts), ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 76, 62, 78, …). 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.
KeyboardPrefsPanel.CommandRow (cognitive 16) packages/app/src/components/KeyboardPrefsPanel.tsx:209— KeyboardPrefsPanel.CommandRow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (6 pts), if/else 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Header.RayTracingSubmenu (cognitive 16) packages/app/src/components/Header.tsx:254— Header.RayTracingSubmenu has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 5, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (qualityLabel, a function literal at line 298, a function literal at line 286, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
InlineProperties.InlineProperties (cognitive 16) packages/app/src/components/InlineProperties.tsx:178— InlineProperties.InlineProperties has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 5, if/else 4, loops 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.
ParametersPanel.ParametersPanel (cognitive 16) packages/app/src/components/ParametersPanel.tsx:387— ParametersPanel.ParametersPanel has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), loops 3 (5 pts), if/else 2 (3 pts), ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 414, 396, 444, …). 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.
PropertyPanel.SubFeatureInspector (cognitive 16) packages/app/src/components/PropertyPanel.tsx:1338— PropertyPanel.SubFeatureInspector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1353, 1365). 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.
PcbConstraints3D.anchorPos (cognitive 16) packages/app/src/components/electronics/pcb3d/PcbConstraints3D.tsx:37— PcbConstraints3D.anchorPos has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 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.
PcbBoardMesh.PcbBoardMesh (cognitive 16) packages/app/src/components/electronics/pcb3d/PcbBoardMesh.tsx:19— PcbBoardMesh.PcbBoardMesh has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 20, 66, 57). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
NewPcbDialog.NewPcbDialog (cognitive 16) packages/app/src/components/dialogs/NewPcbDialog.tsx:32— NewPcbDialog.NewPcbDialog has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 45, handleCreate, a function literal at line 113, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Sparkline.Sparkline (cognitive 16) packages/app/src/components/footer/Sparkline.tsx:20— Sparkline.Sparkline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 29). 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.
DfmOverlay.DfmOverlay (cognitive 16) packages/app/src/components/print/DfmOverlay.tsx:36— DfmOverlay.DfmOverlay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 3 (4 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 43, a function literal at line 74, severityIcon, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ActionResultCard.ActionResultCard (cognitive 16) packages/app/src/components/ui/notifications/ActionResultCard.tsx:58— ActionResultCard.ActionResultCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 6, if/else 3 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useCircuitSim.useCircuitSim (cognitive 16) packages/app/src/hooks/useCircuitSim.ts:22— useCircuitSim.useCircuitSim has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 5, error handling 2 (3 pts) (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 41, 78, 62, …). 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.
circuit-analysis.formatSiValue (cognitive 16) packages/app/src/lib/circuit-analysis.ts:260— circuit-analysis.formatSiValue has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compressed-field.loadCompressedField (cognitive 16) packages/app/src/lib/compressed-field.ts:93— compressed-field.loadCompressedField has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 1 (3 pts), ternaries 3, boolean chains 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pcb-autoroute.autorouteRatsnest (cognitive 16) packages/app/src/lib/pcb-autoroute.ts:17— pcb-autoroute.autorouteRatsnest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 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.
CommandRegistry.getTypeCatalog (cognitive 16) packages/core/src/commands/registry.ts:436— CommandRegistry.getTypeCatalog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sketch-store.useSketchStore.addPoint (cognitive 16) packages/core/src/stores/sketch-store.ts:423— sketch-store.useSketchStore.addPoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
measure.measure (cognitive 16) packages/mcp/src/tools/measure.ts:417— measure.measure has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), if/else 4 (5 pts), error handling 3, boolean chains 2 (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.
claims-ledger.verifyLedgerClaims (cognitive 16) packages/mcp/src/tools/claims-ledger.ts:783— claims-ledger.verifyLedgerClaims has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (5 pts), boolean chains 2, 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.
batch-edit.resolveSymbolicRefs (cognitive 16) packages/mcp/src/tools/batch-edit.ts:136— batch-edit.resolveSymbolicRefs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). Of this number, 12 points are the body's own statements and 4 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.
ecad.lengthMatchTraces (cognitive 16) packages/mcp/src/tools/ecad.ts:4815— ecad.lengthMatchTraces has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 5, boolean chains 2, loops 1 (2 pts) (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, 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.
ecad.solveDense (cognitive 16) packages/mcp/src/tools/ecad.ts:6793— ecad.solveDense has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (8 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.
render.renderRatsnest (cognitive 16) packages/mcp/src/tools/render.ts:1193— render.renderRatsnest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 5 (6 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
cli.runBuild (cognitive 16) packages/wasmosis/src/cli.ts:532— cli.runBuild has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
pcbFigure (cognitive 16) www/public/kit/gallery.js:642— pcbFigure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), loops 4 (5 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 6 function items inside it that branch (buildBoard, buildBoard::side, wake, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
hero::onmessage (cognitive 16) packages/app/public/launch/launch.js:566— hero::onmessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 1 (2 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, 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.
D22 · Internal API Consistency· `DependencyGraph.getEvaluationOrder` returns an array (`T[]`) where its 3 siblings return a set · ×1
`DependencyGraph.getEvaluationOrder` returns an array (`T[]`) where its 3 siblings return a set packages/engine/src/dependency-graph.ts:143— 3 of 4 collection-returning members of `DependencyGraph` return a set (3 of 4). Siblings: DependencyGraph.getAffectedNodes (packages/engine/src/dependency-graph.ts:101); DependencyGraph.getDependencies (packages/engine/src/dependency-graph.ts:128); DependencyGraph.getDependents (packages/engine/src/dependency-graph.ts:135). Return a set. [rule A4]
D22 · Internal API Consistency· `Engine.simulateCavity` takes (optionsjson, paramsjson) where its 8 siblings take (paramsjson, optionsjson) · ×1
`Engine.simulateCavity` takes (optionsjson, paramsjson) where its 8 siblings take (paramsjson, optionsjson) packages/engine/src/index.ts:2795— 8 of 9 members of `Engine` with these two same-typed parameters take them in the order (paramsjson, optionsjson) (8 of 9). Siblings: Engine.particleSimulate (packages/engine/src/index.ts:1873); Engine.particleSimulate3d (packages/engine/src/index.ts:1895); Engine.toleranceAnalyze (packages/engine/src/index.ts:1934); Engine.thermalSolve (packages/engine/src/index.ts:1954); Engine.thermalSolveDocument (packages/engine/src/index.ts:1976). Reorder to (paramsjson, optionsjson); both are the same type, so the compiler cannot catch a swapped call. [rule A3]
D4 · Code Duplication· Near-duplicate member family (4 members, 47 shared lines) · ×1
Near-duplicate member family (4 members, 47 shared lines) crates/vcad-kernel-acoustics/src/receipt.rs:260— crates/vcad-kernel-acoustics/src/receipt.rs:260-312 | crates/vcad-kernel-em/src/receipt.rs:369-421 | crates/vcad-kernel-flow/src/receipt.rs:283-335 | crates/vcad-kernel-thermal/src/receipt.rs:423-475 — These 4 members are variants of one another: a block of 47 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, 26 shared lines) · ×1
Near-duplicate member family (4 members, 26 shared lines) apple/VcadApp/Sources/VcadApp/Editor.swift:2771— apple/VcadApp/Sources/VcadApp/Editor.swift:2771-2822 | apple/VcadApp/Sources/VcadApp/Editor.swift:4721-4774 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2771-2822 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4721-4774 — These 4 members are variants of one another: a block of 26 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, 11 shared lines) · ×1
Near-duplicate member family (4 members, 11 shared lines) crates/vcad-kernel-raytrace/src/cpu.rs:81— crates/vcad-kernel-raytrace/src/cpu.rs:81-152 | crates/vcad-kernel-raytrace/src/cpu.rs:177-232 | crates/vcad-kernel-raytrace/src/cpu.rs:342-409 | crates/vcad-kernel-raytrace/src/cpu.rs:485-582 — These 4 members are variants of one another: a block of 11 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, 8 shared lines) · ×1
Near-duplicate member family (4 members, 8 shared lines) apple/VcadApp/Sources/VcadApp/Editor.swift:1206— apple/VcadApp/Sources/VcadApp/Editor.swift:1206-1218 | apple/VcadApp/Sources/VcadApp/Editor.swift:4681-4693 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1206-1218 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4681-4693 — These 4 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 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, 6 shared lines) · ×1
Near-duplicate member family (4 members, 6 shared lines) apple/VcadApp/Sources/VcadApp/Editor.swift:797— apple/VcadApp/Sources/VcadApp/Editor.swift:797-803 | apple/VcadApp/Sources/VcadApp/Sim.swift:59-65 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:797-803 | apple/VcadVision/Sources/VcadVision/Shared/Sim.swift:59-65 — These 4 members are variants of one another: a block of 6 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, 23 shared lines) · ×1
Near-duplicate member family (3 members, 23 shared lines) crates/vcad-kernel-diff/src/adjoint.rs:269— crates/vcad-kernel-diff/src/adjoint.rs:269-391 | crates/vcad-kernel-diff/src/seam.rs:366-461 | crates/vcad-kernel-diff/src/second_order.rs:172-282 — These 3 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 11 shared lines) · ×1
Near-duplicate member family (3 members, 11 shared lines) crates/vcad-kernel-booleans/src/mesh/mod.rs:97— crates/vcad-kernel-booleans/src/mesh/mod.rs:97-170 | crates/vcad-kernel-drafting/src/section.rs:119-152 | crates/vcad-kernel-shell/src/lib.rs:1253-1327 — These 3 members are variants of one another: a block of 11 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 (112 shared lines) crates/vcad-kernel-cam/src/post/grbl.rs:112— crates/vcad-kernel-cam/src/post/grbl.rs:112-258 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:164-324 — These two members are variants of one another: 112 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) packages/training/src/lambda/distill_lambda.py:91— packages/training/src/lambda/distill_lambda.py:91-415 | packages/training/src/modal/distill.py:83-425 — 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 (65 shared lines) crates/vcad-kernel-em/src/axisym.rs:658— crates/vcad-kernel-em/src/axisym.rs:658-751 | crates/vcad-kernel-em/src/planar.rs:562-656 — These two members are variants of one another: 65 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) crates/vcad-kernel-primitives/src/lib.rs:429— crates/vcad-kernel-primitives/src/lib.rs:429-516 | crates/vcad-kernel-primitives/src/lib.rs:594-716 — 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) crates/vcad-render/src/animate.rs:550— crates/vcad-render/src/animate.rs:550-636 | crates/vcad-render/src/animate.rs:654-735 — 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 (45 shared lines) crates/vcad-kernel-wasm/src/lib.rs:8259— crates/vcad-kernel-wasm/src/lib.rs:8259-8312 | crates/vcad-kernel-wasm/src/lib.rs:8451-8502 — 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 (43 shared lines) crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:51— crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:51-139 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:126-219 — These two members are variants of one another: 43 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 (42 shared lines) crates/vcad-ecad-pcb/src/router/length_match.rs:231— crates/vcad-ecad-pcb/src/router/length_match.rs:231-342 | crates/vcad-ecad-pcb/src/router/length_match.rs:708-869 — These two members are variants of one another: 42 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 (39 shared lines) apple/VcadApp/Sources/VcadApp/Document.swift:560— apple/VcadApp/Sources/VcadApp/Document.swift:560-625 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:560-625 — These two members are variants of one another: 39 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) crates/vcad-kernel-particle/src/poisson.rs:173— crates/vcad-kernel-particle/src/poisson.rs:173-306 | crates/vcad-kernel-particle/src/space_charge.rs:168-228 — 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 (28 shared lines) crates/vcad-kernel-fea/src/buckling.rs:459— crates/vcad-kernel-fea/src/buckling.rs:459-507 | crates/vcad-kernel-fea/src/modal.rs:142-268 — These two members are variants of one another: 28 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 (25 shared lines) crates/vcad-kernel-particle/src/wire3d.rs:593— crates/vcad-kernel-particle/src/wire3d.rs:593-633 | crates/vcad-kernel-tessellate/src/clearance.rs:450-494 — These two members are variants of one another: 25 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 (23 shared lines) crates/vcad-kernel-acoustics/src/instrument.rs:491— crates/vcad-kernel-acoustics/src/instrument.rs:491-541 | crates/vcad-kernel-fea/src/modal.rs:310-366 — These two members are variants of one another: 23 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 (22 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (22 members, 50+ identical tokens) crates/vcad-app/src/camera.rs:84— crates/vcad-app/src/camera.rs:84-119 | crates/vcad-atoms/src/optimize.rs:612-719 | crates/vcad-cli/src/main.rs:2442-2525 | crates/vcad-kernel-cam/src/dropcutter/mesh_accel.rs:20-50 | crates/vcad-kernel-export/src/lib.rs:651-701 | crates/vcad-kernel-tessellate/src/creased_normals.rs:172-229 | crates/vcad-kernel-tessellate/src/creased_normals.rs:239-248 | crates/vcad-kernel-tessellate/src/lib.rs:312-432 | crates/vcad-kernel-tessellate/src/lib.rs:704-746 | crates/vcad-kernel-tessellate/src/lib.rs:1384-1425 | crates/vcad-kernel-tessellate/src/lib.rs:1432-1721 | crates/vcad-kernel-tessellate/src/lib.rs:1787-1968 | crates/vcad-kernel-tessellate/src/lib.rs:2185-2484 | crates/vcad-kernel-tessellate/src/lib.rs:8773-8893 | crates/vcad-kernel-tessellate/src/lib.rs:8901-8973 | crates/vcad-kernel-tessellate/src/manifold.rs:177-186 | crates/vcad-kernel-tessellate/src/manifold.rs:631-667 | crates/vcad-kernel-tessellate/src/mesh_props.rs:44-129 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:54-128 | crates/vcad-kernel-topopt/src/extract.rs:228-264 | crates/vcad-mcp/src/tools/core.rs:307-377 | crates/vcad-mcp/src/tools/core.rs:379-409 — These 22 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 22 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 22 times.
D4 · Code Duplication· Members sharing a duplicated core (17 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (17 members, 50+ identical tokens) crates/vcad-eval/src/sim_extract/em.rs:433— crates/vcad-eval/src/sim_extract/em.rs:433-447 | crates/vcad-eval/src/thermal_extract.rs:615-623 | crates/vcad-ffi/src/print.rs:358-379 | crates/vcad-ffi/src/sheet_metal.rs:160-178 | crates/vcad-kernel-booleans/src/mesh/csg.rs:916-937 | crates/vcad-kernel-booleans/src/validate.rs:30-44 | crates/vcad-kernel-diff/src/mass.rs:54-116 | crates/vcad-kernel-fea/src/mesh.rs:67-70 | crates/vcad-kernel-fea/src/solve.rs:532-535 | crates/vcad-kernel-tessellate/src/lib.rs:922-938 | crates/vcad-kernel-tessellate/src/manifold.rs:189-201 | crates/vcad-kernel-tessellate/src/mesh_props.rs:44-129 | crates/vcad-kernel/src/lib.rs:2993-3010 | crates/vcad-kernel/src/lib.rs:3048-3114 | crates/vcad-render/src/report.rs:307-336 | crates/vcad-typst/src/lib.rs:270-320 | docs/videos/every-physics/poc/src/main.rs:46-64 — These 17 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 17 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 17 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) crates/vcad-ecad-fabprep/src/verdict.rs:112— crates/vcad-ecad-fabprep/src/verdict.rs:112-301 | crates/vcad-ecad-pcb/src/copper_pour.rs:163-265 | crates/vcad-ecad-pcb/src/drc.rs:257-299 | crates/vcad-ecad-pcb/src/drc.rs:1536-1552 | crates/vcad-ecad-pcb/src/pour_synth.rs:309-520 | crates/vcad-ecad-pcb/src/pour_synth.rs:639-661 | crates/vcad-ecad-pcb/src/router/auto.rs:1591-1966 | crates/vcad-ecad-pcb/src/router/complete.rs:443-1266 | crates/vcad-ecad-pcb/src/router/complete.rs:1624-1695 | crates/vcad-ecad-pcb/src/router/congestion.rs:143-153 | crates/vcad-ecad-pcb/src/router/legalize.rs:719-740 | crates/vcad-ecad-pcb/src/router/maze.rs:1442-1452 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/vcad-kernel-tessellate/src/lib.rs:2840— crates/vcad-kernel-tessellate/src/lib.rs:2840-2897 | crates/vcad-kernel-tessellate/src/lib.rs:4192-4623 | crates/vcad-kernel-tessellate/src/lib.rs:4635-4734 | crates/vcad-kernel-tessellate/src/lib.rs:4757-5053 | crates/vcad-kernel-tessellate/src/lib.rs:5145-5300 | crates/vcad-kernel-tessellate/src/lib.rs:6329-6526 | crates/vcad-kernel-tessellate/src/lib.rs:6540-6704 | crates/vcad-kernel-tessellate/src/lib.rs:6854-7116 | crates/vcad-kernel-tessellate/src/lib.rs:7127-7349 | crates/vcad-kernel-tessellate/src/lib.rs:8108-8170 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/vcad-cli/src/app.rs:552— crates/vcad-cli/src/app.rs:552-587 | crates/vcad-cli/src/app.rs:590-625 | crates/vcad-cli/src/app.rs:628-664 | crates/vcad-cli/src/app.rs:667-704 | crates/vcad-cli/src/app.rs:707-742 | crates/vcad-cli/src/app.rs:745-783 | crates/vcad-cli/src/app.rs:786-824 | crates/vcad-cli/src/app.rs:827-868 — 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· Edited copy of a member (110 corresponding lines) · ×1
Edited copy of a member (110 corresponding lines) crates/vcad-kernel-primitives/src/lib.rs:37— crates/vcad-kernel-primitives/src/lib.rs:37-163 | crates/vcad-kernel-primitives/src/lib.rs:172-281 — These two members are one piece of code written twice and then edited apart: 110 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 (97 corresponding lines) · ×1
Edited copy of a member (97 corresponding lines) crates/vcad-kernel-em/src/ac.rs:129— crates/vcad-kernel-em/src/ac.rs:129-225 | crates/vcad-kernel-em/src/grid.rs:405-507 — 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 copies of one member (3 members, 49+ corresponding lines) · ×1
Edited copies of one member (3 members, 49+ corresponding lines) crates/vcad-eval/src/cavity_extract.rs:284— crates/vcad-eval/src/cavity_extract.rs:284-355 | crates/vcad-eval/src/sim_extract.rs:319-383 | crates/vcad-eval/src/thermal_extract.rs:542-590 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) crates/vcad-ecad-diff/src/design.rs:55— crates/vcad-ecad-diff/src/design.rs:55-123 | crates/vcad-kernel-constraints/src/symbolic.rs:70-136 — These two members are one piece of code written twice and then edited apart: 67 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 (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) crates/vcad-parts/src/vacuum/chambers.rs:220— crates/vcad-parts/src/vacuum/chambers.rs:220-270 | crates/vcad-parts/src/vacuum/chambers.rs:370-416 — These two members are one piece of code written twice and then edited apart: 47 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 (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) crates/vcad-kernel-em/src/ac.rs:243— crates/vcad-kernel-em/src/ac.rs:243-294 | crates/vcad-kernel-em/src/ac.rs:305-342 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 54+ corresponding lines) · ×1
Edited copies of one member (3 members, 54+ corresponding lines) crates/vcad-kernel-neutronics/src/receipt.rs:304— crates/vcad-kernel-neutronics/src/receipt.rs:304-357 | crates/vcad-kernel-particle/src/receipt.rs:377-440 | crates/vcad-kernel-tolerance/src/receipt.rs:286-343 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 54 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) crates/vcad-kernel-acoustics/src/receipt.rs:368— crates/vcad-kernel-acoustics/src/receipt.rs:368-411 | crates/vcad-kernel-particle/src/receipt.rs:519-560 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) crates/vcad-kernel-constraints/src/gpu.rs:56— crates/vcad-kernel-constraints/src/gpu.rs:56-101 | crates/vcad-kernel-constraints/src/gpu.rs:113-161 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) crates/vcad-cli/src/app.rs:439— crates/vcad-cli/src/app.rs:439-475 | crates/vcad-cli/src/app.rs:478-512 | crates/vcad-cli/src/app.rs:515-549 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) crates/vcad-kernel-acoustics/src/instrument.rs:1123— crates/vcad-kernel-acoustics/src/instrument.rs:1123-1163 | crates/vcad-kernel-acoustics/src/instrument.rs:1179-1222 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×1
Edited copies of one member (3 members, 34+ corresponding lines) crates/vcad-ir/src/lib.rs:1533— crates/vcad-ir/src/lib.rs:1533-1579 | crates/vcad-ir/src/lib.rs:1585-1631 | crates/vcad-ir/src/to_loon.rs:920-953 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) mecheval/graders/src/fillets.rs:46— mecheval/graders/src/fillets.rs:46-80 | mecheval/graders/src/holes.rs:64-106 — 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 copies of one member (3 members, 51+ corresponding lines) · ×1
Edited copies of one member (3 members, 51+ corresponding lines) crates/vcad-ecad-pcb/src/dfm.rs:575— crates/vcad-ecad-pcb/src/dfm.rs:575-625 | crates/vcad-ecad-pcb/src/dfm.rs:697-754 | crates/vcad-ecad-pcb/src/dfm.rs:756-811 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 51 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) crates/vcad-kernel-drafting/src/edge_extract.rs:146— crates/vcad-kernel-drafting/src/edge_extract.rs:146-179 | crates/vcad-kernel-drafting/src/edge_extract.rs:231-275 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:1232— crates/vcad-kernel-wasm/src/lib.rs:1232-1252 | crates/vcad-kernel-wasm/src/lib.rs:1264-1280 | crates/vcad-kernel-wasm/src/lib.rs:1291-1310 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 29+ corresponding lines) · ×1
Edited copies of one member (4 members, 29+ corresponding lines) crates/vcad-kernel-raytrace/src/intersect/cone.rs:88— crates/vcad-kernel-raytrace/src/intersect/cone.rs:88-116 | crates/vcad-kernel-raytrace/src/intersect/sphere.rs:50-78 | crates/vcad-kernel-raytrace/src/trim.rs:804-832 | crates/vcad-kernel-raytrace/src/trim.rs:837-866 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×1
Edited copies of one member (4 members, 20+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:402— crates/vcad-kernel-geom/src/lib.rs:402-421 | crates/vcad-kernel-geom/src/lib.rs:585-604 | crates/vcad-kernel-geom/src/lib.rs:756-775 | crates/vcad-kernel-geom/src/lib.rs:944-964 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) crates/vcad-ecad-pcb/src/dfm.rs:489— crates/vcad-ecad-pcb/src/dfm.rs:489-499 | crates/vcad-ecad-pcb/src/router/congestion.rs:130-141 | crates/vcad-kernel-booleans/src/split.rs:2550-2562 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 26+ corresponding lines) · ×1
Edited copies of one member (6 members, 26+ corresponding lines) crates/vcad-kernel-acoustics/src/receipt.rs:333— crates/vcad-kernel-acoustics/src/receipt.rs:333-360 | crates/vcad-kernel-antenna/src/receipt.rs:463-495 | crates/vcad-kernel-fea/src/receipt.rs:255-280 | crates/vcad-kernel-neutronics/src/receipt.rs:384-411 | crates/vcad-kernel-optics/src/receipt.rs:248-278 | crates/vcad-kernel-photonics/src/receipt.rs:306-335 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) crates/vcad-kernel-cam/src/dropcutter/ball.rs:23— crates/vcad-kernel-cam/src/dropcutter/ball.rs:23-49 | crates/vcad-kernel-cam/src/dropcutter/bull.rs:29-62 | crates/vcad-kernel-cam/src/dropcutter/flat.rs:22-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:5949— crates/vcad-kernel-wasm/src/lib.rs:5949-5961 | crates/vcad-kernel-wasm/src/lib.rs:5983-5995 | crates/vcad-kernel-wasm/src/lib.rs:6016-6028 | crates/vcad-kernel-wasm/src/lib.rs:6059-6077 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) apple/VcadApp/Sources/VcadApp/GizmoView.swift:44— apple/VcadApp/Sources/VcadApp/GizmoView.swift:44-55 | apple/VcadApp/Sources/VcadApp/SceneAssets.swift:46-55 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:46-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) crates/vcad-ffi/src/instrument.rs:151— crates/vcad-ffi/src/instrument.rs:151-168 | crates/vcad-ffi/src/print.rs:458-479 | crates/vcad-ffi/src/sound.rs:168-185 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) crates/vcad-kernel-cost/src/lib.rs:375— crates/vcad-kernel-cost/src/lib.rs:375-413 | crates/vcad-kernel-cost/src/lib.rs:418-445 | crates/vcad-kernel-cost/src/lib.rs:453-480 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 7+ corresponding lines) · ×1
Edited copies of one member (6 members, 7+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:785— crates/vcad-kernel-geom/src/lib.rs:785-793 | crates/vcad-kernel-geom/src/lib.rs:796-803 | crates/vcad-kernel-geom/src/lib.rs:814-820 | crates/vcad-kernel-geom/src/lib.rs:974-982 | crates/vcad-kernel-geom/src/lib.rs:985-991 | crates/vcad-kernel-geom/src/lib.rs:1003-1010 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) crates/vcad-kernel-step/src/entities/topology.rs:124— crates/vcad-kernel-step/src/entities/topology.rs:124-144 | crates/vcad-kernel-step/src/entities/topology.rs:192-210 | crates/vcad-kernel-step/src/entities/topology.rs:213-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) crates/vcad-kernel-wasm/src/lib.rs:7799— crates/vcad-kernel-wasm/src/lib.rs:7799-7805 | crates/vcad-kernel-wasm/src/lib.rs:7812-7818 | crates/vcad-kernel-wasm/src/lib.rs:7843-7851 | crates/vcad-kernel-wasm/src/lib.rs:7863-7876 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×1
Edited copies of one member (5 members, 13+ corresponding lines) crates/vcad-kernel-step/src/entities/curves.rs:110— crates/vcad-kernel-step/src/entities/curves.rs:110-130 | crates/vcad-kernel-step/src/entities/geometry.rs:59-71 | crates/vcad-kernel-step/src/entities/surfaces.rs:131-150 | crates/vcad-kernel-step/src/entities/surfaces.rs:190-209 | crates/vcad-kernel-step/src/entities/surfaces.rs:214-235 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 23+ corresponding lines) · ×1
Edited copies of one member (8 members, 23+ corresponding lines) crates/vcad-slicer-gcode/src/printer.rs:58— crates/vcad-slicer-gcode/src/printer.rs:58-80 | crates/vcad-slicer-gcode/src/printer.rs:83-105 | crates/vcad-slicer-gcode/src/printer.rs:108-130 | crates/vcad-slicer-gcode/src/printer.rs:133-155 | crates/vcad-slicer-gcode/src/printer.rs:158-180 | crates/vcad-slicer-gcode/src/printer.rs:183-205 | crates/vcad-slicer-gcode/src/printer.rs:208-230 | crates/vcad-slicer-gcode/src/printer.rs:233-255 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 16+ corresponding lines) · ×1
Edited copies of one member (5 members, 16+ corresponding lines) crates/vcad-ffi/src/gym.rs:1212— crates/vcad-ffi/src/gym.rs:1212-1227 | crates/vcad-ffi/src/lib.rs:789-806 | crates/vcad-ffi/src/lib.rs:885-902 | crates/vcad-ffi/src/lib.rs:911-928 | crates/vcad-ffi/src/train.rs:913-934 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:208— crates/vcad-kernel-geom/src/lib.rs:208-224 | crates/vcad-kernel-geom/src/lib.rs:385-399 | crates/vcad-kernel-geom/src/lib.rs:926-941 | crates/vcad-kernel-geom/src/lib.rs:1458-1474 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:319— apple/VcadApp/Sources/VcadApp/DirectManipulation.swift:319-327 | apple/VcadApp/Sources/VcadApp/Document.swift:841-849 | apple/VcadApp/Sources/VcadApp/Document.swift:850-857 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:841-849 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:850-857 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) apple/VcadApp/Sources/VcadApp/Document.swift:665— apple/VcadApp/Sources/VcadApp/Document.swift:665-669 | apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:77-81 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:665-669 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:492— crates/vcad-kernel-geom/src/lib.rs:492-503 | crates/vcad-kernel-geom/src/lib.rs:685-695 | crates/vcad-kernel-geom/src/lib.rs:856-867 | crates/vcad-kernel-geom/src/lib.rs:1046-1058 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) crates/vcad-ecad-package/src/derive.rs:99— crates/vcad-ecad-package/src/derive.rs:99-113 | crates/vcad-ecad-symbols/src/builtin.rs:13-27 | crates/vcad-ecad-symbols/src/footprint.rs:147-158 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) crates/vcad-kernel/src/lib.rs:2305— crates/vcad-kernel/src/lib.rs:2305-2314 | crates/vcad-kernel/src/lib.rs:2341-2354 | crates/vcad-kernel/src/lib.rs:2365-2374 | crates/vcad-kernel/src/lib.rs:2401-2414 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 9+ corresponding lines) · ×1
Edited copies of one member (6 members, 9+ corresponding lines) crates/vcad-kernel/src/lib.rs:502— crates/vcad-kernel/src/lib.rs:502-510 | crates/vcad-kernel/src/lib.rs:513-522 | crates/vcad-kernel/src/lib.rs:525-534 | crates/vcad-kernel/src/lib.rs:537-546 | crates/vcad-kernel/src/lib.rs:564-572 | crates/vcad-kernel/src/lib.rs:578-586 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 10+ corresponding lines) · ×1
Edited copies of one member (7 members, 10+ corresponding lines) crates/vcad-kernel/src/sheet_json.rs:287— crates/vcad-kernel/src/sheet_json.rs:287-296 | crates/vcad-kernel/src/sheet_json.rs:365-374 | crates/vcad-kernel/src/sheet_json.rs:439-448 | crates/vcad-kernel/src/sheet_json.rs:491-503 | crates/vcad-kernel/src/sheet_json.rs:535-547 | crates/vcad-kernel/src/sheet_json.rs:591-600 | crates/vcad-kernel/src/sheet_json.rs:1422-1431 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:1157— apple/VcadApp/Sources/VcadApp/GlassChrome.swift:1157-1159 | apple/VcadApp/Sources/VcadApp/Shell.swift:1061-1063 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:1061-1063 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) crates/vcad-ecad-pcb/src/router/flow/embed.rs:124— crates/vcad-ecad-pcb/src/router/flow/embed.rs:124-126 | crates/vcad-ecad-pcb/src/router/flow/flow.rs:364-366 | crates/vcad-ecad-pcb/src/router/flow/realize.rs:189-191 | crates/vcad-ecad-pcb/src/router/flow/route.rs:141-143 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 3+ corresponding lines) · ×1
Edited copies of one member (5 members, 3+ corresponding lines) crates/vcad-ecad-pcb/src/critique.rs:100— crates/vcad-ecad-pcb/src/critique.rs:100-102 | crates/vcad-ecad-pcb/src/router/auto.rs:5035-5037 | crates/vcad-ecad-pcb/src/router/escape.rs:181-183 | crates/vcad-ecad-pcb/src/router/si_claims.rs:121-123 | crates/vcad-ecad-pcb/src/teardrop.rs:185-187 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) crates/vcad-ecad-sim/src/circuit/receipt.rs:73— crates/vcad-ecad-sim/src/circuit/receipt.rs:73-81 | crates/vcad-kernel-flow/src/receipt.rs:88-96 | crates/vcad-kernel-particle/src/receipt.rs:102-111 | crates/vcad-kernel-tolerance/src/receipt.rs:103-112 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) crates/vcad-kernel-geom/src/lib.rs:242— crates/vcad-kernel-geom/src/lib.rs:242-245 | crates/vcad-kernel-sheet/src/flatten.rs:786-789 | crates/vcad-kernel-sketch/src/profile.rs:245-248 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (55–75 lines × 2) crates/vcad-kernel-sheet/src/font.rs:76— crates/vcad-kernel-sheet/src/font.rs:76-130 | crates/vcad-kernel-sheet/src/font.rs:165-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/font.rs:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-sheet/src/font.rs:240` calls `g` and `crates/vcad-kernel-sheet/src/font.rs:131` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (67–71 lines × 2) crates/vcad-kernel-acoustics/src/optimize.rs:70— crates/vcad-kernel-acoustics/src/optimize.rs:70-136 | crates/vcad-kernel-particle/src/optimize.rs:73-143 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-particle/src/optimize.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (64–69 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:8430— crates/vcad-kernel-tessellate/src/lib.rs:8430-8498 | crates/vcad-kernel-tessellate/src/lib.rs:8595-8658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:8430` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38–64 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5475— crates/vcad-kernel-booleans/src/split.rs:5475-5512 | crates/vcad-kernel-booleans/src/split.rs:5649-5712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:5475` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (55–63 lines × 2) crates/vcad-kernel-booleans/src/pipeline.rs:1821— crates/vcad-kernel-booleans/src/pipeline.rs:1821-1883 | crates/vcad-kernel-booleans/src/pipeline.rs:1887-1941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/pipeline.rs:1821` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (35–53 lines × 2) crates/vcad-kernel-sheet/src/font.rs:160— crates/vcad-kernel-sheet/src/font.rs:160-194 | crates/vcad-kernel-sheet/src/font.rs:338-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/font.rs:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (34–50 lines × 3) crates/vcad-kernel-sheet/src/font.rs:101— crates/vcad-kernel-sheet/src/font.rs:101-134 | crates/vcad-kernel-sheet/src/font.rs:190-239 | crates/vcad-kernel-sheet/src/font.rs:266-314 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/font.rs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (43–50 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:6473— crates/vcad-kernel-tessellate/src/lib.rs:6473-6522 | crates/vcad-kernel-tessellate/src/lib.rs:6745-6787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:6473` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-tessellate/src/lib.rs:6524` calls `align_winding_to_normals` and `crates/vcad-kernel-tessellate/src/lib.rs:6789` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (32–49 lines × 4) crates/vcad-kernel-sheet/src/font.rs:55— crates/vcad-kernel-sheet/src/font.rs:55-92 | crates/vcad-kernel-sheet/src/font.rs:102-133 | crates/vcad-kernel-sheet/src/font.rs:191-239 | crates/vcad-kernel-sheet/src/font.rs:266-305 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sheet/src/font.rs:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (40–44 lines × 2) crates/vcad-ecad-diff/src/design.rs:81— crates/vcad-ecad-diff/src/design.rs:81-120 | crates/vcad-kernel-constraints/src/symbolic.rs:91-134 — before extracting anything, compare `crates/vcad-ecad-diff/src/design.rs` and `crates/vcad-kernel-constraints/src/symbolic.rs` as WHOLE FILES: this scan already matched 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-diff/src/design.rs:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38 lines × 2) crates/vcad-cli/src/ui/chat.rs:167— crates/vcad-cli/src/ui/chat.rs:167-204 | crates/vcad-cli/src/ui/command.rs:44-81 — before extracting anything, compare `crates/vcad-cli/src/ui/chat.rs` and `crates/vcad-cli/src/ui/command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/ui/chat.rs:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (36–37 lines × 4) crates/vcad-cli/src/ui/chat.rs:184— crates/vcad-cli/src/ui/chat.rs:184-220 | crates/vcad-cli/src/ui/command.rs:61-97 | crates/vcad-cli/src/ui/menu.rs:420-455 | crates/vcad-cli/src/ui/tree.rs:61-97 — before extracting anything, compare `crates/vcad-cli/src/ui/chat.rs` and `crates/vcad-cli/src/ui/command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 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 × 4) crates/vcad-kernel-acoustics/src/receipt.rs:271— crates/vcad-kernel-acoustics/src/receipt.rs:271-307 | crates/vcad-kernel-em/src/receipt.rs:380-416 | crates/vcad-kernel-flow/src/receipt.rs:294-330 | crates/vcad-kernel-thermal/src/receipt.rs:434-470 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-em/src/receipt.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (35–36 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:5253— crates/vcad-kernel-tessellate/src/lib.rs:5253-5288 | crates/vcad-kernel-tessellate/src/lib.rs:6191-6225 — both copies are in the same file, so extract the block into 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–35 lines × 2) crates/vcad-embroidery-pes/src/pec.rs:128— crates/vcad-embroidery-pes/src/pec.rs:128-162 | crates/vcad-embroidery-pes/src/pec.rs:165-196 — both copies are in the same file, so extract the block into 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–34 lines × 2) crates/vcad-kernel-booleans/src/repair.rs:93— crates/vcad-kernel-booleans/src/repair.rs:93-116 | crates/vcad-kernel-booleans/src/sew.rs:468-501 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/repair.rs:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29–31 lines × 2) crates/vcad-ecad-sim/src/circuit/ac.rs:135— crates/vcad-ecad-sim/src/circuit/ac.rs:135-163 | crates/vcad-ecad-sim/src/circuit/linalg.rs:14-44 — before extracting anything, compare `crates/vcad-ecad-sim/src/circuit/ac.rs` and `crates/vcad-ecad-sim/src/circuit/linalg.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-sim/src/circuit/ac.rs:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&mut [Cplx]` in one and `&mut [f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (26–31 lines × 2) crates/vcad-kernel-sketch/src/extrude.rs:328— crates/vcad-kernel-sketch/src/extrude.rs:328-358 | crates/vcad-kernel-sketch/src/extrude.rs:714-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28–30 lines × 2) crates/vcad-kernel-cam/src/operation/roughing3d.rs:198— crates/vcad-kernel-cam/src/operation/roughing3d.rs:198-227 | crates/vcad-kernel-cam/src/operation/roughing3d.rs:251-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/operation/roughing3d.rs:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (44–45 lines × 3) crates/vcad-kernel-primitives/src/lib.rs:119— crates/vcad-kernel-primitives/src/lib.rs:119-163 | crates/vcad-kernel-primitives/src/lib.rs:238-281 | crates/vcad-kernel-primitives/src/lib.rs:375-418 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-primitives/src/lib.rs:119` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–29 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:2865— crates/vcad-kernel-tessellate/src/lib.rs:2865-2892 | crates/vcad-kernel-tessellate/src/lib.rs:8142-8170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:2865` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26–27 lines × 2) mecheval/graders/src/suite_c.rs:196— mecheval/graders/src/suite_c.rs:196-221 | mecheval/graders/src/suite_c.rs:327-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mecheval/graders/src/suite_c.rs:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–25 lines × 4) crates/vcad-kernel-physics/src/colliders.rs:153— crates/vcad-kernel-physics/src/colliders.rs:153-156 | crates/vcad-kernel-physics/src/world.rs:471-473 | mecheval/graders/src/fit_physics.rs:561-585 | mecheval/graders/src/fit_physics.rs:603-627 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-physics/src/colliders.rs:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24 lines × 4) crates/vcad-kernel-acoustics/src/optimize.rs:118— crates/vcad-kernel-acoustics/src/optimize.rs:118-141 | crates/vcad-kernel-optics/src/optimize.rs:143-166 | crates/vcad-kernel-particle/src/optimize.rs:125-148 | crates/vcad-kernel-particle/src/optimize.rs:203-226 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-optics/src/optimize.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/optimize.rs:118` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–24 lines × 2) crates/vcad-kernel-booleans/src/freeze.rs:250— crates/vcad-kernel-booleans/src/freeze.rs:250-273 | crates/vcad-kernel-booleans/src/freeze.rs:490-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/freeze.rs:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–25 lines × 2) crates/vcad-kernel-em/src/axisym.rs:709— crates/vcad-kernel-em/src/axisym.rs:709-733 | crates/vcad-kernel-em/src/planar.rs:616-638 — before extracting anything, compare `crates/vcad-kernel-em/src/axisym.rs` and `crates/vcad-kernel-em/src/planar.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:709` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) crates/vcad-kernel-fea/src/section.rs:537— crates/vcad-kernel-fea/src/section.rs:537-560 | crates/vcad-kernel-fea/src/spec.rs:122-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fea/src/section.rs:537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–23 lines × 2) crates/vcad-kernel-booleans/src/split.rs:5089— crates/vcad-kernel-booleans/src/split.rs:5089-5108 | crates/vcad-kernel-booleans/src/split.rs:6307-6329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:5089` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22–23 lines × 2) crates/vcad-kernel-tessellate/src/clearance.rs:619— crates/vcad-kernel-tessellate/src/clearance.rs:619-641 | crates/vcad-kernel-tessellate/src/clearance.rs:694-715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/clearance.rs:619` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 3) crates/vcad-app/src/evaluate.rs:360— crates/vcad-app/src/evaluate.rs:360-381 | crates/vcad-eval/src/evaluate.rs:2772-2793 | crates/vcad-kernel-wasm/src/lib.rs:8767-8788 — before extracting anything, compare `crates/vcad-app/src/evaluate.rs` and `crates/vcad-eval/src/evaluate.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (4–22 lines × 4) crates/vcad-kernel-fillet/src/chamfer.rs:60— crates/vcad-kernel-fillet/src/chamfer.rs:60-81 | crates/vcad-kernel-fillet/src/fillet_curved.rs:216-237 | crates/vcad-kernel-fillet/src/fillet_planar.rs:96-117 | crates/vcad-kernel-fillet/src/trim.rs:311-314 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_curved.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/chamfer.rs:60` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-fillet/src/chamfer.rs:60` calls `quantize` and `crates/vcad-kernel-fillet/src/trim.rs:311` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–22 lines × 3) crates/vcad-kernel-primitives/src/lib.rs:485— crates/vcad-kernel-primitives/src/lib.rs:485-506 | crates/vcad-kernel-primitives/src/lib.rs:680-695 | crates/vcad-kernel-sketch/src/extrude.rs:507-526 — before extracting anything, compare `crates/vcad-kernel-primitives/src/lib.rs` and `crates/vcad-kernel-sketch/src/extrude.rs` as WHOLE FILES: this scan already matched 3 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. 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–24 lines × 4) crates/vcad-kernel-cam/src/operation.rs:252— crates/vcad-kernel-cam/src/operation.rs:252-275 | crates/vcad-kernel-cam/src/operation/contour.rs:296-318 | crates/vcad-kernel-wasm/src/lib.rs:8273-8287 | crates/vcad-kernel-wasm/src/lib.rs:8465-8478 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/operation.rs:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21–22 lines × 2) crates/vcad-kernel-fillet/src/fillet_curved.rs:296— crates/vcad-kernel-fillet/src/fillet_curved.rs:296-317 | crates/vcad-kernel-fillet/src/fillet_curved.rs:326-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/fillet_curved.rs:296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–21 lines × 3) crates/vcad-ffi/src/lib.rs:1585— crates/vcad-ffi/src/lib.rs:1585-1605 | crates/vcad-ffi/src/lib.rs:1616-1636 | crates/vcad-ffi/src/lib.rs:1638-1657 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ffi/src/lib.rs:1585` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–21 lines × 4) crates/vcad-kernel-cam/src/post/grbl.rs:124— crates/vcad-kernel-cam/src/post/grbl.rs:124-144 | crates/vcad-kernel-cam/src/post/grbl.rs:145-148 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:176-196 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:197-200 — before extracting anything, compare `crates/vcad-kernel-cam/src/post/grbl.rs` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/post/grbl.rs:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–20 lines × 2) crates/vcad-app/src/engine.rs:250— crates/vcad-app/src/engine.rs:250-267 | crates/vcad-cli/src/app.rs:840-859 — before extracting anything, compare `crates/vcad-app/src/engine.rs` and `crates/vcad-cli/src/app.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (54–57 lines × 2) crates/vcad-kernel-flow/src/adjoint.rs:460— crates/vcad-kernel-flow/src/adjoint.rs:460-516 | crates/vcad-kernel-flow/src/adjoint.rs:593-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 (19 lines × 3) crates/vcad-kernel-sketch/src/extrude.rs:347— crates/vcad-kernel-sketch/src/extrude.rs:347-365 | crates/vcad-kernel-sketch/src/extrude.rs:1243-1261 | crates/vcad-kernel-sweep/src/sweep.rs:318-336 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/sweep.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 3) crates/vcad-app/src/evaluate.rs:337— crates/vcad-app/src/evaluate.rs:337-354 | crates/vcad-eval/src/evaluate.rs:2748-2766 | crates/vcad-kernel-wasm/src/lib.rs:8724-8741 — before extracting anything, compare `crates/vcad-app/src/evaluate.rs` and `crates/vcad-eval/src/evaluate.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 3) crates/vcad-ffi/src/lib.rs:405— crates/vcad-ffi/src/lib.rs:405-422 | crates/vcad-ffi/src/lib.rs:3481-3498 | crates/vcad-ffi/src/session.rs:96-113 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-ffi/src/lib.rs:404` calls `catch_unwind`, `AssertUnwindSafe` and `crates/vcad-ffi/src/lib.rs:3480` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–18 lines × 2) crates/vcad-ir/src/vcode.rs:176— crates/vcad-ir/src/vcode.rs:176-193 | crates/vcad-ir/src/vcode.rs:227-239 — both copies are in the same file, so extract the block into 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) crates/vcad-kernel-nurbs/src/lib.rs:212— crates/vcad-kernel-nurbs/src/lib.rs:212-229 | crates/vcad-kernel-nurbs/src/lib.rs:683-698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-nurbs/src/lib.rs:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–18 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:6278— crates/vcad-kernel-tessellate/src/lib.rs:6278-6295 | crates/vcad-kernel-tessellate/src/lib.rs:6306-6319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:6278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–18 lines × 4) crates/vcad-loon/src/convert.rs:64— crates/vcad-loon/src/convert.rs:64-81 | crates/vcad-loon/src/convert.rs:237-253 | crates/vcad-loon/src/convert.rs:437-440 | crates/vcad-loon/src/convert.rs:704-707 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-loon/src/convert.rs:64` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 5) crates/vcad-kernel-flow/src/adjoint.rs:245— crates/vcad-kernel-flow/src/adjoint.rs:245-261 | crates/vcad-kernel-flow/src/adjoint.rs:474-490 | crates/vcad-kernel-flow/src/adjoint.rs:607-623 | crates/vcad-kernel-flow/src/solve.rs:381-397 | crates/vcad-kernel-flow/src/solve.rs:446-462 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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 (9–17 lines × 4) crates/vcad-kernel-primitives/src/lib.rs:488— crates/vcad-kernel-primitives/src/lib.rs:488-504 | crates/vcad-kernel-primitives/src/lib.rs:639-647 | crates/vcad-kernel-primitives/src/lib.rs:683-694 | crates/vcad-kernel-sketch/src/extrude.rs:509-525 — before extracting anything, compare `crates/vcad-kernel-primitives/src/lib.rs` and `crates/vcad-kernel-sketch/src/extrude.rs` as WHOLE FILES: this scan already matched 3 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. 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–17 lines × 2) crates/termview/src/braille.rs:23— crates/termview/src/braille.rs:23-39 | crates/vcad-cli/src/ui/viewport.rs:48-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/termview/src/braille.rs:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 2) crates/vcad-kernel-flow/src/adjoint.rs:130— crates/vcad-kernel-flow/src/adjoint.rs:130-144 | crates/vcad-kernel-flow/src/solve.rs:173-189 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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 (9–17 lines × 2) crates/vcad-kernel-primitives/src/lib.rs:554— crates/vcad-kernel-primitives/src/lib.rs:554-570 | crates/vcad-kernel-primitives/src/lib.rs:747-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 (11–17 lines × 2) crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:61— crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:61-77 | crates/vcad-kernel-raytrace/src/trim.rs:785-795 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-raytrace/src/intersect/cylinder.rs:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 5) crates/vcad-cli/src/app.rs:555— crates/vcad-cli/src/app.rs:555-570 | crates/vcad-cli/src/app.rs:593-608 | crates/vcad-cli/src/app.rs:631-646 | crates/vcad-cli/src/app.rs:670-685 | crates/vcad-cli/src/app.rs:710-725 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 3) crates/vcad-cli/src/app.rs:457— crates/vcad-cli/src/app.rs:457-472 | crates/vcad-cli/src/app.rs:495-509 | crates/vcad-cli/src/app.rs:532-546 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:457` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–16 lines × 3) crates/vcad-kernel-fillet/src/fillet_curved.rs:266— crates/vcad-kernel-fillet/src/fillet_curved.rs:266-281 | crates/vcad-kernel-fillet/src/fillet_curved.rs:301-314 | crates/vcad-kernel-fillet/src/fillet_curved.rs:330-343 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/fillet_curved.rs:266` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–16 lines × 2) crates/vcad-kernel-booleans/src/split.rs:2989— crates/vcad-kernel-booleans/src/split.rs:2989-3004 | crates/vcad-kernel-booleans/src/split.rs:3028-3036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:2989` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–16 lines × 2) crates/vcad-kernel-tessellate/src/lib.rs:2537— crates/vcad-kernel-tessellate/src/lib.rs:2537-2552 | crates/vcad-kernel-tessellate/src/lib.rs:8385-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:2537` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–16 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:8737— crates/vcad-kernel-tessellate/src/lib.rs:8737-8740 | crates/vcad-kernel-tessellate/src/lib.rs:8855-8870 | crates/vcad-kernel-tessellate/src/lib.rs:8935-8950 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–15 lines × 6) crates/vcad-kernel-booleans/src/split.rs:1888— crates/vcad-kernel-booleans/src/split.rs:1888-1902 | crates/vcad-kernel-booleans/src/split.rs:5112-5123 | crates/vcad-kernel-booleans/src/split.rs:5376-5386 | crates/vcad-kernel-booleans/src/split.rs:5516-5527 | crates/vcad-kernel-booleans/src/split.rs:5719-5733 | crates/vcad-kernel-booleans/src/split.rs:6336-6350 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1888` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 5) crates/vcad-kernel-tessellate/src/lib.rs:1953— crates/vcad-kernel-tessellate/src/lib.rs:1953-1967 | crates/vcad-kernel-tessellate/src/lib.rs:8748-8762 | crates/vcad-kernel-tessellate/src/lib.rs:8877-8891 | crates/vcad-kernel-tessellate/src/lib.rs:8957-8971 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:505-519 — before extracting anything, compare `crates/vcad-kernel-tessellate/src/lib.rs` and `crates/vcad-kernel-tessellate/src/mesh_ray.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:1953` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) crates/vcad-app/src/evaluate.rs:313— crates/vcad-app/src/evaluate.rs:313-327 | crates/vcad-eval/src/evaluate.rs:3324-3338 | crates/vcad-kernel-wasm/src/lib.rs:8747-8761 — before extracting anything, compare `crates/vcad-app/src/evaluate.rs` and `crates/vcad-eval/src/evaluate.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10–15 lines × 3) crates/vcad-kernel-diff/src/adjoint.rs:356— crates/vcad-kernel-diff/src/adjoint.rs:356-365 | crates/vcad-kernel-diff/src/seam.rs:424-438 | crates/vcad-kernel-diff/src/second_order.rs:243-252 — before extracting anything, compare `crates/vcad-kernel-diff/src/adjoint.rs` and `crates/vcad-kernel-diff/src/seam.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/adjoint.rs:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) crates/vcad-kernel-wasm/src/lib.rs:2608— crates/vcad-kernel-wasm/src/lib.rs:2608-2622 | crates/vcad-kernel-wasm/src/lib.rs:2651-2665 | crates/vcad-kernel-wasm/src/lib.rs:2878-2891 — 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 × 2) crates/vcad-ecad-pcb/src/router/complete.rs:1311— crates/vcad-ecad-pcb/src/router/complete.rs:1311-1325 | crates/vcad-ecad-pcb/src/router/complete.rs:1356-1369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/complete.rs:1311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-pcb/src/router/complete.rs:1326` calls `insert` and `crates/vcad-ecad-pcb/src/router/complete.rs:1370` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–15 lines × 3) crates/vcad-kernel-booleans/src/mesh/mod.rs:154— crates/vcad-kernel-booleans/src/mesh/mod.rs:154-165 | crates/vcad-kernel-primitives/src/lib.rs:634-638 | crates/vcad-kernel-shell/src/lib.rs:1308-1322 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/mod.rs` and `crates/vcad-kernel-shell/src/lib.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/mod.rs:154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 7) crates/vcad-cli/src/app.rs:557— crates/vcad-cli/src/app.rs:557-570 | crates/vcad-cli/src/app.rs:595-608 | crates/vcad-cli/src/app.rs:633-646 | crates/vcad-cli/src/app.rs:672-685 | crates/vcad-cli/src/app.rs:712-725 | crates/vcad-cli/src/app.rs:749-762 | crates/vcad-cli/src/app.rs:790-803 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:557` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 3) crates/vcad-kernel-constraints/src/export.rs:199— crates/vcad-kernel-constraints/src/export.rs:199-212 | crates/vcad-kernel-sketch/src/extrude.rs:54-66 | crates/vcad-kernel-sketch/src/profile.rs:267-279 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-constraints/src/export.rs:199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–14 lines × 4) crates/vcad-kernel-fillet/src/fillet_curved.rs:710— crates/vcad-kernel-fillet/src/fillet_curved.rs:710-713 | crates/vcad-kernel-fillet/src/fillet_curved.rs:944-947 | crates/vcad-kernel-fillet/src/fillet_curved.rs:1159-1172 | crates/vcad-kernel-fillet/src/fillet_planar.rs:424-437 — before extracting anything, compare `crates/vcad-kernel-fillet/src/fillet_curved.rs` and `crates/vcad-kernel-fillet/src/fillet_planar.rs` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/fillet_curved.rs:1159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–13 lines × 11) crates/vcad-kernel-booleans/src/split.rs:1242— crates/vcad-kernel-booleans/src/split.rs:1242-1254 | crates/vcad-kernel-booleans/src/split.rs:1521-1529 | crates/vcad-kernel-booleans/src/split.rs:1577-1585 | crates/vcad-kernel-booleans/src/split.rs:1765-1775 | crates/vcad-kernel-booleans/src/split.rs:1793-1803 | crates/vcad-kernel-booleans/src/split.rs:1851-1861 | crates/vcad-kernel-booleans/src/split.rs:2181-2189 | crates/vcad-kernel-booleans/src/split.rs:3063-3071 | crates/vcad-kernel-booleans/src/split.rs:3077-3085 | crates/vcad-kernel-booleans/src/split.rs:3464-3472 | crates/vcad-kernel-booleans/src/split.rs:4679-4687 — 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 (6–13 lines × 7) crates/vcad-kernel-booleans/src/split.rs:1885— crates/vcad-kernel-booleans/src/split.rs:1885-1894 | crates/vcad-kernel-booleans/src/split.rs:5111-5117 | crates/vcad-kernel-booleans/src/split.rs:5375-5380 | crates/vcad-kernel-booleans/src/split.rs:5515-5521 | crates/vcad-kernel-booleans/src/split.rs:5716-5725 | crates/vcad-kernel-booleans/src/split.rs:6333-6342 | crates/vcad-kernel-booleans/src/split.rs:6863-6875 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1885` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 6) crates/vcad-kernel-flow/src/adjoint.rs:249— crates/vcad-kernel-flow/src/adjoint.rs:249-261 | crates/vcad-kernel-flow/src/adjoint.rs:478-490 | crates/vcad-kernel-flow/src/adjoint.rs:611-623 | crates/vcad-kernel-flow/src/solve.rs:385-397 | crates/vcad-kernel-flow/src/solve.rs:450-462 | crates/vcad-kernel-flow/src/solve.rs:636-648 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 3) crates/vcad-kernel-booleans/src/api.rs:835— crates/vcad-kernel-booleans/src/api.rs:835-852 | crates/vcad-kernel-booleans/src/pipeline.rs:2217-2233 | crates/vcad-kernel-booleans/src/validate.rs:109-126 — before extracting anything, compare `crates/vcad-kernel-booleans/src/api.rs` and `crates/vcad-kernel-booleans/src/validate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/api.rs:835` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:5260— crates/vcad-kernel-tessellate/src/lib.rs:5260-5271 | crates/vcad-kernel-tessellate/src/lib.rs:6076-6088 | crates/vcad-kernel-tessellate/src/lib.rs:6198-6209 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–13 lines × 3) crates/vcad-kernel-booleans/src/split.rs:349— crates/vcad-kernel-booleans/src/split.rs:349-351 | crates/vcad-kernel-booleans/src/split.rs:1362-1374 | crates/vcad-kernel-booleans/src/split.rs:2714-2726 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:1362` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–13 lines × 2) crates/vcad-kernel-em/src/axisym.rs:441— crates/vcad-kernel-em/src/axisym.rs:441-446 | crates/vcad-kernel-em/src/electro.rs:198-210 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-em/src/axisym.rs:441` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–13 lines × 3) crates/vcad-kernel-sketch/src/extrude.rs:230— crates/vcad-kernel-sketch/src/extrude.rs:230-242 | crates/vcad-kernel-sketch/src/extrude.rs:568-571 | crates/vcad-kernel-sketch/src/revolve.rs:117-129 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–13 lines × 2) crates/vcad-render/src/lib.rs:4443— crates/vcad-render/src/lib.rs:4443-4455 | crates/vcad-render/src/lib.rs:5555-5564 — both copies are in the same file, so extract the block into 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 × 4) crates/vcad-kernel-constraints/src/residual.rs:50— crates/vcad-kernel-constraints/src/residual.rs:50-58 | crates/vcad-kernel-constraints/src/residual.rs:67-75 | crates/vcad-kernel-constraints/src/residual.rs:103-114 | crates/vcad-kernel-constraints/src/residual.rs:254-262 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–14 lines × 3) crates/vcad-render/src/animate.rs:427— crates/vcad-render/src/animate.rs:427-440 | crates/vcad-render/src/animate.rs:625-636 | crates/vcad-render/src/animate.rs:724-735 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/animate.rs:427` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–11 lines × 9) crates/vcad-kernel-booleans/src/split.rs:834— crates/vcad-kernel-booleans/src/split.rs:834-844 | crates/vcad-kernel-booleans/src/split.rs:1882-1891 | crates/vcad-kernel-booleans/src/split.rs:3101-3110 | crates/vcad-kernel-booleans/src/split.rs:5109-5115 | crates/vcad-kernel-booleans/src/split.rs:5373-5379 | crates/vcad-kernel-booleans/src/split.rs:5513-5519 | crates/vcad-kernel-booleans/src/split.rs:5713-5722 | crates/vcad-kernel-booleans/src/split.rs:6330-6339 | crates/vcad-kernel-booleans/src/split.rs:6860-6869 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:834` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-booleans/src/split.rs:1897` calls `add_curve_3d`, `clone` and `crates/vcad-kernel-booleans/src/split.rs:849` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 8) crates/vcad-cli/src/app.rs:555— crates/vcad-cli/src/app.rs:555-565 | crates/vcad-cli/src/app.rs:593-603 | crates/vcad-cli/src/app.rs:631-641 | crates/vcad-cli/src/app.rs:670-680 | crates/vcad-cli/src/app.rs:710-720 | crates/vcad-cli/src/app.rs:747-757 | crates/vcad-cli/src/app.rs:788-798 | crates/vcad-cli/src/app.rs:829-839 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-cli/src/app.rs:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–11 lines × 5) crates/vcad-kernel-sketch/src/extrude.rs:978— crates/vcad-kernel-sketch/src/extrude.rs:978-984 | crates/vcad-kernel-sketch/src/extrude.rs:1293-1303 | crates/vcad-kernel-sketch/src/extrude.rs:1436-1446 | crates/vcad-kernel-sketch/src/revolve.rs:610-620 | crates/vcad-kernel-sweep/src/sweep.rs:370-380 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-sketch/src/extrude.rs:1304` calls `add_face` and `crates/vcad-kernel-sketch/src/extrude.rs:985` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 4) crates/vcad-loon/src/convert.rs:509— crates/vcad-loon/src/convert.rs:509-519 | crates/vcad-loon/src/convert.rs:536-546 | crates/vcad-loon/src/convert.rs:560-570 | crates/vcad-loon/src/convert.rs:579-589 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-loon/src/convert.rs:509` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-loon/src/convert.rs:506` calls `vec3`, `f64_val` and `crates/vcad-loon/src/convert.rs:559` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–11 lines × 3) crates/vcad-ecad-sim/src/circuit/ac.rs:154— crates/vcad-ecad-sim/src/circuit/ac.rs:154-163 | crates/vcad-ecad-sim/src/circuit/linalg.rs:34-44 | crates/vcad-kernel-antenna/src/linalg.rs:84-92 — before extracting anything, compare `crates/vcad-ecad-sim/src/circuit/ac.rs` and `crates/vcad-ecad-sim/src/circuit/linalg.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-sim/src/circuit/ac.rs:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&mut [Cplx]` in one and `&mut [f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7–11 lines × 3) crates/vcad-kernel-booleans/src/split.rs:1471— crates/vcad-kernel-booleans/src/split.rs:1471-1481 | crates/vcad-kernel-booleans/src/split.rs:1680-1688 | crates/vcad-kernel-booleans/src/split.rs:3982-3988 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/split.rs:3982` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–11 lines × 2) crates/vcad-ecad-pcb/src/router/flow/flow.rs:996— crates/vcad-ecad-pcb/src/router/flow/flow.rs:996-1006 | crates/vcad-ecad-pcb/src/router/flow/flow.rs:1051-1056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/router/flow/flow.rs:996` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26–28 lines × 2) crates/vcad-kernel-diff/src/seam.rs:377— crates/vcad-kernel-diff/src/seam.rs:377-402 | crates/vcad-kernel-diff/src/second_order.rs:186-213 — before extracting anything, compare `crates/vcad-kernel-diff/src/seam.rs` and `crates/vcad-kernel-diff/src/second_order.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-diff/src/seam.rs:377` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-diff/src/second_order.rs:214` calls `assemble_vertex_rows_second`, `solve_vertex_velocity` and `crates/vcad-kernel-diff/src/seam.rs:403` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–11 lines × 4) crates/vcad-kernel-qcd/src/analysis.rs:142— crates/vcad-kernel-qcd/src/analysis.rs:142-152 | crates/vcad-kernel-shell/src/lib.rs:951-953 | crates/vcad-kernel-tessellate/src/frozen.rs:730-732 | crates/vcad-render/src/callouts.rs:263-273 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-qcd/src/analysis.rs:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 8) crates/vcad-kernel-acoustics/src/receipt.rs:351— crates/vcad-kernel-acoustics/src/receipt.rs:351-360 | crates/vcad-kernel-antenna/src/receipt.rs:486-495 | crates/vcad-kernel-em/src/receipt.rs:469-478 | crates/vcad-kernel-fea/src/receipt.rs:271-280 | crates/vcad-kernel-flow/src/receipt.rs:387-396 | crates/vcad-kernel-optics/src/receipt.rs:269-278 | crates/vcad-kernel-orbit/src/receipt.rs:192-201 | crates/vcad-kernel-thermal/src/receipt.rs:623-632 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-antenna/src/receipt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:351` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 5) crates/vcad-kernel-acoustics/src/optimize.rs:58— crates/vcad-kernel-acoustics/src/optimize.rs:58-70 | crates/vcad-kernel-optics/src/optimize.rs:62-74 | crates/vcad-kernel-particle/src/optimize.rs:61-73 | crates/vcad-kernel-particle/src/optimize.rs:164-176 | crates/vcad-kernel-particle/src/optimize.rs:340-352 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/optimize.rs` and `crates/vcad-kernel-optics/src/optimize.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. 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 × 4) crates/vcad-kernel-cam/src/post/grbl.rs:128— crates/vcad-kernel-cam/src/post/grbl.rs:128-137 | crates/vcad-kernel-cam/src/post/grbl.rs:158-167 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:180-189 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:210-219 — before extracting anything, compare `crates/vcad-kernel-cam/src/post/grbl.rs` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/post/grbl.rs:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–10 lines × 4) crates/vcad-kernel-fillet/src/fillet_planar.rs:274— crates/vcad-kernel-fillet/src/fillet_planar.rs:274-276 | crates/vcad-kernel-sketch/src/extrude.rs:1328-1337 | crates/vcad-kernel-sweep/src/loft.rs:340-349 | crates/vcad-kernel-sweep/src/sweep.rs:419-428 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sweep/src/loft.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/fillet_planar.rs:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (1–10 lines × 8) crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:86— crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:86-86 | crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:87-96 | crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:97-98 | crates/vcad-kernel-raytrace/src/intersect/bilinear.rs:100-101 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:161-161 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:162-170 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:171-172 | crates/vcad-kernel-raytrace/src/intersect/bspline.rs:174-175 — before extracting anything, compare `crates/vcad-kernel-raytrace/src/intersect/bilinear.rs` and `crates/vcad-kernel-raytrace/src/intersect/bspline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (1–10 lines × 3) crates/vcad-render/src/lib.rs:2911— crates/vcad-render/src/lib.rs:2911-2911 | crates/vcad-render/src/lib.rs:4184-4193 | crates/vcad-render/src/lib.rs:4220-4225 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 5) crates/vcad-ecad-sim/src/circuit/adjoint.rs:179— crates/vcad-ecad-sim/src/circuit/adjoint.rs:179-186 | crates/vcad-ecad-sim/src/circuit/dc.rs:198-205 | crates/vcad-ecad-sim/src/circuit/devices.rs:582-589 | crates/vcad-ecad-sim/src/circuit/devices.rs:605-612 | crates/vcad-ecad-sim/src/circuit/transient_adjoint.rs:432-440 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 5) crates/vcad-kernel-tessellate/src/lib.rs:5277— crates/vcad-kernel-tessellate/src/lib.rs:5277-5285 | crates/vcad-kernel-tessellate/src/lib.rs:6094-6102 | crates/vcad-kernel-tessellate/src/lib.rs:6214-6222 | crates/vcad-kernel-tessellate/src/lib.rs:6513-6521 | crates/vcad-kernel-tessellate/src/lib.rs:6778-6786 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-tessellate/src/lib.rs:6524` calls `align_winding_to_normals` and `crates/vcad-kernel-tessellate/src/lib.rs:6104` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (2–9 lines × 7) crates/vcad-kernel-booleans/src/mesh/csg.rs:97— crates/vcad-kernel-booleans/src/mesh/csg.rs:97-99 | crates/vcad-kernel-fillet/src/fillet_planar.rs:270-272 | crates/vcad-kernel-shell/src/lib.rs:906-908 | crates/vcad-kernel-sketch/src/extrude.rs:1318-1326 | crates/vcad-kernel-sweep/src/loft.rs:330-338 | crates/vcad-kernel-sweep/src/sweep.rs:409-417 | crates/vcad-kernel-tessellate/src/lib.rs:2905-2906 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/csg.rs` and `crates/vcad-kernel-tessellate/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-booleans/src/mesh/csg.rs:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `verts` to `Vec<Point3>` in one and `&[Point3]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (4–9 lines × 3) crates/vcad-kernel-diff/src/adjoint.rs:366— crates/vcad-kernel-diff/src/adjoint.rs:366-369 | crates/vcad-kernel-diff/src/seam.rs:440-448 | crates/vcad-kernel-diff/src/second_order.rs:254-262 — before extracting anything, compare `crates/vcad-kernel-diff/src/adjoint.rs` and `crates/vcad-kernel-diff/src/seam.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–9 lines × 2) crates/vcad-kernel-flow/src/adjoint.rs:184— crates/vcad-kernel-flow/src/adjoint.rs:184-192 | crates/vcad-kernel-flow/src/solve.rs:301-306 — before extracting anything, compare `crates/vcad-kernel-flow/src/adjoint.rs` and `crates/vcad-kernel-flow/src/solve.rs` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–9 lines × 3) crates/vcad-render/src/callouts.rs:134— crates/vcad-render/src/callouts.rs:134-136 | crates/vcad-render/src/exact.rs:176-184 | crates/vcad-render/src/exact.rs:205-213 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/callouts.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 2) crates/vcad-render/src/photoreal.rs:800— crates/vcad-render/src/photoreal.rs:800-808 | crates/vcad-render/src/photoreal_gpu.rs:458-464 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-render/src/photoreal.rs:800` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 6) crates/vcad-kernel-sketch/src/extrude.rs:1302— crates/vcad-kernel-sketch/src/extrude.rs:1302-1308 | crates/vcad-kernel-sketch/src/extrude.rs:1445-1452 | crates/vcad-kernel-sketch/src/revolve.rs:568-573 | crates/vcad-kernel-sketch/src/revolve.rs:619-625 | crates/vcad-kernel-sweep/src/loft.rs:275-282 | crates/vcad-kernel-sweep/src/sweep.rs:379-386 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:1302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) crates/vcad-kernel-wasm/src/lib.rs:8856— crates/vcad-kernel-wasm/src/lib.rs:8856-8863 | crates/vcad-kernel-wasm/src/lib.rs:8983-8990 | crates/vcad-kernel-wasm/src/lib.rs:9181-9188 | crates/vcad-kernel-wasm/src/lib.rs:9335-9342 | crates/vcad-kernel-wasm/src/lib.rs:9653-9660 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-wasm/src/lib.rs:8856` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-kernel-wasm/src/lib.rs:9662` calls `resolve`, `map_err`, `to_string` and `crates/vcad-kernel-wasm/src/lib.rs:9343` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (1–8 lines × 4) crates/vcad-ecad-pcb/src/spatial.rs:315— crates/vcad-ecad-pcb/src/spatial.rs:315-315 | crates/vcad-kernel-drafting/src/section.rs:653-662 | crates/vcad-kernel-sketch/src/profile.rs:485-492 | crates/vcad-slicer/src/perimeter.rs:153-161 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/section.rs:653` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `&Point2D` in one and `Point2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6–8 lines × 3) crates/vcad-kernel-sketch/src/extrude.rs:233— crates/vcad-kernel-sketch/src/extrude.rs:233-240 | crates/vcad-kernel-sketch/src/revolve.rs:120-127 | crates/vcad-kernel-sweep/src/loft.rs:148-153 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-sketch/src/extrude.rs:233` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (41 lines × 2) crates/vcad-kernel-cam/src/post/grbl.rs:113— crates/vcad-kernel-cam/src/post/grbl.rs:113-153 | crates/vcad-kernel-cam/src/post/linuxcnc.rs:165-205 — before extracting anything, compare `crates/vcad-kernel-cam/src/post/grbl.rs` and `crates/vcad-kernel-cam/src/post/linuxcnc.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-cam/src/post/grbl.rs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5–8 lines × 3) crates/vcad-kernel-drafting/src/section.rs:85— crates/vcad-kernel-drafting/src/section.rs:85-92 | crates/vcad-kernel-drafting/src/section.rs:93-100 | crates/vcad-kernel-drafting/src/section.rs:101-105 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/section.rs:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–8 lines × 3) crates/vcad-kernel-qcd/src/analysis.rs:138— crates/vcad-kernel-qcd/src/analysis.rs:138-139 | crates/vcad-kernel-shell/src/lib.rs:941-948 | crates/vcad-render/src/callouts.rs:252-259 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-qcd/src/analysis.rs:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–8 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:5567— crates/vcad-kernel-tessellate/src/lib.rs:5567-5569 | crates/vcad-kernel-tessellate/src/lib.rs:5756-5763 | crates/vcad-kernel-tessellate/src/lib.rs:7856-7865 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5567` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–8 lines × 4) crates/vcad-kernel-booleans/src/validate.rs:37— crates/vcad-kernel-booleans/src/validate.rs:37-38 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:61-62 | crates/vcad-kernel/src/lib.rs:2996-3003 | crates/vcad-kernel/src/lib.rs:3062-3069 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel/src/lib.rs:2996` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 7) crates/vcad-kernel-sketch/src/extrude.rs:232— crates/vcad-kernel-sketch/src/extrude.rs:232-238 | crates/vcad-kernel-sketch/src/extrude.rs:558-564 | crates/vcad-kernel-sketch/src/extrude.rs:828-834 | crates/vcad-kernel-sketch/src/extrude.rs:1170-1176 | crates/vcad-kernel-sketch/src/revolve.rs:119-125 | crates/vcad-kernel-sweep/src/loft.rs:147-153 | crates/vcad-kernel-sweep/src/sweep.rs:163-169 — before extracting anything, compare `crates/vcad-kernel-sketch/src/extrude.rs` and `crates/vcad-kernel-sketch/src/revolve.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 × 4) crates/vcad-kernel-raytrace/src/cpu.rs:94— crates/vcad-kernel-raytrace/src/cpu.rs:94-99 | crates/vcad-kernel-raytrace/src/cpu.rs:183-189 | crates/vcad-kernel-raytrace/src/cpu.rs:356-361 | crates/vcad-kernel-raytrace/src/cpu.rs:511-516 — 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 × 2) crates/vcad-kernel-fillet/src/chamfer.rs:88— crates/vcad-kernel-fillet/src/chamfer.rs:88-102 | crates/vcad-kernel-fillet/src/fillet_planar.rs:124-135 — before extracting anything, compare `crates/vcad-kernel-fillet/src/chamfer.rs` and `crates/vcad-kernel-fillet/src/fillet_planar.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-fillet/src/chamfer.rs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 5) crates/vcad-kernel-fea/src/mesh.rs:164— crates/vcad-kernel-fea/src/mesh.rs:164-171 | crates/vcad-kernel-fea/src/mesh.rs:422-429 | crates/vcad-kernel-fea/src/mesh.rs:576-583 | crates/vcad-kernel-tessellate/src/clearance.rs:147-153 | crates/vcad-kernel-topopt/src/domain.rs:117-124 — before extracting anything, compare `crates/vcad-kernel-fea/src/mesh.rs` and `crates/vcad-kernel-topopt/src/domain.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–6 lines × 12) crates/vcad-ecad-fabprep/src/verdict.rs:185— crates/vcad-ecad-fabprep/src/verdict.rs:185-188 | crates/vcad-ecad-pcb/src/copper_pour.rs:173-176 | crates/vcad-ecad-pcb/src/drc.rs:287-290 | crates/vcad-ecad-pcb/src/drc.rs:1544-1548 | crates/vcad-ecad-pcb/src/pour_synth.rs:448-451 | crates/vcad-ecad-pcb/src/pour_synth.rs:645-648 | crates/vcad-ecad-pcb/src/router/auto.rs:1651-1654 | crates/vcad-ecad-pcb/src/router/complete.rs:1137-1140 | crates/vcad-ecad-pcb/src/router/complete.rs:1638-1641 | crates/vcad-ecad-pcb/src/router/congestion.rs:148-153 | crates/vcad-ecad-pcb/src/router/legalize.rs:723-726 | crates/vcad-ecad-pcb/src/router/maze.rs:1447-1452 — before extracting anything, compare `crates/vcad-ecad-pcb/src/router/complete.rs` and `crates/vcad-ecad-pcb/src/router/maze.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-ecad-pcb/src/drc.rs:1544` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/vcad-ecad-fabprep/src/verdict.rs:189` calls `push` and `crates/vcad-ecad-pcb/src/drc.rs:291` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–6 lines × 6) crates/vcad-kernel-acoustics/src/instrument.rs:518— crates/vcad-kernel-acoustics/src/instrument.rs:518-520 | crates/vcad-kernel-acoustics/src/instrument.rs:523-525 | crates/vcad-kernel-acoustics/src/instrument.rs:530-535 | crates/vcad-kernel-fea/src/modal.rs:340-342 | crates/vcad-kernel-fea/src/modal.rs:345-347 | crates/vcad-kernel-fea/src/modal.rs:352-357 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/instrument.rs` and `crates/vcad-kernel-fea/src/modal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/instrument.rs:518` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–6 lines × 5) crates/vcad-eval/src/evaluate.rs:2694— crates/vcad-eval/src/evaluate.rs:2694-2695 | crates/vcad-eval/src/kinematics.rs:27-28 | crates/vcad-ffi/src/lib.rs:822-823 | crates/vcad-kernel-assembly/src/pose.rs:45-50 | crates/vcad-typst/src/lib.rs:230-235 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `&Transform3D` in one and `&vcad_ir::Transform3D` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (4–6 lines × 4) crates/vcad-kernel-booleans/src/ssi.rs:1085— crates/vcad-kernel-booleans/src/ssi.rs:1085-1089 | crates/vcad-kernel-booleans/src/ssi.rs:1130-1133 | crates/vcad-kernel-booleans/src/trim.rs:866-871 | crates/vcad-kernel-fillet/src/closest_point.rs:85-90 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (1–6 lines × 3) crates/vcad-kernel-drafting/src/section.rs:647— crates/vcad-kernel-drafting/src/section.rs:647-652 | crates/vcad-kernel-sketch/src/profile.rs:478-484 | crates/vcad-slicer/src/perimeter.rs:152-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-drafting/src/section.rs:647` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `&Point2D` in one and `Point2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (1–6 lines × 4) crates/vcad-kernel-flow/src/adjoint.rs:502— crates/vcad-kernel-flow/src/adjoint.rs:502-502 | crates/vcad-kernel-flow/src/adjoint.rs:543-548 | crates/vcad-kernel-flow/src/adjoint.rs:635-635 | crates/vcad-kernel-flow/src/adjoint.rs:668-673 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-flow/src/adjoint.rs:543` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (2–6 lines × 3) crates/vcad-kernel-tessellate/src/lib.rs:5314— crates/vcad-kernel-tessellate/src/lib.rs:5314-5315 | crates/vcad-kernel-tessellate/src/lib.rs:5649-5654 | crates/vcad-kernel-tessellate/src/lib.rs:7684-7689 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-tessellate/src/lib.rs:5314` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 11) crates/vcad-kernel-fillet/src/revolved.rs:709— crates/vcad-kernel-fillet/src/revolved.rs:709-713 | crates/vcad-kernel-primitives/src/lib.rs:482-487 | crates/vcad-kernel-primitives/src/lib.rs:552-564 | crates/vcad-kernel-primitives/src/lib.rs:677-682 | crates/vcad-kernel-primitives/src/lib.rs:745-750 | crates/vcad-kernel-sketch/src/extrude.rs:504-508 | crates/vcad-kernel-sketch/src/extrude.rs:1205-1210 | crates/vcad-kernel-sketch/src/extrude.rs:1359-1364 | crates/vcad-kernel-sketch/src/extrude.rs:1399-1404 | crates/vcad-kernel-sweep/src/loft.rs:182-187 | crates/vcad-kernel-sweep/src/sweep.rs:283-288 — before extracting anything, compare `crates/vcad-kernel-primitives/src/lib.rs` and `crates/vcad-kernel-sketch/src/extrude.rs` as WHOLE FILES: this scan already matched 3 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. 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 × 9) crates/vcad-atoms/src/fab.rs:229— crates/vcad-atoms/src/fab.rs:229-233 | crates/vcad-ffi/src/fea.rs:267-271 | crates/vcad-kernel-assembly/src/pose.rs:311-315 | crates/vcad-kernel-fea/src/modal.rs:1154-1158 | crates/vcad-mcp/src/tools/core.rs:320-324 | crates/vcad-render/src/animate.rs:517-521 | crates/vcad-render/src/report.rs:320-324 | crates/vcad-sound/src/lib.rs:434-438 | crates/vcad-typst/src/lib.rs:305-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-atoms/src/fab.rs:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–5 lines × 25) crates/vcad-app/src/camera.rs:105— crates/vcad-app/src/camera.rs:105-107 | crates/vcad-atoms/src/optimize.rs:656-658 | crates/vcad-cli/src/main.rs:2476-2480 | crates/vcad-kernel-cam/src/dropcutter/mesh_accel.rs:26-28 | crates/vcad-kernel-export/src/lib.rs:682-684 | crates/vcad-kernel-tessellate/src/creased_normals.rs:193-195 | crates/vcad-kernel-tessellate/src/creased_normals.rs:244-246 | crates/vcad-kernel-tessellate/src/lib.rs:363-365 | crates/vcad-kernel-tessellate/src/lib.rs:723-725 | crates/vcad-kernel-tessellate/src/lib.rs:1401-1405 | crates/vcad-kernel-tessellate/src/lib.rs:1477-1479 | crates/vcad-kernel-tessellate/src/lib.rs:1501-1503 | crates/vcad-kernel-tessellate/src/lib.rs:1879-1881 | crates/vcad-kernel-tessellate/src/lib.rs:2464-2466 | crates/vcad-kernel-tessellate/src/lib.rs:8792-8794 | crates/vcad-kernel-tessellate/src/lib.rs:8919-8921 | crates/vcad-kernel-tessellate/src/manifold.rs:182-184 | crates/vcad-kernel-tessellate/src/manifold.rs:643-645 | crates/vcad-kernel-tessellate/src/mesh_props.rs:84-86 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:74-76 | crates/vcad-kernel-tessellate/src/mesh_ray.rs:111-113 | crates/vcad-kernel-topopt/src/extract.rs:239-241 | crates/vcad-mcp/src/tools/core.rs:329-331 | crates/vcad-mcp/src/tools/core.rs:341-343 | crates/vcad-mcp/src/tools/core.rs:395-397 — before extracting anything, compare `crates/vcad-kernel-tessellate/src/lib.rs` and `crates/vcad-kernel-tessellate/src/mesh_ray.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-app/src/camera.rs:105` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (1–5 lines × 19) crates/vcad-eval/src/sim_extract/em.rs:444— crates/vcad-eval/src/sim_extract/em.rs:444-444 | crates/vcad-eval/src/thermal_extract.rs:619-623 | crates/vcad-ffi/src/print.rs:374-376 | crates/vcad-ffi/src/sheet_metal.rs:174-178 | crates/vcad-kernel-booleans/src/mesh/csg.rs:929-929 | crates/vcad-kernel-booleans/src/validate.rs:41-41 | crates/vcad-kernel-diff/src/mass.rs:68-68 | crates/vcad-kernel-fea/src/mesh.rs:68-68 | crates/vcad-kernel-fea/src/mesh.rs:69-69 | crates/vcad-kernel-fea/src/solve.rs:533-533 | crates/vcad-kernel-fea/src/solve.rs:534-534 | crates/vcad-kernel-tessellate/src/lib.rs:935-935 | crates/vcad-kernel-tessellate/src/manifold.rs:198-198 | crates/vcad-kernel-tessellate/src/mesh_props.rs:76-76 | crates/vcad-kernel/src/lib.rs:3007-3007 | crates/vcad-kernel/src/lib.rs:3073-3073 | crates/vcad-render/src/report.rs:329-329 | crates/vcad-typst/src/lib.rs:289-289 | docs/videos/every-physics/poc/src/main.rs:60-62 — before extracting anything, compare `crates/vcad-kernel-booleans/src/mesh/csg.rs` and `crates/vcad-kernel-tessellate/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-eval/src/thermal_extract.rs:619` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 8) crates/vcad-loon/src/fastener.rs:545— crates/vcad-loon/src/fastener.rs:545-560 | crates/vcad-parts/src/fasteners/mod.rs:8-23 | crates/vcad-parts/src/fasteners/mod.rs:26-41 | crates/vcad-parts/src/fasteners/mod.rs:56-71 | crates/vcad-parts/src/fasteners/mod.rs:74-89 | crates/vcad-parts/src/fasteners/mod.rs:92-107 | crates/vcad-parts/src/fasteners/mod.rs:110-125 | crates/vcad-parts/src/fasteners/mod.rs:128-143 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 9) crates/vcad-kernel-acoustics/src/receipt.rs:345— crates/vcad-kernel-acoustics/src/receipt.rs:345-355 | crates/vcad-kernel-antenna/src/receipt.rs:480-490 | crates/vcad-kernel-fea/src/receipt.rs:265-275 | crates/vcad-kernel-flow/src/receipt.rs:381-391 | crates/vcad-kernel-neutronics/src/receipt.rs:396-406 | crates/vcad-kernel-optics/src/receipt.rs:263-273 | crates/vcad-kernel-orbit/src/receipt.rs:186-196 | crates/vcad-kernel-particle/src/receipt.rs:479-489 | crates/vcad-kernel-photonics/src/receipt.rs:320-330 — before extracting anything, compare `crates/vcad-kernel-acoustics/src/receipt.rs` and `crates/vcad-kernel-antenna/src/receipt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/vcad-kernel-acoustics/src/receipt.rs:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/vcad-kernel-acoustics/src/receipt.rs:344` calls `join` and `crates/vcad-kernel-antenna/src/receipt.rs:479` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20–36 lines × 2) packages/training/src/modal/eval.py:148— packages/training/src/modal/eval.py:148-167 | packages/training/src/modal/train.py:281-316 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `packages/training/src/modal/eval.py:170` calls `split` and `packages/training/src/modal/train.py:317` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (28–33 lines × 2) packages/training/src/lambda/distill_lambda.py:234— packages/training/src/lambda/distill_lambda.py:234-261 | packages/training/src/modal/distill.py:229-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. Read the line range as the matched WINDOW rather than a finished unit: at `packages/training/src/modal/distill.py:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–18 lines × 2) packages/training/src/lambda/distill_lambda.py:174— packages/training/src/lambda/distill_lambda.py:174-191 | packages/training/src/modal/distill.py:162-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `packages/training/src/lambda/distill_lambda.py:174` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–16 lines × 2) packages/training/src/lambda/distill_lambda.py:333— packages/training/src/lambda/distill_lambda.py:333-345 | packages/training/src/modal/distill.py:344-359 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (118 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4560— apple/VcadApp/Sources/VcadApp/Editor.swift:4560-4677 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4560-4677 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (74 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4451— apple/VcadApp/Sources/VcadApp/Editor.swift:4451-4524 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4451-4524 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (4–73 lines × 3) apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2631— apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2631-2634 | apple/VcadApp/Sources/VcadApp/VisionShell.swift:13-85 | apple/VcadVision/Sources/VcadVision/Shared/VisionShell.swift:13-85 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift` and `apple/VcadApp/Sources/VcadApp/VisionShell.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/ReleasedDesktop.swift:2631` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (83 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:24— apple/VcadApp/Sources/VcadApp/Shell.swift:24-106 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:24-106 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 (64 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3511— apple/VcadApp/Sources/VcadApp/Editor.swift:3511-3574 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3511-3574 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (71 lines × 2) apple/VcadApp/Sources/VcadApp/UsdzExport.swift:32— apple/VcadApp/Sources/VcadApp/UsdzExport.swift:32-102 | apple/VcadVision/Sources/VcadVision/Shared/UsdzExport.swift:32-102 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/UsdzExport.swift` and `apple/VcadVision/Sources/VcadVision/Shared/UsdzExport.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (108 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:4268— apple/VcadApp/Sources/VcadApp/Editor.swift:4268-4375 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4268-4375 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (49 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:620— apple/VcadApp/Sources/VcadApp/Shell.swift:620-668 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:620-668 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Shell.swift:620` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (241 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:176— apple/VcadApp/Sources/VcadApp/Shell.swift:176-416 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:176-416 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 (42 lines × 2) apple/VcadApp/Sources/VcadApp/SimController.swift:185— apple/VcadApp/Sources/VcadApp/SimController.swift:185-226 | apple/VcadVision/Sources/VcadVision/Shared/SimController.swift:185-226 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimController.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimController.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 291 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 (65 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:710— apple/VcadApp/Sources/VcadApp/Shell.swift:710-774 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:710-774 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 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 (63 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3882— apple/VcadApp/Sources/VcadApp/Editor.swift:3882-3944 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3882-3944 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (79 lines × 2) apple/VcadApp/Sources/VcadApp/Kernel.swift:301— apple/VcadApp/Sources/VcadApp/Kernel.swift:301-379 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:301-379 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (2–28 lines × 3) apple/VcadApp/Sources/VcadApp/ModelBrowser.swift:255— apple/VcadApp/Sources/VcadApp/ModelBrowser.swift:255-256 | apple/VcadApp/Sources/VcadApp/Shell.swift:664-691 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:664-691 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/ModelBrowser.swift:255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (54 lines × 2) apple/VcadApp/Sources/VcadApp/SimPanel.swift:259— apple/VcadApp/Sources/VcadApp/SimPanel.swift:259-312 | apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift:259-312 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SimPanel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SimPanel.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 317 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 (51 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:3615— apple/VcadApp/Sources/VcadApp/Editor.swift:3615-3665 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:3615-3665 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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–21 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:2795— apple/VcadApp/Sources/VcadApp/Editor.swift:2795-2811 | apple/VcadApp/Sources/VcadApp/Editor.swift:4735-4755 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2795-2811 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4735-4755 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:2795` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (90 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:2156— apple/VcadApp/Sources/VcadApp/Editor.swift:2156-2245 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2156-2245 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (52 lines × 2) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:211— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:211-262 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:211-262 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 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 (4–16 lines × 4) apple/VcadApp/Sources/VcadApp/AssemblyModel.swift:259— apple/VcadApp/Sources/VcadApp/AssemblyModel.swift:259-262 | apple/VcadApp/Sources/VcadApp/Editor.swift:779-794 | apple/VcadApp/Sources/VcadApp/PoseStudio.swift:158-162 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:779-794 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (36 lines × 2) apple/VcadApp/Sources/VcadApp/Editor.swift:1803— apple/VcadApp/Sources/VcadApp/Editor.swift:1803-1838 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1803-1838 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 (44 lines × 2) apple/VcadApp/Sources/VcadApp/UsdzExport.swift:109— apple/VcadApp/Sources/VcadApp/UsdzExport.swift:109-152 | apple/VcadVision/Sources/VcadVision/Shared/UsdzExport.swift:109-152 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/UsdzExport.swift` and `apple/VcadVision/Sources/VcadVision/Shared/UsdzExport.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 120 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 (69 lines × 2) apple/VcadApp/Sources/VcadApp/Shell.swift:816— apple/VcadApp/Sources/VcadApp/Shell.swift:816-884 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:816-884 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Shell.swift:816` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (55 lines × 2) apple/VcadApp/Sources/VcadApp/Kernel.swift:462— apple/VcadApp/Sources/VcadApp/Kernel.swift:462-516 | apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift:462-516 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Kernel.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Kernel.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 442 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) apple/VcadApp/Sources/VcadApp/Editor.swift:2954— apple/VcadApp/Sources/VcadApp/Editor.swift:2954-2983 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:2954-2983 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 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 × 6) apple/VcadApp/Sources/VcadApp/Shell.swift:906— apple/VcadApp/Sources/VcadApp/Shell.swift:906-915 | apple/VcadApp/Sources/VcadApp/Shell.swift:927-936 | apple/VcadApp/Sources/VcadApp/Shell.swift:939-948 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:906-915 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:927-936 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:939-948 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8–9 lines × 4) apple/VcadApp/Sources/VcadApp/Editor.swift:1211— apple/VcadApp/Sources/VcadApp/Editor.swift:1211-1218 | apple/VcadApp/Sources/VcadApp/Editor.swift:4685-4693 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:1211-1218 | apple/VcadVision/Sources/VcadVision/Shared/Editor.swift:4685-4693 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Editor.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Editor.swift` as WHOLE FILES: this scan already matched 188 separate duplicated blocks between them, totalling at least 2896 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Editor.swift:1211` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (3–9 lines × 6) apple/VcadApp/Sources/VcadApp/Document.swift:567— apple/VcadApp/Sources/VcadApp/Document.swift:567-575 | apple/VcadApp/Sources/VcadApp/Document.swift:586-588 | apple/VcadApp/Sources/VcadApp/Document.swift:596-598 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:567-575 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:586-588 | apple/VcadVision/Sources/VcadVision/Shared/Document.swift:596-598 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Document.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Document.swift` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 581 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Document.swift:567` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (2–7 lines × 4) apple/VcadApp/Sources/VcadApp/Shell.swift:814— apple/VcadApp/Sources/VcadApp/Shell.swift:814-820 | apple/VcadApp/Sources/VcadApp/Shell.swift:835-836 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:814-820 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:835-836 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Shell.swift:814` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) apple/VcadApp/Sources/VcadApp/SceneAssets.swift:105— apple/VcadApp/Sources/VcadApp/SceneAssets.swift:105-135 | apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift:105-135 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/SceneAssets.swift` and `apple/VcadVision/Sources/VcadVision/Shared/SceneAssets.swift` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/SceneAssets.swift:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (1–5 lines × 3) apple/VcadApp/Sources/VcadApp/GlassChrome.swift:486— apple/VcadApp/Sources/VcadApp/GlassChrome.swift:486-486 | apple/VcadApp/Sources/VcadApp/Shell.swift:245-249 | apple/VcadVision/Sources/VcadVision/Shared/Shell.swift:245-249 — before extracting anything, compare `apple/VcadApp/Sources/VcadApp/Shell.swift` and `apple/VcadVision/Sources/VcadVision/Shared/Shell.swift` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 974 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apple/VcadApp/Sources/VcadApp/Shell.swift:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) crates/vcad-kernel-em/src/spec.rs:300— crates/vcad-kernel-em/src/spec.rs:300-342 | crates/vcad-kernel-em/src/spec.rs:474-519 — 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.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — mecheval/harness/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/vcad-kernel-wasm/src/circuit_sim.rs:790— `tune_filter` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
Duplication concentrated across 4 sibling directories (45 clone groups) packages/app/src/components/SceneMesh.tsx:169— 45 duplicated blocks under packages/app/src/ have copies in at least two of the sibling directories components, hooks, lib, stores — 19 of them are reported below, and 26 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 45 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 45 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 45 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 7 sibling directories (36 clone groups) packages/core/src/commands/executors.ts:530— 36 duplicated blocks under packages/ have copies in at least two of the sibling directories app, core, engine, ir, mcp, training (+1 more sibling(s) not listed) — 21 of them are reported below, and 15 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 36 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 36 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 36 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (21 clone groups) packages/app/public/launch/launch.js:99— 21 of the duplicated blocks reported below have copies in at least two of the sibling directories apple, mecheval, packages, www under the repository root. That concentration is one structural fact, not 21 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 21 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 8 sibling directories (15 clone groups) packages/app/src/components/dialogs/StitchDialog.tsx:79— 15 duplicated blocks under packages/app/src/components/ have copies in at least two of the sibling directories cam, dialogs, electronics, embroidery, footer, materials (+2 more sibling(s) not listed) — 7 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 15 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 15 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 15 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Wholesale file copy (163 identical lines × 2 files) packages/app/src/components/materials/InstanceMaterialSelector.tsx:6— packages/app/src/components/materials/InstanceMaterialSelector.tsx:6 · packages/app/src/components/materials/MaterialSelector.tsx:6 — these 2 files are line-for-line copies of one another — 163 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (133 matched lines × 2 locations) · ×1
Duplicated block with local edits (133 matched lines × 2 locations) packages/app/src/components/shadcn/dropdown-menu.tsx:9— packages/app/src/components/shadcn/dropdown-menu.tsx:9 · packages/app/src/components/shadcn/select.tsx:9 — the two spans are one implementation copied and then locally edited — 504 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (94 matched lines × 2 locations) · ×1
Duplicated block with local edits (94 matched lines × 2 locations) mecheval/harness/src/solvers/claude-mcp.ts:367— mecheval/harness/src/solvers/claude-mcp.ts:367 · mecheval/harness/src/solvers/gateway-mcp.ts:145 — the two spans are one implementation copied and then locally edited — 473 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (71 matched lines × 2 locations) · ×1
Duplicated block with local edits (71 matched lines × 2 locations) packages/app/src/components/ui/toolbar.tsx:131— packages/app/src/components/ui/toolbar.tsx:131 · packages/app/src/components/ui/toolbar.tsx:253 — the two spans are one implementation copied and then locally edited — 448 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (56 matched lines × 2 locations) · ×1
Duplicated block with local edits (56 matched lines × 2 locations) packages/app/src/components/StatusBar.tsx:310— packages/app/src/components/StatusBar.tsx:310 · packages/app/src/components/StatusBar.tsx:393 — the two spans are one implementation copied and then locally edited — 214 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (53 matched lines × 2 locations) · ×1
Duplicated block with local edits (53 matched lines × 2 locations) packages/training/src/multimodal.ts:81— packages/training/src/multimodal.ts:81 · packages/training/src/multimodal.ts:202 — the two spans are one implementation copied and then locally edited — 291 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (52 matched lines × 2 locations) · ×1
Duplicated block with local edits (52 matched lines × 2 locations) packages/app/src/components/ui/notifications/ActionResultCard.tsx:8— packages/app/src/components/ui/notifications/ActionResultCard.tsx:8 · packages/app/src/components/ui/notifications/WarningCard.tsx:8 — the two spans are one implementation copied and then locally edited — 272 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (51 lines × 2 locations) packages/app/public/launch/launch.js:221— packages/app/public/launch/launch.js:221 · www/public/kit/gallery.js:333 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) packages/training/src/generators/array.ts:113— packages/training/src/generators/array.ts:113 · packages/training/src/generators/funnel.ts:101 — the two spans are one implementation copied and then locally edited — 326 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (48 lines × 2 locations) packages/app/public/launch/launch.js:373— packages/app/public/launch/launch.js:373 · www/public/kit/gallery.js:546 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (47 matched lines × 2 locations) · ×1
Duplicated block with local edits (47 matched lines × 2 locations) packages/training/src/generators/radial.ts:170— packages/training/src/generators/radial.ts:170 · packages/training/src/generators/scaled.ts:149 — the two spans are one implementation copied and then locally edited — 413 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (46 matched lines × 2 locations) · ×1
Duplicated block with local edits (46 matched lines × 2 locations) packages/app/src/components/dialogs/FilletChamferDialog.tsx:17— packages/app/src/components/dialogs/FilletChamferDialog.tsx:17 · packages/app/src/components/dialogs/ShellDialog.tsx:15 — the two spans are one implementation copied and then locally edited — 243 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (42 lines × 2 locations) packages/app/public/launch/launch.js:426— packages/app/public/launch/launch.js:426 · www/public/kit/gallery.js:599 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (41 lines × 2 locations) mecheval/harness/src/solvers/claude-mcp.ts:314— mecheval/harness/src/solvers/claude-mcp.ts:314 · mecheval/harness/src/solvers/gateway-mcp.ts:104 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) packages/app/src/components/SceneMesh.tsx:169— packages/app/src/components/SceneMesh.tsx:169 · packages/app/src/lib/sub-feature-geometry.ts:59 — the two spans are one implementation copied and then locally edited — 398 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (37 lines × 2 locations) packages/training/src/generators/hollow.ts:134— packages/training/src/generators/hollow.ts:134 · packages/training/src/generators/scaled.ts:143 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (35 lines × 2 locations) packages/engine/src/index.ts:3040— packages/engine/src/index.ts:3040 · packages/engine/src/index.ts:3077 — both copies are in the same file, so extract the block into 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 × 3 locations) packages/mcp/src/tools/physics.ts:73— packages/mcp/src/tools/physics.ts:73 · packages/mcp/src/tools/structure.ts:150 · packages/mcp/src/tools/topopt.ts:79 — the 3 copies are spread across 3 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
Duplicated block (32 lines × 2 locations) packages/app/public/launch/launch.js:201— packages/app/public/launch/launch.js:201 · www/public/kit/gallery.js:313 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (30 lines × 2 locations) packages/training/src/generators/clip.ts:132— packages/training/src/generators/clip.ts:132 · packages/training/src/generators/scaled.ts:148 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (29 lines × 4 locations) mecheval/harness/src/solvers/claude-direct.ts:192— mecheval/harness/src/solvers/claude-direct.ts:192 · mecheval/harness/src/solvers/gateway-direct.ts:97 · mecheval/harness/src/solvers/openai-direct.ts:115 · mecheval/harness/src/solvers/wafer-direct.ts:81 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (29 matched lines × 2 locations) · ×1
Duplicated block with local edits (29 matched lines × 2 locations) packages/engine/src/evaluate.ts:73— packages/engine/src/evaluate.ts:73 · packages/engine/src/scene-convert.ts:24 — the two spans are one implementation copied and then locally edited — 243 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Complex function handleKeyDown (cyclomatic 163, cognitive 197) packages/app/src/hooks/useKeyboardShortcuts.ts:17— handleKeyDown has cyclomatic complexity 163 and cognitive complexity 197; 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 routeNets (cyclomatic 145, cognitive 233) packages/mcp/src/tools/ecad.ts:3811— routeNets has cyclomatic complexity 145 and cognitive complexity 233; 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 addMotorWinding (cyclomatic 129, cognitive 231) packages/mcp/src/tools/ecad.ts:11593— addMotorWinding has cyclomatic complexity 129 and cognitive complexity 231; 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 renderView (cyclomatic 107, cognitive 115) packages/mcp/src/tools/render.ts:376— renderView has cyclomatic complexity 107 and cognitive complexity 115; 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 fixDrc (cyclomatic 85, cognitive 166) packages/mcp/src/tools/ecad.ts:15028— fixDrc has cyclomatic complexity 85 and cognitive complexity 166; 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 evaluateOp (cyclomatic 81, cognitive 56) packages/engine/src/evaluate.ts:715— evaluateOp has cyclomatic complexity 81 and cognitive complexity 56; 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 generateSyntheticDescription (cyclomatic 76, cognitive 47) packages/training/src/annotate.ts:237— generateSyntheticDescription has cyclomatic complexity 76 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 75, cognitive 65) packages/app/src/hooks/useToolDefinitions.tsx:281— (anonymous) has cyclomatic complexity 75 and cognitive complexity 65; 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 quoteManufacturing (cyclomatic 66, cognitive 87) packages/mcp/src/tools/order.ts:204— quoteManufacturing has cyclomatic complexity 66 and cognitive complexity 87; 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 layoutLint (cyclomatic 65, cognitive 113) packages/mcp/src/tools/ecad.ts:5391— layoutLint has cyclomatic complexity 65 and cognitive complexity 113; 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 addCoil (cyclomatic 62, cognitive 91) packages/mcp/src/tools/ecad.ts:7744— addCoil has cyclomatic complexity 62 and cognitive complexity 91; 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 exportVideo (cyclomatic 62, cognitive 86) packages/mcp/src/tools/animate.ts:1034— exportVideo has cyclomatic complexity 62 and cognitive complexity 86; 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 handleModernRequest (cyclomatic 61, cognitive 72) packages/mcp/src/protocol-2026.ts:543— handleModernRequest has cyclomatic complexity 61 and cognitive complexity 72; 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 check (cyclomatic 61, cognitive 61) packages/mcp/src/tools/part-stock.ts:384— check has cyclomatic complexity 61 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 placeComponents (cyclomatic 60, cognitive 78) packages/mcp/src/tools/ecad.ts:2874— placeComponents has cyclomatic complexity 60 and cognitive complexity 78; 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 checkClearance (cyclomatic 54, cognitive 57) packages/mcp/src/tools/clearance.ts:626— checkClearance has cyclomatic complexity 54 and cognitive complexity 57; 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 calcMotor (cyclomatic 53, cognitive 89) packages/mcp/src/tools/ecad.ts:12513— calcMotor has cyclomatic complexity 53 and cognitive complexity 89; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 53, cognitive 70) packages/mcp/src/server.ts:1405— (anonymous) has cyclomatic complexity 53 and cognitive complexity 70; 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 recordSimulation (cyclomatic 53, cognitive 70) packages/mcp/src/tools/record.ts:168— recordSimulation has cyclomatic complexity 53 and cognitive complexity 70; 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 parseGeometryOpcode (cyclomatic 53, cognitive 67) packages/ir/src/index.ts:1481— parseGeometryOpcode has cyclomatic complexity 53 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function sizeImpedance (cyclomatic 51, cognitive 54) packages/mcp/src/tools/ecad.ts:7129— sizeImpedance has cyclomatic complexity 51 and cognitive complexity 54; 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 ViewportContent (cyclomatic 47, cognitive 35) packages/app/src/components/ViewportContent.tsx:366— ViewportContent has cyclomatic complexity 47 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 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 verifyReceipt (cyclomatic 46, cognitive 51) packages/mcp/src/tools/ecad.ts:14693— verifyReceipt has cyclomatic complexity 46 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 45, cognitive 77) packages/app/src/components/electronics/pcb3d/PcbScene.tsx:84— (anonymous) has cyclomatic complexity 45 and cognitive complexity 77; 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 SceneMesh (cyclomatic 44, cognitive 33) packages/app/src/components/SceneMesh.tsx:496— SceneMesh has cyclomatic complexity 44 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 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 buildReceipt (cyclomatic 43, cognitive 60) packages/mcp/src/tools/ecad.ts:14504— buildReceipt has cyclomatic complexity 43 and cognitive complexity 60; 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 deriveNets (cyclomatic 42, cognitive 67) packages/mcp/src/tools/ecad.ts:525— deriveNets has cyclomatic complexity 42 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function addViaArray (cyclomatic 42, cognitive 57) packages/mcp/src/tools/ecad.ts:11318— addViaArray has cyclomatic complexity 42 and cognitive complexity 57; 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 buildLine (cyclomatic 41, cognitive 66) packages/mcp/src/tools/bom.ts:252— buildLine has cyclomatic complexity 41 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 41, cognitive 56) packages/app/src/components/xr/XRGestures.tsx:199— (anonymous) has cyclomatic complexity 41 and cognitive complexity 56; 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 createCommandRegistry (cyclomatic 41, cognitive 40) packages/core/src/commands.ts:180— createCommandRegistry has cyclomatic complexity 41 and cognitive complexity 40; 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 parseRustSourceContentWithInference (cyclomatic 40, cognitive 106) REDACTED:535— parseRustSourceContentWithInference has cyclomatic complexity 40 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 40, cognitive 66) packages/app/src/components/RayTracedViewport.tsx:91— (anonymous) has cyclomatic complexity 40 and cognitive complexity 66; 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 formatSceneSettings (cyclomatic 40, cognitive 64) packages/ir/src/index.ts:935— formatSceneSettings has cyclomatic complexity 40 and cognitive complexity 64; 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 computeIntegrity (cyclomatic 40, cognitive 50) packages/mcp/src/tools/integrity.ts:244— computeIntegrity has cyclomatic complexity 40 and cognitive complexity 50; 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 failureReason (cyclomatic 39, cognitive 53) mecheval/harness/src/pass_k.ts:58— failureReason has cyclomatic complexity 39 and cognitive complexity 53; 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 runMutationViaEngine (cyclomatic 39, cognitive 46) packages/mcp/src/tools/registry-dispatch.ts:679— runMutationViaEngine has cyclomatic complexity 39 and cognitive complexity 46; 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 PropertyPanel (cyclomatic 39, cognitive 37) packages/app/src/components/PropertyPanel.tsx:1540— PropertyPanel has cyclomatic complexity 39 and cognitive complexity 37; 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 TreeNode (cyclomatic 38, cognitive 32) packages/app/src/components/FeatureTree.tsx:485— TreeNode has cyclomatic complexity 38 and cognitive complexity 32; 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 computeInterferenceAudit (cyclomatic 37, cognitive 74) packages/mcp/src/tools/clearance.ts:482— computeInterferenceAudit has cyclomatic complexity 37 and cognitive complexity 74; 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.
R3 · Large Files· packages/mcp/src/tools/ecad.ts · ×1
packages/mcp/src/tools/ecad.ts: 15389 lines of code packages/mcp/src/tools/ecad.ts:1— packages/mcp/src/tools/ecad.ts has 15389 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/engine/src/index.ts · ×1
packages/engine/src/index.ts: 3010 lines of code packages/engine/src/index.ts:1— packages/engine/src/index.ts has 3010 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· mecheval/leaderboard/src/build.ts · ×1
mecheval/leaderboard/src/build.ts: 2470 lines of code mecheval/leaderboard/src/build.ts:1— mecheval/leaderboard/src/build.ts has 2470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/viewer-app/main.ts · ×1
packages/mcp/viewer-app/main.ts: 2321 lines of code packages/mcp/viewer-app/main.ts:1— packages/mcp/viewer-app/main.ts has 2321 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/stores/document-store.ts · ×1
packages/core/src/stores/document-store.ts: 2150 lines of code packages/core/src/stores/document-store.ts:1— packages/core/src/stores/document-store.ts has 2150 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/mcp/src/server.ts: 1953 lines of code packages/mcp/src/server.ts:1— packages/mcp/src/server.ts has 1953 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/ViewportContent.tsx · ×1
packages/app/src/components/ViewportContent.tsx: 1948 lines of code packages/app/src/components/ViewportContent.tsx:1— packages/app/src/components/ViewportContent.tsx has 1948 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/engine/src/ecad.ts · ×1
packages/engine/src/ecad.ts: 1842 lines of code packages/engine/src/ecad.ts:1— packages/engine/src/ecad.ts has 1842 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/PropertyPanel.tsx · ×1
packages/app/src/components/PropertyPanel.tsx: 1682 lines of code packages/app/src/components/PropertyPanel.tsx:1— packages/app/src/components/PropertyPanel.tsx has 1682 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/render.ts · ×1
packages/mcp/src/tools/render.ts: 1448 lines of code packages/mcp/src/tools/render.ts:1— packages/mcp/src/tools/render.ts has 1448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/ir/src/index.ts: 1426 lines of code packages/ir/src/index.ts:1— packages/ir/src/index.ts has 1426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/animate.ts · ×1
packages/mcp/src/tools/animate.ts: 1389 lines of code packages/mcp/src/tools/animate.ts:1— packages/mcp/src/tools/animate.ts has 1389 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/FeatureTree.tsx · ×1
packages/app/src/components/FeatureTree.tsx: 1223 lines of code packages/app/src/components/FeatureTree.tsx:1— packages/app/src/components/FeatureTree.tsx has 1223 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/electronics/SchematicCanvas.tsx · ×1
packages/app/src/components/electronics/SchematicCanvas.tsx: 1218 lines of code packages/app/src/components/electronics/SchematicCanvas.tsx:1— packages/app/src/components/electronics/SchematicCanvas.tsx has 1218 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/hooks/useToolDefinitions.tsx · ×1
packages/app/src/hooks/useToolDefinitions.tsx: 1158 lines of code packages/app/src/hooks/useToolDefinitions.tsx:1— packages/app/src/hooks/useToolDefinitions.tsx has 1158 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/engine/src/evaluate.ts · ×1
packages/engine/src/evaluate.ts: 1154 lines of code packages/engine/src/evaluate.ts:1— packages/engine/src/evaluate.ts has 1154 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/clearance.ts · ×1
packages/mcp/src/tools/clearance.ts: 1145 lines of code packages/mcp/src/tools/clearance.ts:1— packages/mcp/src/tools/clearance.ts has 1145 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/gym.ts · ×1
packages/mcp/src/tools/gym.ts: 1141 lines of code packages/mcp/src/tools/gym.ts:1— packages/mcp/src/tools/gym.ts has 1141 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/DrawingView.tsx · ×1
packages/app/src/components/DrawingView.tsx: 1113 lines of code packages/app/src/components/DrawingView.tsx:1— packages/app/src/components/DrawingView.tsx has 1113 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/protocol-2026.ts · ×1
packages/mcp/src/protocol-2026.ts: 1104 lines of code packages/mcp/src/protocol-2026.ts:1— packages/mcp/src/protocol-2026.ts has 1104 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/claims-ledger.ts · ×1
packages/mcp/src/tools/claims-ledger.ts: 1092 lines of code packages/mcp/src/tools/claims-ledger.ts:1— packages/mcp/src/tools/claims-ledger.ts has 1092 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/training/src/cli.ts · ×1
packages/training/src/cli.ts: 1040 lines of code packages/training/src/cli.ts:1— packages/training/src/cli.ts has 1040 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/SceneMesh.tsx · ×1
packages/app/src/components/SceneMesh.tsx: 1024 lines of code packages/app/src/components/SceneMesh.tsx:1— packages/app/src/components/SceneMesh.tsx has 1024 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/app/src/App.tsx: 997 lines of code packages/app/src/App.tsx:1— packages/app/src/App.tsx has 997 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/SketchPlane3D.tsx · ×1
packages/app/src/components/SketchPlane3D.tsx: 945 lines of code packages/app/src/components/SketchPlane3D.tsx:1— packages/app/src/components/SketchPlane3D.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/registry-dispatch.ts · ×1
packages/mcp/src/tools/registry-dispatch.ts: 901 lines of code packages/mcp/src/tools/registry-dispatch.ts:1— packages/mcp/src/tools/registry-dispatch.ts has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/engine/src/sheet-metal.ts · ×1
packages/engine/src/sheet-metal.ts: 895 lines of code packages/engine/src/sheet-metal.ts:1— packages/engine/src/sheet-metal.ts has 895 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/session.ts · ×1
packages/mcp/src/tools/session.ts: 818 lines of code packages/mcp/src/tools/session.ts:1— packages/mcp/src/tools/session.ts has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/commands.ts · ×1
packages/core/src/commands.ts: 809 lines of code packages/core/src/commands.ts:1— packages/core/src/commands.ts has 809 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/RayTracedViewport.tsx · ×1
packages/app/src/components/RayTracedViewport.tsx: 775 lines of code packages/app/src/components/RayTracedViewport.tsx:1— packages/app/src/components/RayTracedViewport.tsx has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/sheet-metal.ts · ×1
packages/mcp/src/tools/sheet-metal.ts: 770 lines of code packages/mcp/src/tools/sheet-metal.ts:1— packages/mcp/src/tools/sheet-metal.ts has 770 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/bom.ts · ×1
packages/mcp/src/tools/bom.ts: 755 lines of code packages/mcp/src/tools/bom.ts:1— packages/mcp/src/tools/bom.ts has 755 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/part-stock.ts · ×1
packages/mcp/src/tools/part-stock.ts: 752 lines of code packages/mcp/src/tools/part-stock.ts:1— packages/mcp/src/tools/part-stock.ts has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/utils/save-load.ts · ×1
packages/core/src/utils/save-load.ts: 723 lines of code packages/core/src/utils/save-load.ts:1— packages/core/src/utils/save-load.ts has 723 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/stores/sketch-store.ts · ×1
packages/core/src/stores/sketch-store.ts: 722 lines of code packages/core/src/stores/sketch-store.ts:1— packages/core/src/stores/sketch-store.ts has 722 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/Header.tsx · ×1
packages/app/src/components/Header.tsx: 703 lines of code packages/app/src/components/Header.tsx:1— packages/app/src/components/Header.tsx has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/preview.ts · ×1
packages/mcp/src/tools/preview.ts: 689 lines of code packages/mcp/src/tools/preview.ts:1— packages/mcp/src/tools/preview.ts has 689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
www/public/kit/gallery.js: 687 lines of code www/public/kit/gallery.js:1— www/public/kit/gallery.js has 687 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/mcp/src/tools/parameters.ts · ×1
packages/mcp/src/tools/parameters.ts: 655 lines of code packages/mcp/src/tools/parameters.ts:1— packages/mcp/src/tools/parameters.ts has 655 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/components/AnalyzePanel.tsx · ×1
packages/app/src/components/AnalyzePanel.tsx: 653 lines of code packages/app/src/components/AnalyzePanel.tsx:1— packages/app/src/components/AnalyzePanel.tsx has 653 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· This package's lint script runs in no CI job · ×1
This package's lint script runs in no CI job packages/docs/package.json:10— The package in `packages/docs` declares the lint script `lint` (`next lint`), but no step of this repository's CI runs it, by name, through another script, a Makefile target or a workspace runner, and no CI step runs the linter over the package itself. The rules it sets are enforced nowhere a pull request can fail. Run it in CI: a step that runs `npm run lint` in `packages/docs` (or the workspace's task runner).
Dead file (~364 LoC) packages/app/src/components/electronics/pcb3d/usePcbCamera.ts— no import path from any entry point (91 application, 42 tooling, 184 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 (~327 LoC) packages/app/src/components/InlineProperties.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~257 LoC) packages/app/src/components/shadcn/dropdown-menu.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~235 LoC) packages/app/src/components/ui/expression-input.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~219 LoC) packages/app/src/components/electronics/PcbFootprintGroup.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~190 LoC) packages/app/src/components/shadcn/select.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~182 LoC) packages/app/src/components/shadcn/command.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~170 LoC) packages/app/src/components/shadcn/input-group.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~156 LoC) packages/app/src/components/shadcn/dialog.tsx— no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/command.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~125 LoC) packages/app/src/hooks/useBackgroundLuminance.ts— no import path from any entry point (91 application, 42 tooling, 184 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 (~122 LoC) packages/app/src/components/electronics/PcbPadShape.tsx— no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/electronics/PcbFootprintGroup.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~83 LoC) packages/app/src/components/shadcn/button-group.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~76 LoC) packages/app/src/components/electronics/LayerPanel.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~64 LoC) packages/app/src/components/shadcn/button.tsx— no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/app/src/components/shadcn/dialog.tsx, packages/app/src/components/shadcn/input-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~58 LoC) packages/app/src/components/shadcn/scroll-area.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~57 LoC) packages/app/src/components/shadcn/tooltip.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~48 LoC) packages/app/src/components/shadcn/badge.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~35 LoC) packages/app/src/components/ui/panel.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~34 LoC) packages/app/src/components/electronics/ComponentPicker.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~26 LoC) packages/app/src/components/shadcn/separator.tsx— no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/button-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~21 LoC) packages/app/src/components/shadcn/input.tsx— no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/input-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~18 LoC) packages/app/src/components/shadcn/textarea.tsx— no import path from any entry point (91 application, 42 tooling, 184 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/app/src/components/shadcn/input-group.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~16 LoC) packages/app/src/components/shadcn/spinner.tsx— no import path from any entry point (91 application, 42 tooling, 184 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 (~11 LoC) packages/app/src/stores/toast-store.ts— no import path from any entry point (91 application, 42 tooling, 184 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
Unlisted import 'three-stdlib' packages/app/src/components/TransformGizmo.tsx:11— Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json.
Unused dependency '@radix-ui/react-use-controllable-state' packages/app/package.json:26— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@streamdown/cjk' packages/app/package.json:32— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@streamdown/code' packages/app/package.json:33— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@streamdown/math' packages/app/package.json:34— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@streamdown/mermaid' packages/app/package.json:35— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@vcad/mcp' packages/app/package.json:40— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'ai' packages/app/package.json:43— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'motion' packages/app/package.json:50— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'shiki' packages/app/package.json:57— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'stripe' packages/app/package.json:59— Declared in packages/app/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X18 · Disposal-pattern correctness· Disposes a dependency it does not own · ×1
Disposes a dependency it does not own packages/engine/src/engine-host.ts:353— `transport` is never created by `DocumentEngineClient` — it is the constructor parameter `transport` (line 279), and its declared type `EngineTransport` is an interface — yet this class disposes it here (line 353). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
X25 · Inert configuration knob· Option is kept and never read · ×1
Option is kept and never read packages/wasmosis/src/registry.ts:40— `Registry` accepts `config` from the caller and keeps it in `this.config` on line 40, where only it can read the value — but nothing ever reads `this.config`. Setting `config` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.config` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `config` from the accepted options so callers stop setting a knob that does nothing.
Duplicated predicate packages/app/public/launch/launch.js:430— `!o.isMesh || !col || !(col.g > col.r * 2.5 && col.g > col.b * 1.4)` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/training/src/cli.ts:1170— `!scene.parts || scene.parts.length === 0` appears character-identically in 3 files — packages/training/src/cli.ts, packages/training/src/multimodal.ts, packages/training/src/validate.ts. 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 packages/core/src/stores/document-store.ts:1700— `!sketchNode || sketchNode.op.type !== "Sketch2D"` appears character-identically in 2 files — packages/core/src/stores/document-store.ts, packages/engine/src/evaluate.ts. 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 packages/app/src/components/PropertyPanel.tsx:911— `!textNode || textNode.op.type !== "Text2D"` appears character-identically in 2 files — packages/app/src/components/PropertyPanel.tsx, packages/core/src/stores/document-store.ts. 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 packages/app/src/components/ui/notifications/ActionResultCard.tsx:48— `(!action.variant || action.variant === "secondary") && "bg-border/50 text-text-muted hover:text-text hover:bg-border"` appears character-identically in 2 files — packages/app/src/components/ui/notifications/ActionResultCard.tsx, packages/app/src/components/ui/notifications/WarningCard.tsx. 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 www/src/hero-engine.js:282— `Math.max(maxX - minX, maxY - minY, maxZ - minZ) || 1` appears character-identically in 2 files — www/src/hero-engine.js, www/src/wireframe.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/src/components/materials/InstanceMaterialSelector.tsx:245— `category === currentCategory || category === "metals"` appears character-identically in 2 files — packages/app/src/components/materials/InstanceMaterialSelector.tsx, packages/app/src/components/materials/MaterialSelector.tsx. 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 packages/app/src/components/ui/notifications/ActionResultCard.tsx:50— `disabled && "opacity-50 cursor-not-allowed"` appears character-identically in 2 files — packages/app/src/components/ui/notifications/ActionResultCard.tsx, packages/app/src/components/ui/notifications/WarningCard.tsx. 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 packages/app/src/components/FeatureTree.tsx:1144— `document.instances && document.instances.length > 0` appears character-identically in 2 files — packages/app/src/components/FeatureTree.tsx, packages/app/src/hooks/useToolDefinitions.tsx. 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 packages/app/src/components/DrawingView.tsx:379— `e.button === 1 || (e.button === 0 && e.altKey)` appears character-identically in 2 files — packages/app/src/components/DrawingView.tsx, packages/app/src/components/electronics/SchematicCanvas.tsx. 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 packages/app/src/components/electronics/pcb3d/PcbComponentBodies3D.tsx:48— `emissive[0] > 0 || emissive[1] > 0 || emissive[2] > 0` appears character-identically in 2 files — packages/app/src/components/electronics/pcb3d/PcbComponentBodies3D.tsx, packages/mcp/src/tools/preview.ts. 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 packages/app/public/launch/launch.js:292— `f.canvas.width !== pw || f.canvas.height !== ph` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/public/launch/launch.js:184— `fn.lengthSq() < 1e-12 * Math.max(a.distanceToSquared(b), b.distanceToSquared(c), 1e-30) ** 2 || !isFinite(fn.x)` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/public/launch/launch.js:228— `geometry.boundingBox.getSize(new THREE.Vector3()).length() || 1` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/mcp/src/tools/document-solids.ts:274— `i < scene.parts.length && i < visibleRoots.length` appears character-identically in 3 files — packages/mcp/src/tools/document-solids.ts, packages/mcp/src/tools/sweep.ts, packages/mcp/src/tools/topopt.ts. 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 packages/app/src/components/StatusBar.tsx:123— `it.kind === "face" || it.kind === "edge" || it.kind === "vertex"` appears character-identically in 2 files — packages/app/src/components/StatusBar.tsx, packages/app/src/components/ViewportContent.tsx. 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 packages/app/public/launch/launch.js:125— `key[a] === key[b] || count.get(ek(a, b)) !== 1` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/public/launch/launch.js:322— `m.metalness < 0.05 && m.color.r > 0.55 && Math.abs(m.color.r - m.color.b) < 0.08 && /^(part|default)$/.test(m.name)` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/public/launch/launch.js:583— `m.normals && m.normals.length === m.positions.length` appears character-identically in 2 files — packages/app/public/launch/launch.js, packages/mcp/src/export/glb.ts. 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 packages/engine/src/evaluate.ts:162— `p.mesh.positions.length === 0 && i < visibleRoots.length` appears character-identically in 2 files — packages/engine/src/evaluate.ts, packages/engine/src/scene-convert.ts. 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 apple/VcadApp/scripts/vcad-app-discovery.mjs:88— `r.document_path && resolve(r.document_path) === abs` appears character-identically in 2 files — apple/VcadApp/scripts/vcad-app-discovery.mjs, packages/mcp/src/app-discovery.ts. 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 packages/app/src/components/ViewportContent.tsx:614— `scene.instances && scene.instances.length > 0` appears character-identically in 2 files — packages/app/src/components/ViewportContent.tsx, packages/app/src/hooks/useCameraControls.ts. 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 packages/app/src/components/electronics/PcbFootprintGroup.tsx:40— `selection.type === "trace" || selection.type === "via" || selection.type === "pad"` appears character-identically in 3 files — packages/app/src/components/electronics/PcbFootprintGroup.tsx, packages/app/src/components/electronics/SchematicCanvas.tsx, packages/app/src/components/electronics/pcb3d/PcbScene.tsx. 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 packages/app/public/launch/launch.js:109— `src.boundingBox.getSize(new THREE.Vector3()).length() || 1` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/public/launch/launch.js:327— `stitchTJunctions(o.geometry) || o.geometry` appears character-identically in 2 files — packages/app/public/launch/launch.js, www/public/kit/gallery.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
+ 15 more in this group — see findings.md.
P2 · Observability· Console output used as the logging channel · ×39
Console output used as the logging channel packages/app/src/lib/backfill.ts:61— `packages/app/src/lib/backfill.ts` reports through `console.*` at line 61 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/backfill.ts:90— `packages/app/src/lib/backfill.ts` reports through `console.*` at line 90 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/backfill.ts:96— `packages/app/src/lib/backfill.ts` reports through `console.*` at line 96 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/backfill.ts:103— `packages/app/src/lib/backfill.ts` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/backfill.ts:155— `packages/app/src/lib/backfill.ts` reports through `console.*` at line 155 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/browser-inference.ts:369— `packages/app/src/lib/browser-inference.ts` reports through `console.*` at line 369 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/crypto-polyfill.ts:16— `packages/app/src/lib/crypto-polyfill.ts` reports through `console.*` at line 16 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/open-document.ts:27— `packages/app/src/lib/open-document.ts` reports through `console.*` at line 27 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/save-load.ts:47— `packages/app/src/lib/save-load.ts` reports through `console.*` at line 47 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/lib/urdf-meshes.ts:297— `packages/app/src/lib/urdf-meshes.ts` reports through `console.*` at line 297 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useAppCommands.ts:514— `packages/app/src/hooks/useAppCommands.ts` reports through `console.*` at line 514 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useAutoSave.ts:38— `packages/app/src/hooks/useAutoSave.ts` reports through `console.*` at line 38 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useAutoSave.ts:88— `packages/app/src/hooks/useAutoSave.ts` reports through `console.*` at line 88 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useCircuitSim.ts:70— `packages/app/src/hooks/useCircuitSim.ts` reports through `console.*` at line 70 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useKeybindingPrefs.ts:49— `packages/app/src/hooks/useKeybindingPrefs.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useKeybindingPrefs.ts:54— `packages/app/src/hooks/useKeybindingPrefs.ts` reports through `console.*` at line 54 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useKeybindingPrefs.ts:68— `packages/app/src/hooks/useKeybindingPrefs.ts` reports through `console.*` at line 68 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/useOperationPreview.ts:147— `packages/app/src/hooks/useOperationPreview.ts` reports through `console.*` at line 147 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/usePhysicsSimulation.ts:53— `packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 53 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/usePhysicsSimulation.ts:126— `packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 126 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/usePhysicsSimulation.ts:130— `packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 130 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/hooks/usePhysicsSimulation.ts:257— `packages/app/src/hooks/usePhysicsSimulation.ts` reports through `console.*` at line 257 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/components/CommandPalette.tsx:233— `packages/app/src/components/CommandPalette.tsx` reports through `console.*` at line 233 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/components/CommandPalette.tsx:304— `packages/app/src/components/CommandPalette.tsx` reports through `console.*` at line 304 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/app/src/components/DrawingToolbar.tsx:74— `packages/app/src/components/DrawingToolbar.tsx` reports through `console.*` at line 74 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Silent fallback default on Err crates/vcad-ecad-parts/src/catalog.rs:274— `manifest_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-ecad-parts/src/jellybean.rs:287— `jellybean_manifest_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-ecad-symbols/src/kicad_board.rs:606— `footprint_keepouts` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-ffi/src/lib.rs:3662— `vcad_scene_write_mesh_bundle` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-ffi/src/lib.rs:3698— `vcad_mesh_bundle_import` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-ffi/src/recon.rs:905— `vcad_recon_poll` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:295— `evaluate_sheet_metal_chain` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:373— `check_sheet_metal` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:447— `cost_sheet_metal` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:502— `nest_sheet_metal_parts` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:546— `nested_sheet_metal_dxf` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:599— `sheet_metal_sequence` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:622— `get_sheet_metal_materials` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:631— `get_sheet_metal_shop_catalog` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:660— `get_sheet_metal_bend_table` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:1305— `sheet_metal_folded_step` turns every `Err` into `r#"{"step":"","error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel/src/sheet_json.rs:1430— `flatten_solid_to_sheet_metal` turns every `Err` into `r#"{"error":"serialize failed"}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/document_engine.rs:238— `get_document_json` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/document_engine.rs:279— `get_parts_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/document_engine.rs:298— `get_ordered_features_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/document_engine.rs:391— `compute_position_between` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/document_engine.rs:415— `get_sync_clock` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/document_engine.rs:429— `get_ops_since` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/keybindings.rs:93— `commands_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/vcad-kernel-wasm/src/keybindings.rs:148— `conflicts_json` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
redundant comment packages/app/src/App.tsx:847— "Find the cylinder part" repeats the code it sits on: 3 of its 3 words (find, cylinder, part) are already in `const cylinder = parts.find((p) => p.kind === "cylinder");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/CommandPalette.tsx:286— "Handle open file" repeats the code it sits on: 3 of its 3 words (handle, open, file) are already in `const handleOpenFile = useCallback(() =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/CommandPalette.tsx:291— "Handle file input change" repeats the code it sits on: 4 of its 4 words (handle, file, input, change) are already in `const handleFileChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/DocumentPicker.tsx:283— "Get storage usage" repeats the code it sits on: 3 of its 3 words (get, storage, usage) are already in `const usage = await getStorageUsage();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/FeatureTree.tsx:1072— "Build map of child instance -> joint" repeats the code it sits on: 4 of its 5 words (map, child, instance, joint) are already in `const jointByChild = useMemo(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/SketchPlane3D.tsx:945— "Handle pointer leave" repeats the code it sits on: 3 of its 3 words (handle, pointer, leave) are already in `const handlePointerLeave = useCallback(() =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/ViewportContent.tsx:438— "Camera settings from store" repeats the code it sits on: 3 of its 3 words (camera, settings, store) are already in `const cameraSettings = useCameraSettingsStore();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/ViewportContent.tsx:1109— "Check if trackpad orbit is enabled for this scheme" repeats the code it sits on: 5 of its 5 words (check, trackpad, orbit, enabled, scheme) are already in `const useTrackpadOrbit =`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/ViewportContent.tsx:1655— "Get effective scene settings" repeats the code it sits on: 4 of its 4 words (get, effective, scene, settings) are already in `const sceneSettings = useMemo(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/cam/CamPanel.tsx:25— "Check if CAM functions are available" repeats the code it sits on: 4 of its 4 words (check, cam, functions, available) are already in `if (typeof (wasm as Record<string, unknown>).isCamAvailable !== "function")`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/cam/CamPanel.tsx:96— "Check if CAM is available" repeats the code it sits on: 3 of its 3 words (check, cam, available) are already in `if (!camWasm.isCamAvailable())`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/cam/CamPanel.tsx:101— "Create WASM settings" repeats the code it sits on: 3 of its 3 words (create, wasm, settings) are already in `const wasmSettings = new camWasm.WasmCamSettings();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/app/src/components/ui/notifications/AIProgressCard.tsx:92— "Find current stage" repeats the code it sits on: 3 of its 3 words (find, current, stage) are already in `const currentStage = progress.stages.find((s) => s.status === "running");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/mcp/src/__tests__/accept-9.test.ts:124— "check_enclosure_fit told which part is the case…" repeats the code it sits on: 5 of its 6 words (check, enclosure, fit, part, case) are already in `const fit = await call("check_enclosure_fit", { document_id: id, enclosure_document_id: id, enclosure_part_id: casePart …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/mcp/src/__tests__/ecad.test.ts:2203— "On-board placement is clean." repeats the code it sits on: 3 of its 3 words (board, placement, clean) are already in `expect((await summarizePlacementDrc(board)).clean).toBe(true);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/mcp/src/tools/inspect.ts:218— "Weight centroid by volume" repeats the code it sits on: 3 of its 3 words (weight, centroid, volume) are already in `weightedCx += props.centroid.x * props.volume;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/mcp/src/tools/next-actions.ts:198— "Floor: inspect current state, then retry with corrected arguments." repeats the code it sits on: 6 of its 7 words (inspect, current, state, retry, corrected, arguments) are already in `return [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/training/src/generators/flange.ts:164— "Add center hole" repeats the code it sits on: 3 of its 3 words (add, center, hole) are already in `baseIdx = this.addCenterHole(lines, baseIdx, p);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/training/src/generators/flange.ts:167— "Add bolt holes" repeats the code it sits on: 3 of its 3 words (add, bolt, holes) are already in `baseIdx = this.addBoltHoles(lines, baseIdx, p);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/training/src/generators/mount.ts:179— "Add center hole" repeats the code it sits on: 3 of its 3 words (add, center, hole) are already in `baseIdx = this.addCenterHole(lines, baseIdx, p);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/wasmosis/src/__tests__/registry.test.ts:192— "Mock WebAssembly.instantiate" repeats the code it sits on: 4 of its 4 words (mock, web, assembly, instantiate) are already in `const mockMemory = new WebAssembly.Memory({ initial: 1 });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/wasmosis/src/crate-generator.ts:151— "Generate Cargo.toml" repeats the code it sits on: 3 of its 3 words (generate, cargo, toml) are already in `const cargoToml = generateCargoToml({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/wasmosis/src/crate-generator.ts:160— "Generate REDACTED" repeats the code it sits on: 3 of its 3 words (generate, lib, rs) are already in `const libRs = generateLibRs({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/wasmosis/src/splitter.ts:300— "Check if wasm-split is available" repeats the code it sits on: 4 of its 4 words (check, wasm, split, available) are already in `if (!checkWasmSplitAvailable())`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment scripts/sync-version.mjs:69— "Update Cargo.toml workspace version" repeats the code it sits on: 4 of its 5 words (update, cargo, toml, version) are already in `function updateCargoToml(version)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
+ 1 more in this group — see findings.md.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×10
Projects may be oversized for their cohesion packages/app/package.json:1— `packages/app` (58733 LoC, 415 module-visible types across 25 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion packages/mcp/package.json:1— `packages/mcp` (57408 LoC, 296 module-visible types across 9 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/vcad-ecad-pcb/Cargo.toml:1— `crates/vcad-ecad-pcb` (50477 LoC, 183 module-visible types across 3 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion apple/VcadApp/Package.swift:1— `apple/VcadApp` (47798 LoC, 736 module-visible types across 7 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/vcad-eval/Cargo.toml:1— `crates/vcad-eval` (19084 LoC, 130 module-visible types across 2 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/vcad-ir/Cargo.toml:1— `crates/vcad-ir` (18964 LoC, 206 module-visible types across 2 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion packages/engine/package.json:1— `packages/engine` (10752 LoC, 266 module-visible types across 1 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion packages/docs/package.json:1— `packages/docs` (6290 LoC, 72 module-visible types across 22 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion packages/core/package.json:1— `packages/core` (13165 LoC, 201 module-visible types across 9 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion apple/VcadVision/Package.swift:1— `apple/VcadVision` (10717 LoC, 122 module-visible types across 2 directories) overshoots its size bounds. 10 of 118 build unit(s) (Cargo, Python, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Silent fallback default in catch apple/VcadApp/Sources/VcadApp/DocumentEngine.swift:224— `send` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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 at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch packages/app/src/components/DrawingView.tsx:301— `DrawingView` 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 packages/app/src/hooks/useFieldBinding.ts:58— `useFieldBinding.validateExpression` swallows every exception into `return "parameters do not resolve (cycle?)"` — 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 packages/core/src/command-actions.ts:94— `createDefaultCommandActions.canUndo` swallows every exception into `return false` — 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 packages/core/src/command-actions.ts:101— `createDefaultCommandActions.canRedo` swallows every exception into `return false` — 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 packages/engine/src/sheet-metal.ts:630— `getSheetMetalMaterials` 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 packages/kernel-wasm/vcad_kernel_wasm.js:11453— `debugString` swallows every exception into `return 'Object'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/mcp/scripts/serve.mjs:38— `sourceFingerprint` swallows every exception into `return "none"` — 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 packages/mcp/src/tools/artifact-store.ts:101— `publicBaseUrl` 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.
Subsumed condition operand crates/vcad-ecad-symbols/src/footprint.rs:2022— `base.contains("TSOT-23")` can never decide this `||` — every value satisfying `base.contains("TSOT-23")` also satisfies `base.contains("SOT-23")`, 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 crates/vcad-ecad-symbols/src/footprint.rs:2074— `base.contains("DHVQFN")` can never decide this `||` — every value satisfying `base.contains("DHVQFN")` also satisfies `base.contains("QFN")`, 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 crates/vcad-ecad-symbols/src/kicad_write.rs:3436— `t.contains("uvia_")` can never decide this `||` — every value satisfying `t.contains("uvia_")` also satisfies `t.contains("via_")`, 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 crates/vcad-cli/src/ui/tree.rs:185— `lower.contains("cylinder")` can never decide this `||` — every value satisfying `lower.contains("cylinder")` also satisfies `lower.contains("cyl")`, 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 apple/VcadApp/Sources/VcadApp/ElectronicsSchematicLayer.swift:24— `ref.hasPrefix("DB")` can never decide this `||` — every value satisfying `ref.hasPrefix("DB")` also satisfies `ref.hasPrefix("D")`, 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.
Unused export 'default' packages/app/src/components/electronics/CircuitTabTools.tsx:357— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' packages/app/src/components/electronics/pcb3d/PcbComponentBodies3D.tsx:80— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' packages/app/src/components/electronics/pcb3d/PcbKernelBoard.tsx:300— Nothing imports this binding — it is safe to review for removal.
X7 · Silent fallback defaults· Pending state with no failure state · ×3
Pending state with no failure state packages/app/src/components/DocumentPicker.tsx:168— The view draws `Downloading...` under `isDownloading`, but `isDownloading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state packages/app/src/components/DocumentPicker.tsx:208— The view draws `<SpinnerGap size= class="text-brand animate-spin"/>` under `isDownloading`, but `isDownloading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state packages/app/src/components/DocumentPicker.tsx:457— The view draws `Loading...` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
D21 · Naming Consistency· `baseURL` spells `URL` where 22 names in the project spell it `Url` · ×2
`baseURL` spells `URL` where 22 names in the project spell it `Url` packages/training/src/annotate.ts:108— 22 of 24 names in project repository spell the token `Url` (22 of 24; unit: names in project repository containing `Url`). Peers: GatewayDirectConfig.baseUrl (mecheval/harness/src/solvers/gateway-direct.ts:29); GatewayMcpConfig.baseUrl (mecheval/harness/src/solvers/gateway-mcp.ts:33); WaferDirectConfig.baseUrl (mecheval/harness/src/solvers/wafer-direct.ts:21); useUrlSync.useUrlSync (packages/app/src/hooks/useUrlSync.ts:42); bootstrap.resolveWasmUrl (packages/app/src/lib/bootstrap.ts:142). Rename to `baseUrl`. [rule N6]
`baseURL` spells `URL` where 22 names in the project spell it `Url` packages/training/src/infer.ts:112— 22 of 24 names in project repository spell the token `Url` (22 of 24; unit: names in project repository containing `Url`). Peers: GatewayDirectConfig.baseUrl (mecheval/harness/src/solvers/gateway-direct.ts:29); GatewayMcpConfig.baseUrl (mecheval/harness/src/solvers/gateway-mcp.ts:33); WaferDirectConfig.baseUrl (mecheval/harness/src/solvers/wafer-direct.ts:21); useUrlSync.useUrlSync (packages/app/src/hooks/useUrlSync.ts:42); bootstrap.resolveWasmUrl (packages/app/src/lib/bootstrap.ts:142). Rename to `baseUrl`. [rule N6]
README/code drift packages/training/README.md:253— packages/training/README.md links to `../../docs/features/vcode.md`, but `docs/features/vcode.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/training/README.md:254— packages/training/README.md links to `../../docs/features/text-to-cad.md`, but `docs/features/text-to-cad.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
M2 · Architecture documentation· ADRs not easily discoverable · ×1
ADRs not easily discoverable — 2 ADR-shaped document(s) detected by content — `docs/design/stdlib-and-social.md`, `docs/plans/timeline-editing.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
Logging is not universal — Only 7/20 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/vcad-kernel-constraints`, `crates/vcad-mcp`, `crates/vcad-render`, `crates/vcad-torture` and 8 more.
P3 · Security & performance tooling· Dependabot does not watch pip · ×1
Dependabot does not watch pip REDACTED:12— `REDACTED` schedules updates, but no `package-ecosystem` entry covers `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
Unused export 'colors' REDACTED:70— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'RayTracedViewport' · ×1
Unused export 'RayTracedViewport' packages/app/src/components/RayTracedViewport.tsx:867— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'buildTraceMatrix' · ×1
Unused export 'buildTraceMatrix' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:82— Nothing imports this binding — it is safe to review for removal.
Unused export 'padShapeType' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:116— Nothing imports this binding — it is safe to review for removal.
Unused export 'padRadius' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:121— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'padDimensions' · ×1
Unused export 'padDimensions' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:136— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'viaOuterRadius' · ×1
Unused export 'viaOuterRadius' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:153— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'viaDrillRadius' · ×1
Unused export 'viaDrillRadius' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:157— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'copperLayerIndex' · ×1
Unused export 'copperLayerIndex' packages/app/src/components/electronics/pcb3d/pcb-geometry.ts:198— Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 2/16 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/accept-6.test.ts:178— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/accept-6.test.ts:185— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/accept-6.test.ts:193— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/animate.test.ts:314— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/animate.test.ts:337— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/animate.test.ts:353— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/claims-ledger.test.ts:190— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/flow-tools.test.ts:56— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/render-verify.test.ts:247— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/render-verify.test.ts:266— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/structure-tools.test.ts:129— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/structure-tools.test.ts:172— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/structure-tools.test.ts:201— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/structure-tools.test.ts:222— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/mcp/src/__tests__/structure-tools.test.ts:248— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): search_parts finds CF hardware by synonym packages/mcp/src/__tests__/vacuum-parts.test.ts:28— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): describe_part returns ports and sourced metadata packages/mcp/src/__tests__/vacuum-parts.test.ts:34— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): HV feedthrough echoes its rating and suggests a clearance packages/mcp/src/__tests__/vacuum-parts.test.ts:47— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): embroideryDesignToMesh matches embroideryPatternToMesh packages/engine/src/__tests__/kernel-mesh-parity.test.ts:68— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): transformMeshBuffers matches transformMesh (multi-axis rotation) packages/engine/src/__tests__/kernel-mesh-parity.test.ts:81— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): transformMeshBuffers without normals returns no normals packages/engine/src/__tests__/kernel-mesh-parity.test.ts:101— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Off the main sequence: vcad-kernel-calibration — vcad-kernel-calibration: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-cost — vcad-kernel-cost: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-enclosure — vcad-kernel-enclosure: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-export — vcad-kernel-export: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-gpu — vcad-kernel-gpu: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-math — vcad-kernel-math: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-qcd — vcad-kernel-qcd: abstractness 0.05, instability 0.00, distance 0.95 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-topo — vcad-kernel-topo: abstractness 0.00, instability 0.05, distance 0.95 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-cam — vcad-kernel-cam: abstractness 0.02, instability 0.14, distance 0.83 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-primitives — vcad-kernel-primitives: abstractness 0.00, instability 0.17, distance 0.83 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-tessellate — vcad-kernel-tessellate: abstractness 0.04, instability 0.17, distance 0.80 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-em — vcad-kernel-em: abstractness 0.00, instability 0.25, distance 0.75 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-neutronics — vcad-kernel-neutronics: abstractness 0.00, instability 0.25, distance 0.75 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-thermal — vcad-kernel-thermal: abstractness 0.00, instability 0.25, distance 0.75 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: vcad-kernel-geom — vcad-kernel-geom: abstractness 0.21, instability 0.05, distance 0.74 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
doc comments repeat the names packages/app/src/components/TransformGizmo.tsx:26— 0 of 6 documented parameters and 15 of 664 summaries in `@vcad/app` only repeat the member or parameter name (e.g. "Kernel (x,y,z) Z-up → display (x,z,-y) Y-up" for `kernelToDisplay`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/core/src/logger.ts:188— 4 of 8 documented parameters and 6 of 482 summaries in `@vcad/core` only repeat the member or parameter name (e.g. "Get all entries." for `getEntries`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/engine/src/ecad.ts:905— 0 of 21 documented parameters and 12 of 905 summaries in `@vcad/engine` only repeat the member or parameter name (e.g. "Result of ." for `RouteAllResult`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/ir/src/index.ts:754— 0 of 0 documented parameters and 5 of 44 summaries in `@vcad/ir` only repeat the member or parameter name (e.g. "Format a string with quotes." for `formatQuotedString`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/mcp/src/export/glb.ts:103— 0 of 0 documented parameters and 3 of 1641 summaries in `@vcad/mcp` only repeat the member or parameter name (e.g. "Clearcoat roughness 0..1." for `clearcoatRoughness`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/training/src/annotate.ts:18— 0 of 18 documented parameters and 17 of 218 summaries in `@vcad/training` only repeat the member or parameter name (e.g. "Default Ollama model." for `DEFAULT_OLLAMA_MODEL`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/wasmosis/src/manifest.ts:41— 0 of 0 documented parameters and 3 of 157 summaries in `wasmosis` only repeat the member or parameter name (e.g. "Modules" for `modules`). Delete the restating tags, or add what the name does not say.
Outdated: sparkle — `sparkle` is resolved at 2.10.0, but 2.10.1 is the newest release tagged on https://github.com/sparkle-project/Sparkle within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update sparkle` reaches this one with no change to Package.swift.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 36 file(s) — `apple/VcadApp/Sources/VcadApp/AgentCore.swift`, `apple/VcadApp/Sources/VcadApp/AgentInstall.swift`, `apple/VcadApp/Sources/VcadApp/AgentViewerHTML.swift`, `apple/VcadApp/Sources/VcadApp/CNC.swift`, `apple/VcadApp/Sources/VcadApp/CNCCommands.swift`, … (+31 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — 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 01a1e6bd-0b36-732d-92aa-759d5000418c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 239 · Warnings: 5383 · Recommendations: 193 · Info: 44 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 23:41 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.