Public report of PerryTS/perry, published 28 October 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.10.5). 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, 28 October 2026, 14:00 UTC · Survey ID cd_83d2f99b21c641d1a64996d93ac88d5f
PerryTS/perry
Measured 28 October 2026, 11:38 UTC, at code version 3c402d5
Regression: 2 dimensions fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAt riskDown 1 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 2,405,466 lines of product code in 97 projects, tests not counted · Estimated rebuild effort: about 17.5 person-years · Weakest lens: Security and Compliance, 36
Findings by how serious they are
1477 critical10533 serious1955 minor
14 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 11:38 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 Watchdog. It is open to any tool that
implements it, and today Watchdog 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. Watchdog works 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 ▸
89of 89 dimensions measured by tools.
13929of 13965 findings point to an exact file and line, so you can open each one in the code. The other 36 concern the repository as a whole, such as missing documentation.
89dimensions across 8 lenses, read from 2,405,466 lines of product code in 97 projects.
PerryTS/perry is rated At risk because critical security findings are open, most of them leaked passwords or keys. Its score is held back because it has passwords or keys in the code's history and security weaknesses in the code. It scores 46 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Security and Compliance, at 36, is the weakest lens and counts most in the score. The best first steps are replacing the nine exposed passwords or keys and switching the old ones off and restoring certificate checks, each worth about 8 points. Raising Security and Compliance to 68 would lift the score to about 53.
1,394 passwords or keys in the code's history, and nine in the code are open to anyone who can read the repository. Eighteen weaknesses in the code could be used by an attacker, and twelve places in the code run text as code, which an attacker could use. Replacing each exposed password or key, fixing the weaknesses the scanner points to and replacing text run as code with direct calls would close these risks. The ten unsafe settings in infrastructure or container files need changing to safe values. The seven pipeline steps that run downloads without checking them need each download checked against a known checksum first. The nine uses of packages that aren't listed need adding to the project's list of dependencies.
The product code is 2,405,466 lines, about €2,600,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 Security and Compliance rose from 36 to 68, the lowest score rated Strong, the score would rise from 46 to about 53.
Code composition: what the lines of code are
Product code 84%Tests 16%
New since the last survey: 1892 findings
These 1892 critical or serious findings weren't in the previous survey, on 14 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 1257 findings
These 1257 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one. The first 100 are listed here.
€850,000 to €4,300,000, for 14,122 to 44,800 hours of work, about 17.5 person-years for 10 to 34 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 46. 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: 2,405,466 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: Watchdog prices 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 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
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 €2,600,000 to build again, about 17.5 person-years of work. Its weakest lens is Security and Compliance, at 36 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for low effort, because it clears the 9 REDACTED 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.9 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 11,847,540 lines over the last 90 days, which is about 48,048,357 lines a year. At that pace, the extra work comes to an estimated 6437.8 to 38627.1 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 Watchdog's 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.
4293 modules, with 7232 dependencies between them. 14 loops run through 340 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 4253 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.
perry_codegen.block uses perry_codegen.codegen.opts, so a change to perry_codegen.codegen.opts can break perry_codegen.block, while a change to perry_codegen.block can't break perry_codegen.codegen.opts.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
perry_hir.ir.stmt uses perry_hir.ir.expr, so a change to perry_hir.ir.expr can break perry_hir.ir.stmt, while a change to perry_hir.ir.stmt can't break perry_hir.ir.expr.
Position
Below the diagonal: perry_hir.ir.stmt uses a module listed above it, which is the healthy direction.
turnloop.types uses perry_abi.component_io, so a change to perry_abi.component_io can break turnloop.types, while a change to turnloop.types can't break perry_abi.component_io.
Position
Below the diagonal: turnloop.types uses a module listed above it, which is the healthy direction.
turnloop.types uses turnloop.time.web, so a change to turnloop.time.web can break turnloop.types, while a change to turnloop.types can't break turnloop.time.web.
Position
Below the diagonal: turnloop.types uses a module listed above it, which is the healthy direction.
16→32 windows_reactor.core.modifiers uses windows_reactor.bindingspart of a loop✕
Connections
5 pairs of types, where a type in windows_reactor.core.modifiers uses a type in windows_reactor.bindings.
windows_reactor.core.modifiers uses windows_reactor.bindings, so a change to windows_reactor.bindings can break windows_reactor.core.modifiers, while a change to windows_reactor.core.modifiers can't break windows_reactor.bindings.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
perry_codegen.expr uses perry_hir.ir.expr, so a change to perry_hir.ir.expr can break perry_codegen.expr, while a change to perry_codegen.expr can't break perry_hir.ir.expr.
Position
Below the diagonal: perry_codegen.expr uses a module listed above it, which is the healthy direction.
perry_codegen.expr uses perry_codegen.block, so a change to perry_codegen.block can break perry_codegen.expr, while a change to perry_codegen.expr can't break perry_codegen.block.
Position
Below the diagonal: perry_codegen.expr uses a module listed above it, which is the healthy direction.
17→20 perry_codegen.expr uses perry_codegen.codegen.optspart of a loop✕
Connections
2 pairs of types, where a type in perry_codegen.expr uses a type in perry_codegen.codegen.opts.
perry_codegen.expr uses perry_codegen.codegen.opts, so a change to perry_codegen.codegen.opts can break perry_codegen.expr, while a change to perry_codegen.expr can't break perry_codegen.codegen.opts.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
perry_codegen.module uses perry_runtime.box, so a change to perry_runtime.box can break perry_codegen.module, while a change to perry_codegen.module can't break perry_runtime.box.
Position
Below the diagonal: perry_codegen.module uses a module listed above it, which is the healthy direction.
perry_codegen.module uses perry_codegen.block, so a change to perry_codegen.block can break perry_codegen.module, while a change to perry_codegen.module can't break perry_codegen.block.
Position
Below the diagonal: perry_codegen.module uses a module listed above it, which is the healthy direction.
perry_hir.ir.decl uses perry_hir.ir.expr, so a change to perry_hir.ir.expr can break perry_hir.ir.decl, while a change to perry_hir.ir.decl can't break perry_hir.ir.expr.
Position
Below the diagonal: perry_hir.ir.decl uses a module listed above it, which is the healthy direction.
perry_hir.ir.decl uses perry_hir.types, so a change to perry_hir.types can break perry_hir.ir.decl, while a change to perry_hir.ir.decl can't break perry_hir.types.
Position
Below the diagonal: perry_hir.ir.decl uses a module listed above it, which is the healthy direction.
perry_hir.ir.decl uses perry_hir.ir.stmt, so a change to perry_hir.ir.stmt can break perry_hir.ir.decl, while a change to perry_hir.ir.decl can't break perry_hir.ir.stmt.
Position
Below the diagonal: perry_hir.ir.decl uses a module listed above it, which is the healthy direction.
perry_codegen.codegen.opts uses perry_hir.types, so a change to perry_hir.types can break perry_codegen.codegen.opts, while a change to perry_codegen.codegen.opts can't break perry_hir.types.
Position
Below the diagonal: perry_codegen.codegen.opts uses a module listed above it, which is the healthy direction.
perry_codegen.codegen.opts uses perry_codegen.expr, so a change to perry_codegen.expr can break perry_codegen.codegen.opts, while a change to perry_codegen.codegen.opts can't break perry_codegen.expr.
Position
Below the diagonal: perry_codegen.codegen.opts uses a module listed above it, which is the healthy direction.
perry_codegen.fallback_diag uses perry_hir.ir.expr, so a change to perry_hir.ir.expr can break perry_codegen.fallback_diag, while a change to perry_codegen.fallback_diag can't break perry_hir.ir.expr.
Position
Below the diagonal: perry_codegen.fallback_diag uses a module listed above it, which is the healthy direction.
perry_codegen.fallback_diag uses perry_codegen.expr, so a change to perry_codegen.expr can break perry_codegen.fallback_diag, while a change to perry_codegen.fallback_diag can't break perry_codegen.expr.
Position
Below the diagonal: perry_codegen.fallback_diag uses a module listed above it, which is the healthy direction.
perry_hir.ir.module uses perry_gc_effects.table, so a change to perry_gc_effects.table can break perry_hir.ir.module, while a change to perry_hir.ir.module can't break perry_gc_effects.table.
Position
Below the diagonal: perry_hir.ir.module uses a module listed above it, which is the healthy direction.
perry_hir.ir.module uses perry_hir.ir.stmt, so a change to perry_hir.ir.stmt can break perry_hir.ir.module, while a change to perry_hir.ir.module can't break perry_hir.ir.stmt.
Position
Below the diagonal: perry_hir.ir.module uses a module listed above it, which is the healthy direction.
perry_hir.ir.module uses perry_hir.ir.decl, so a change to perry_hir.ir.decl can break perry_hir.ir.module, while a change to perry_hir.ir.module can't break perry_hir.ir.decl.
Position
Below the diagonal: perry_hir.ir.module uses a module listed above it, which is the healthy direction.
perry.commands.compile.types uses perry_codegen.codegen.opts, so a change to perry_codegen.codegen.opts can break perry.commands.compile.types, while a change to perry.commands.compile.types can't break perry_codegen.codegen.opts.
Position
Below the diagonal: perry.commands.compile.types uses a module listed above it, which is the healthy direction.
perry_component_io.resource uses perry_codegen.fallback_diag, so a change to perry_codegen.fallback_diag can break perry_component_io.resource, while a change to perry_component_io.resource can't break perry_codegen.fallback_diag.
Position
Below the diagonal: perry_component_io.resource uses a module listed above it, which is the healthy direction.
24→29 perry_component_io.resource uses perry_component_host.driver.requestspart of a loop✕
Connections
3 pairs of types, where a type in perry_component_io.resource uses a type in perry_component_host.driver.requests.
perry_component_io.resource uses perry_component_host.driver.requests, so a change to perry_component_host.driver.requests can break perry_component_io.resource, while a change to perry_component_io.resource can't break perry_component_host.driver.requests.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
perry_hir.lower.lowering_context uses perry_gc_effects.table, so a change to perry_gc_effects.table can break perry_hir.lower.lowering_context, while a change to perry_hir.lower.lowering_context can't break perry_gc_effects.table.
Position
Below the diagonal: perry_hir.lower.lowering_context uses a module listed above it, which is the healthy direction.
perry_hir.lower.lowering_context uses perry_hir.ir.expr, so a change to perry_hir.ir.expr can break perry_hir.lower.lowering_context, while a change to perry_hir.lower.lowering_context can't break perry_hir.ir.expr.
Position
Below the diagonal: perry_hir.lower.lowering_context uses a module listed above it, which is the healthy direction.
perry_hir.lower.lowering_context uses perry_hir.types, so a change to perry_hir.types can break perry_hir.lower.lowering_context, while a change to perry_hir.lower.lowering_context can't break perry_hir.types.
Position
Below the diagonal: perry_hir.lower.lowering_context uses a module listed above it, which is the healthy direction.
perry_hir.lower.lowering_context uses perry_hir.ir.stmt, so a change to perry_hir.ir.stmt can break perry_hir.lower.lowering_context, while a change to perry_hir.lower.lowering_context can't break perry_hir.ir.stmt.
Position
Below the diagonal: perry_hir.lower.lowering_context uses a module listed above it, which is the healthy direction.
perry_hir.lower.lowering_context uses perry_hir.ir.decl, so a change to perry_hir.ir.decl can break perry_hir.lower.lowering_context, while a change to perry_hir.lower.lowering_context can't break perry_hir.ir.decl.
Position
Below the diagonal: perry_hir.lower.lowering_context uses a module listed above it, which is the healthy direction.
perry_hir.lower.lowering_context uses perry_codegen.codegen.opts, so a change to perry_codegen.codegen.opts can break perry_hir.lower.lowering_context, while a change to perry_hir.lower.lowering_context can't break perry_codegen.codegen.opts.
Position
Below the diagonal: perry_hir.lower.lowering_context uses a module listed above it, which is the healthy direction.
perry.commands.compile.collect_modules.source_prep uses perry_hir.ir.module, so a change to perry_hir.ir.module can break perry.commands.compile.collect_modules.source_prep, while a change to perry.commands.compile.collect_modules.source_prep can't break perry_hir.ir.module.
Position
Below the diagonal: perry.commands.compile.collect_modules.source_prep uses a module listed above it, which is the healthy direction.
perry.commands.compile.collect_modules.source_prep uses perry.commands.compile.types, so a change to perry.commands.compile.types can break perry.commands.compile.collect_modules.source_prep, while a change to perry.commands.compile.collect_modules.source_prep can't break perry.commands.compile.types.
Position
Below the diagonal: perry.commands.compile.collect_modules.source_prep uses a module listed above it, which is the healthy direction.
perry_codegen.collectors.read_before_write uses perry_hir.ir.expr, so a change to perry_hir.ir.expr can break perry_codegen.collectors.read_before_write, while a change to perry_codegen.collectors.read_before_write can't break perry_hir.ir.expr.
Position
Below the diagonal: perry_codegen.collectors.read_before_write uses a module listed above it, which is the healthy direction.
perry_codegen.collectors.read_before_write uses perry_hir.ir.stmt, so a change to perry_hir.ir.stmt can break perry_codegen.collectors.read_before_write, while a change to perry_codegen.collectors.read_before_write can't break perry_hir.ir.stmt.
Position
Below the diagonal: perry_codegen.collectors.read_before_write uses a module listed above it, which is the healthy direction.
perry_codegen.collectors.read_before_write uses perry.commands.compile.collect_modules.source_prep, so a change to perry.commands.compile.collect_modules.source_prep can break perry_codegen.collectors.read_before_write, while a change to perry_codegen.collectors.read_before_write can't break perry.commands.compile.collect_modules.source_prep.
Position
Below the diagonal: perry_codegen.collectors.read_before_write uses a module listed above it, which is the healthy direction.
perry_runtime.wasi_net uses turnloop.time.web, so a change to turnloop.time.web can break perry_runtime.wasi_net, while a change to perry_runtime.wasi_net can't break turnloop.time.web.
Position
Below the diagonal: perry_runtime.wasi_net uses a module listed above it, which is the healthy direction.
perry_runtime.wasi_net uses perry.commands.compile.collect_modules.source_prep, so a change to perry.commands.compile.collect_modules.source_prep can break perry_runtime.wasi_net, while a change to perry_runtime.wasi_net can't break perry.commands.compile.collect_modules.source_prep.
Position
Below the diagonal: perry_runtime.wasi_net uses a module listed above it, which is the healthy direction.
perry_component_host.driver.requests uses perry_abi.component_io, so a change to perry_abi.component_io can break perry_component_host.driver.requests, while a change to perry_component_host.driver.requests can't break perry_abi.component_io.
Position
Below the diagonal: perry_component_host.driver.requests uses a module listed above it, which is the healthy direction.
perry_component_host.driver.requests uses perry_component_io.resource, so a change to perry_component_io.resource can break perry_component_host.driver.requests, while a change to perry_component_host.driver.requests can't break perry_component_io.resource.
Position
Below the diagonal: perry_component_host.driver.requests uses a module listed above it, which is the healthy direction.
perry_component_host.driver.requests uses perry.commands.compile.collect_modules.source_prep, so a change to perry.commands.compile.collect_modules.source_prep can break perry_component_host.driver.requests, while a change to perry_component_host.driver.requests can't break perry.commands.compile.collect_modules.source_prep.
Position
Below the diagonal: perry_component_host.driver.requests uses a module listed above it, which is the healthy direction.
perry_component_host.driver.requests uses perry_codegen.collectors.read_before_write, so a change to perry_codegen.collectors.read_before_write can break perry_component_host.driver.requests, while a change to perry_component_host.driver.requests can't break perry_codegen.collectors.read_before_write.
Position
Below the diagonal: perry_component_host.driver.requests uses a module listed above it, which is the healthy direction.
perry_ffi.handle uses perry_runtime.box, so a change to perry_runtime.box can break perry_ffi.handle, while a change to perry_ffi.handle can't break perry_runtime.box.
Position
Below the diagonal: perry_ffi.handle uses a module listed above it, which is the healthy direction.
perry_ffi.handle uses turnloop.time.web, so a change to turnloop.time.web can break perry_ffi.handle, while a change to perry_ffi.handle can't break turnloop.time.web.
Position
Below the diagonal: perry_ffi.handle uses a module listed above it, which is the healthy direction.
perry_ffi.handle uses perry_runtime.wasi_net, so a change to perry_runtime.wasi_net can break perry_ffi.handle, while a change to perry_ffi.handle can't break perry_runtime.wasi_net.
Position
Below the diagonal: perry_ffi.handle uses a module listed above it, which is the healthy direction.
perry_runtime.gc.roots uses perry_codegen.collectors.read_before_write, so a change to perry_codegen.collectors.read_before_write can break perry_runtime.gc.roots, while a change to perry_runtime.gc.roots can't break perry_codegen.collectors.read_before_write.
Position
Below the diagonal: perry_runtime.gc.roots uses a module listed above it, which is the healthy direction.
33 pairs of types, where a type in windows_reactor.bindings uses a type in windows_reactor.core.modifiers. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
windows_reactor.bindings uses windows_reactor.core.modifiers, so a change to windows_reactor.core.modifiers can break windows_reactor.bindings, while a change to windows_reactor.bindings can't break windows_reactor.core.modifiers.
Position
Below the diagonal: windows_reactor.bindings uses a module listed above it, which is the healthy direction.
489 pairs of types, where a type in windows_reactor.bindings uses a type in perry_hir.ir.decl. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
windows_reactor.bindings uses perry_hir.ir.decl, so a change to perry_hir.ir.decl can break windows_reactor.bindings, while a change to windows_reactor.bindings can't break perry_hir.ir.decl.
Position
Below the diagonal: windows_reactor.bindings uses a module listed above it, which is the healthy direction.
191 pairs of types, where a type in windows_reactor.bindings uses a type in perry_codegen.collectors.read_before_write. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
windows_reactor.bindings uses perry_codegen.collectors.read_before_write, so a change to perry_codegen.collectors.read_before_write can break windows_reactor.bindings, while a change to windows_reactor.bindings can't break perry_codegen.collectors.read_before_write.
Position
Below the diagonal: windows_reactor.bindings uses a module listed above it, which is the healthy direction.
perry_component_host uses perry_abi.component_io, so a change to perry_abi.component_io can break perry_component_host, while a change to perry_component_host can't break perry_abi.component_io.
Position
Below the diagonal: perry_component_host uses a module listed above it, which is the healthy direction.
perry_component_host uses perry.commands.compile.collect_modules.source_prep, so a change to perry.commands.compile.collect_modules.source_prep can break perry_component_host, while a change to perry_component_host can't break perry.commands.compile.collect_modules.source_prep.
Position
Below the diagonal: perry_component_host uses a module listed above it, which is the healthy direction.
perry_component_host uses perry_component_host.driver.requests, so a change to perry_component_host.driver.requests can break perry_component_host, while a change to perry_component_host can't break perry_component_host.driver.requests.
Position
Below the diagonal: perry_component_host uses a module listed above it, which is the healthy direction.
perry_runtime.gc.roots.runtime_handles uses perry_runtime.box, so a change to perry_runtime.box can break perry_runtime.gc.roots.runtime_handles, while a change to perry_runtime.gc.roots.runtime_handles can't break perry_runtime.box.
Position
Below the diagonal: perry_runtime.gc.roots.runtime_handles uses a module listed above it, which is the healthy direction.
perry_runtime.gc.roots.runtime_handles uses perry_runtime.gc.roots, so a change to perry_runtime.gc.roots can break perry_runtime.gc.roots.runtime_handles, while a change to perry_runtime.gc.roots.runtime_handles can't break perry_runtime.gc.roots.
Position
Below the diagonal: perry_runtime.gc.roots.runtime_handles uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses perry_abi.component_io, so a change to perry_abi.component_io can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break perry_abi.component_io.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses perry_runtime.box, so a change to perry_runtime.box can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break perry_runtime.box.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses turnloop.time.web, so a change to turnloop.time.web can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break turnloop.time.web.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses turnloop.types, so a change to turnloop.types can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break turnloop.types.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses perry_codegen.collectors.read_before_write, so a change to perry_codegen.collectors.read_before_write can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break perry_codegen.collectors.read_before_write.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses perry_runtime.wasi_net, so a change to perry_runtime.wasi_net can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break perry_runtime.wasi_net.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
turnloop.backend.iocp uses perry_component_host.driver.requests, so a change to perry_component_host.driver.requests can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break perry_component_host.driver.requests.
Position
Below the diagonal: turnloop.backend.iocp uses a module listed above it, which is the healthy direction.
35→38 turnloop.backend.iocp uses turnloop.backendpart of a loop✕
Connections
3 pairs of types, where a type in turnloop.backend.iocp uses a type in turnloop.backend.
turnloop.backend.iocp uses turnloop.backend, so a change to turnloop.backend can break turnloop.backend.iocp, while a change to turnloop.backend.iocp can't break turnloop.backend.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
windows_reactor.core.element uses windows_reactor.core.modifiers, so a change to windows_reactor.core.modifiers can break windows_reactor.core.element, while a change to windows_reactor.core.element can't break windows_reactor.core.modifiers.
Position
Below the diagonal: windows_reactor.core.element uses a module listed above it, which is the healthy direction.
33 pairs of types, where a type in windows_reactor.core.element uses a type in windows_reactor.bindings. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
windows_reactor.core.element uses windows_reactor.bindings, so a change to windows_reactor.bindings can break windows_reactor.core.element, while a change to windows_reactor.core.element can't break windows_reactor.bindings.
Position
Below the diagonal: windows_reactor.core.element uses a module listed above it, which is the healthy direction.
perry_wasi.filesystem uses perry_abi.component_io, so a change to perry_abi.component_io can break perry_wasi.filesystem, while a change to perry_wasi.filesystem can't break perry_abi.component_io.
Position
Below the diagonal: perry_wasi.filesystem uses a module listed above it, which is the healthy direction.
perry_wasi.filesystem uses perry_component_io.resource, so a change to perry_component_io.resource can break perry_wasi.filesystem, while a change to perry_wasi.filesystem can't break perry_component_io.resource.
Position
Below the diagonal: perry_wasi.filesystem uses a module listed above it, which is the healthy direction.
perry_wasi.filesystem uses perry_component_host, so a change to perry_component_host can break perry_wasi.filesystem, while a change to perry_wasi.filesystem can't break perry_component_host.
Position
Below the diagonal: perry_wasi.filesystem uses a module listed above it, which is the healthy direction.
turnloop.backend uses turnloop.time.web, so a change to turnloop.time.web can break turnloop.backend, while a change to turnloop.backend can't break turnloop.time.web.
Position
Below the diagonal: turnloop.backend uses a module listed above it, which is the healthy direction.
turnloop.backend uses turnloop.types, so a change to turnloop.types can break turnloop.backend, while a change to turnloop.backend can't break turnloop.types.
Position
Below the diagonal: turnloop.backend uses a module listed above it, which is the healthy direction.
turnloop.backend uses perry_runtime.wasi_net, so a change to perry_runtime.wasi_net can break turnloop.backend, while a change to turnloop.backend can't break perry_runtime.wasi_net.
Position
Below the diagonal: turnloop.backend uses a module listed above it, which is the healthy direction.
turnloop.backend uses perry_component_host.driver.requests, so a change to perry_component_host.driver.requests can break turnloop.backend, while a change to turnloop.backend can't break perry_component_host.driver.requests.
Position
Below the diagonal: turnloop.backend uses a module listed above it, which is the healthy direction.
turnloop.backend uses turnloop.backend.iocp, so a change to turnloop.backend.iocp can break turnloop.backend, while a change to turnloop.backend can't break turnloop.backend.iocp.
Position
Below the diagonal: turnloop.backend uses a module listed above it, which is the healthy direction.
windows_reactor.core.widget uses windows_reactor.core.modifiers, so a change to windows_reactor.core.modifiers can break windows_reactor.core.widget, while a change to windows_reactor.core.widget can't break windows_reactor.core.modifiers.
Position
Below the diagonal: windows_reactor.core.widget uses a module listed above it, which is the healthy direction.
windows_reactor.core.widget uses windows_reactor.core.element, so a change to windows_reactor.core.element can break windows_reactor.core.widget, while a change to windows_reactor.core.widget can't break windows_reactor.core.element.
Position
Below the diagonal: windows_reactor.core.widget uses a module listed above it, which is the healthy direction.
turnloop.executor uses perry_abi.component_io, so a change to perry_abi.component_io can break turnloop.executor, while a change to turnloop.executor can't break perry_abi.component_io.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses perry_runtime.box, so a change to perry_runtime.box can break turnloop.executor, while a change to turnloop.executor can't break perry_runtime.box.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses turnloop.time.web, so a change to turnloop.time.web can break turnloop.executor, while a change to turnloop.executor can't break turnloop.time.web.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses turnloop.types, so a change to turnloop.types can break turnloop.executor, while a change to turnloop.executor can't break turnloop.types.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses perry_codegen.fallback_diag, so a change to perry_codegen.fallback_diag can break turnloop.executor, while a change to turnloop.executor can't break perry_codegen.fallback_diag.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses perry_runtime.wasi_net, so a change to perry_runtime.wasi_net can break turnloop.executor, while a change to turnloop.executor can't break perry_runtime.wasi_net.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses turnloop.backend.iocp, so a change to turnloop.backend.iocp can break turnloop.executor, while a change to turnloop.executor can't break turnloop.backend.iocp.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
turnloop.executor uses turnloop.backend, so a change to turnloop.backend can break turnloop.executor, while a change to turnloop.executor can't break turnloop.backend.
Position
Below the diagonal: turnloop.executor uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 57% · Adequate · gated by D1, D2, X4 ·
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
A07:2025 — Authentication Failures
1404
High / Critical
A05:2025 — Injection
235
High / Critical
A03:2025 — Software Supply Chain Failures
26
High / Critical
A02:2025 — Security Misconfiguration
18
High / Critical
Roadmap
Immediately resolve the nine active secret leaks and remove all code that bypasses TLS certificate verification to ensure secure connections. Address the 34 test cases lacking assertions to improve reliability, while simultaneously cleaning up the 1,394 historical secrets found in repository history. Finally, maintain dependency hygiene by removing unused packages and explicitly declaring all imports.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Per-file score 0–10 — a quality signature. Of 4351 files carrying findings, judged against the Preview bar: 0% slop · 8% mixed · 92% near-clean.
File
Score
Band
Worst signal
REDACTED
1.1
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.2
Slop
Dependency Vulnerabilities: High CVE: REDACTED
REDACTED
1.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
1.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
1.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
1.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
1.6
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
3.0
Mixed
Dependency Vulnerabilities: High vulnerability: REDACTED
REDACTED
3.7
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
3.7
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
4.1
Mixed
Secrets (history): REDACTED: REDACTED
REDACTED
4.4
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
4.4
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
4.4
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
4.4
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
4.4
Mixed
Secrets (history): REDACTED: REDACTED
REDACTED
4.4
Mixed
Secrets (history): REDACTED: REDACTED
REDACTED
4.4
Mixed
Secrets (history): REDACTED: REDACTED
REDACTED
4.4
Mixed
Secrets (history): REDACTED: REDACTED
REDACTED
4.4
Mixed
Secrets (history): REDACTED: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 1477
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 — 10533
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 — 1955
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 14
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 89 of 89 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 89 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, 13929 of 13965 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a coverage step in CI (`cargo llvm-cov`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.py, .ts, .rs, .js, .tsx, .mjs, .cjs, .mts, .rb), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or SimpleCov — `require "simplecov"` in your `spec_helper.rb`/`test_helper.rb`, which writes `coverage/.resultset.json` (or lcov via `simplecov-lcov`)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or SimpleCov — `require "simplecov"` in your `spec_helper.rb`/`test_helper.rb`, which writes `coverage/.resultset.json` (or lcov via `simplecov-lcov`)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 189 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,827 test source file(s) (.py, .rs, .rb) 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .ts, .rs, .js, .tsx, .mjs, .cjs, .mts, .rb) and this repository declares a Cargo test suite (repository root, 2910 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 6 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository 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.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For crates/perry-runtime/src/exception/marks.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (26 contributor(s) across 13569 commit(s) sampled, automation and bot accounts excluded). One of them holds 84% of the history; the other 25 hold 0.6% 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D20 ADR Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `.github/actions/perry/astral-sh/setup-uv/src/download/checksum/known-checksums.ts`, `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt`, `crates/perry-ui-ios/swift/PerryNowPlaying.swift`, `crates/perry-ui-visionos/swift/PerryVisionApp.swift`, `docs/api/perry.d.ts`, … (+7 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.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in test-files/test_issue_748_multi_step_await_return.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.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite' is imported (crates/perry-stdlib/src/lib.rs:223), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite' is imported (crates/perry-stdlib/src/lib.rs:223), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite' is imported (crates/perry-stdlib/src/lib.rs:223), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'sqlite' is imported (crates/perry-stdlib/src/lib.rs:223), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Java, Kotlin, Python, Rust, Swift, c, cpp is most of its product and is not read 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.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c, cpp is most of its product and is not read 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.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 103 further occurrence(s) are not listed individually; the score already reflects all 143.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 196 further occurrence(s) are not listed individually; the score already reflects all 236.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 59 further occurrence(s) are not listed individually; the score already reflects all 99.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 25 further occurrence(s) are not listed individually; the score already reflects all 65.
X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 72 further occurrence(s) are not listed individually; the score already reflects all 112.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
2073 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was perry::commands::compile::run_pipeline::run_with_parse_cache at 936. A further 216 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 perry_hir::monomorph::substitute_expr::substitute_expr at 227 — they are counted neither in the figure above nor in this dimension's score. 97 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/perry-hir/src/monomorph/substitute_expr.rs (perry_hir::monomorph::substitute_expr::substitute_expr at 227), crates/perry-codegen-wasm/src/emit/ui_method_map.rs (perry_codegen_wasm::emit::ui_method_map::map_ui_method at 207), crates/perry-runtime/src/object/native_module_dispatch/dispatch_util.rs (perry_runtime::object::native_module_dispatch::dispatch_util::nm_dispatch_util at 135), crates/perry-runtime/src/object/native_module_dispatch/dispatch_d_i.rs (perry_runtime::object::native_module_dispatch::dispatch_d_i::nm_dispatch_fs at 106), crates/perry-codegen/src/expr/folded_builtin_override.rs (perry_codegen::expr::folded_builtin_override::folded_call at 83), and 92 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.
+ 387 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 17 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with perry::commands::compile::run_pipeline::run_with_parse_cache (cyclomatic 936), Expr::hash (cyclomatic 659), perry_codegen::codegen::lower_module (cyclomatic 365). — 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 17 together lifts Cyclomatic Complexity from 2.0 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 631 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 457 bodies over 60 down to 60 or less in Cognitive Complexity — start with perry::commands::compile::run_pipeline::run_with_parse_cache (cognitive 2499), perry_hir::lower::module_decl::lower_module_decl (cognitive 883), perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail (cognitive 798). — 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 457 together lifts Cognitive Complexity from 2.0 to about 4.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.9 / 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 721 FunctionTooLong finding(s) in God Classes — start with REDACTED (18), loops.rs (13), lib.rs (6). — One of this dimension's main actionable groups (721 warning-level).
Resolve the 573 FileTooLong finding(s) in God Classes — start with REDACTED (24), lib.rs (11), media_playback.rs (7). — One of this dimension's main actionable groups (573 warning-level).
Resolve the 108 TooManyFunctions finding(s) in God Classes — start with REDACTED (4), advanced_widgets.rs (2), ffi.rs (2). — One of this dimension's main actionable groups (108 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
2037 duplicated block group(s) detected. A further 99 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 4 of the 2136 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.
+ 440 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 155 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with lib.rs (7), REDACTED (6), loops.rs (4). — One of this dimension's main actionable groups (155 warning-level).
Resolve the 131 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with PerryBridge.kt (6), widget_decl.rs (4), emit_glue.rs (3). — One of this dimension's main actionable groups (131 warning-level).
Resolve the 126 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with PerryBridge.kt (8), lib.rs (4), loops.rs (4). — One of this dimension's main actionable groups (126 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.3 / 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.
97 production modules (Gradle+Cargo+npm), 0 dependency cycle(s), 4 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 16 module(s) off the main sequence, with abstractness counted on 69 of the 97 (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: perry-api-manifest · ×16
Unstable project perry-ext-http
Unstable project perry-stdlib
Unstable project perry-ui-windows
Unstable project windows-reactor
What to do
Resolve the 16 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 1 Unstable project perry-ext-http finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project perry-stdlib finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED (2), filesystem.rs, lowering_context.rs. — One of this dimension's main actionable groups (10 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
Resolve the 1728 Classify ADR enforcement finding(s) in Architectural Integrity — start with 0000-ci-fast-feedback.md, 0000-sqlite-handle-properties.md, 0000-sqlite-run-row-returning.md. — One of this dimension's main actionable groups (1728 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
17255 test methods: 14821 unit, 2422 integration, 0 BDD, 12 e2e. The JavaScript/TypeScript suite contributes 189 `it`/`test` case(s) across 52 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 16497 `#[test]` function(s) across 2910 file(s) declaring at least one; its unit/integration split is Cargo's own — 691 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 569 test function(s) across 39 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality7.2 / 10Strong✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
13 skipped (12 with a documented reason), 34 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 189 tests. Measured on the JavaScript/TypeScript suite only — at least 1,827 test source file(s) (.py, .rs, .rb) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: injects path properly for case #${index} · ×34upstream/actions/actions/configure-pages/src/config-parser.test.js:279
Skipped (documented): todo body · ×12test-parity/node-suite/test/runner/todo.ts:3
What to do
Resolve the 34 No assertions finding(s) in Test Quality — start with top-level-order.ts (3), set-pages-config.test.js (2), callback-overloads.ts (2). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 1 Skipped test finding(s) in Test Quality — start with skip.ts. — One of this dimension's main actionable groups (1 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_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.
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (9 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 of 915 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. 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 a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
Banned license: dssim-core
What to do
Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
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: crates/perry/src/commands/compile/run_pipeline.rs (173×936=161928); crates/perry-codegen/src/codegen/mod.rs (184×365=67160); crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs (79×319=25201) Repeated repair below the complexity floor: crates/perry-hir/src/lower/context_new.rs (15 of 24 changes were fixes); crates/perry-codegen/src/lower_call/property_get/own_override_guard.rs (9 of 17 changes were fixes); crates/perry-runtime/src/fs/validate.rs (9 of 15 changes were fixes)
Resolve the 768 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (20), lib.rs (7), dispatch.rs (5). — One of this dimension's main actionable groups (768 warning-level).
Resolve the 39 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), context_new.rs, own_override_guard.rs. — One of this dimension's main actionable groups (39 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.
67 deducted task-comment markers across 2405466 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 65 TodoComment finding(s) in Explicit Debt — start with fs_additional.rs (6), rename.rs (5), embed_misc.rs (4). — One of this dimension's main actionable groups (65 warning-level).
Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with filesystem.rs, symlink_junction.rs. — One of this dimension's main actionable groups (2 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
0 of 1574 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.
9 of 95 build units (Cargo, Gradle, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED 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.
1394 finding(s): 0 critical, 1394 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 1394 REDACTED finding(s) in Secrets (history) — start with REDACTED (202), REDACTED (140), REDACTED (125). — One of this dimension's main actionable groups (1394 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).
239 finding(s): 0 critical, 44 high, 195 medium, 0 low. semgrep hit a parse error in 125 file(s) — `.github/actions/perry/astral-sh/setup-uv/src/download/checksum/known-checksums.ts` (line 1), `.github/actions/perry/taiki-e/install-action/main.sh` (lines 338–350), `android-build/gradlew` (line 74, line 178), `benchmarks/compare.sh` (line 258, line 259, line 351, …), `benchmarks/honest_bench/harness/run_bench.sh` (line 70, line 71), … (+120 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 12 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
+ 18 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (15 issue-level).
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 10 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (10 issue-level).
Resolve the 8 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
7 of 3000 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is scripts/perf_frontier_report.py. Counted over 3000 of the 14690 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 4 Orphaned knowledge finding(s) in Knowledge Freshness — start with perf_frontier_report.py, capabilities.rs, main.ts. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 3 Orphaned file finding(s) in Knowledge Freshness — start with yaml.rs, url_pattern.rs, gen_feature_matrix.py. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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 26 Change coupling finding(s) in Change Coupling — start with node_core.rs (2), REDACTED (2), masked_window.rs. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 8 Change-coupling hub finding(s) in Change Coupling — start with expr.rs, expr_mut.rs, exprs_more.rs. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with helpers.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 12 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.
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
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.
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.
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`IGitCommandManager` declares 38 required operations: `branchDelete`, `branchExists`, `branchList`, `disableSparseCheckout`, `sparseCheckout`, `sparseCheckoutNonConeMode`, `checkout`, `checkoutDetach`, `config`, `configExists`, `fetch`, `getDefaultBranch`, `getSubmoduleConfigPaths`, `getWorkingDirectory`, `init`, `isDetached`, `lfsFetch`, `lfsInstall`, `log1`, `remoteAdd`, `removeEnvironmentVariable`, `revParse`, `setEnvironmentVariable`, `shaExists`, `submoduleForeach`, `submoduleSync`, `submoduleUpdate`, `submoduleStatus`, `tagExists`, `tryClean`, `tryConfigUnset`, `tryConfigUnsetValue`, `tryDisableAutomaticGarbageCollection`, `tryGetFetchUrl`, `tryGetConfigValues`, `tryGetConfigKeys`, `tryReset`, `version`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — upstream/actions/actions/checkout/src/git-command-manager.ts:18
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 140 of 151 project(s) that lack one — worth up to 1.9 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
docs/turnloop/p12-report.md names MongoDB 8, but the manifest declares `mongodb` 7.5.0. 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. — docs/turnloop/p12-report.md:297
docs/src/internals/weakmap-owned-index-validation.md names Zod 3, but the manifest declares `zod` ^4.3.5. 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. — docs/src/internals/weakmap-owned-index-validation.md:63
What to do
Reconcile the README with reality: docs/turnloop/p12-report.md names MongoDB 8, but the manifest declares `mongodb` 7.5.0; docs/src/internals/weakmap-owned-index-validation.md names Zod 3, but the manifest declares `zod` ^4.3.5.
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 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/22 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `.`, `crates/perry-component-host`, `crates/perry-component-io` and 10 more.
`upstream/actions/actions/cache/src/saveImpl.ts` 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. — upstream/actions/actions/cache/src/saveImpl.ts:94
`upstream/actions/actions/cache/src/saveImpl.ts` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — upstream/actions/actions/cache/src/saveImpl.ts:114
`upstream/actions/Swatinem/rust-cache/src/workspace.ts` reports through `console.*` at line 35 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — upstream/actions/Swatinem/rust-cache/src/workspace.ts:35
`experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 9 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — experiments/llvm-inprocess-spike/spike.ts:9
`experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 10 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — experiments/llvm-inprocess-spike/spike.ts:10
`experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 15 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — experiments/llvm-inprocess-spike/spike.ts:15
`experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — experiments/llvm-inprocess-spike/spike.ts:28
`experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 31 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — experiments/llvm-inprocess-spike/spike.ts:31
`experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 35 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — experiments/llvm-inprocess-spike/spike.ts:35
`crates/perry-hir/src/realm_fixtures/non_top.ts` reports through `console.*` at line 12 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-hir/src/realm_fixtures/non_top.ts:12
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 146 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:146
`crates/perry-codegen-wasm/src/wasm_runtime.js` 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. — crates/perry-codegen-wasm/src/wasm_runtime.js:147
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 148 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:148
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 977 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:977
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1617 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:1617
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1618 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:1618
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1619 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:1619
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1620 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:1620
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 2678 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:2678
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 3924 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:3924
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 3934 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:3934
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4144 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4144
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4186 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4186
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4205 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4205
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4306 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4306
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4311 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4311
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4366 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4366
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4370 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4370
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4404 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4404
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4559 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4559
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4658 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4658
`crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4716 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-wasm/src/wasm_runtime.js:4716
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:114
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 856 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:856
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 2017 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:2017
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 2024 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:2024
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 3181 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:3181
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 3201 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:3201
`crates/perry-codegen-js/src/web_runtime.js` reports through `console.*` at line 3385 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — crates/perry-codegen-js/src/web_runtime.js:3385
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.
What to do
Dependabot is configured but does not watch `npm`, `gradle` — add those `package-ecosystem` entries to .github/dependabot.yml 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.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×27) — crates/perry-codegen-js/src/web_runtime.js:3269, crates/perry-codegen-wasm/src/wasm_runtime.js:1329, crates/perry-codegen-wasm/src/wasm_runtime.js:1342, …
`http.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:116
`requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — scripts/check_gate_freshness.py:186
What to do
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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 the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 20 use(s) across 6,736 production line(s) (~3.0/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
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 the language 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.
`fs.writeFileSync` in `downloadAndVerify` 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/perry-updater/src/index.ts:455
`fs.renameSync` in `downloadAndVerify` 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/perry-updater/src/index.ts:456
`spawnSync` in `runChecks` 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. — scripts/check/run.mts:26
`existsSync` in `packTarball` 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. — scripts/publish/npm/proof.mts:33
`existsSync` in `resolvePackageTarball` 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. — scripts/publish/npm/proof.mts:44
`readdirSync` in `resolvePackageTarball` 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. — scripts/publish/npm/proof.mts:45
`existsSync` in `ensureTagAndRelease` 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. — scripts/publish/release.mts:150
`mkdtempSync` in `ensureTagAndRelease` 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. — scripts/publish/release.mts:162
`writeFileSync` in `ensureTagAndRelease` 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) — scripts/publish/release.mts:164, scripts/publish/release.mts:168
`rmSync` in `ensureTagAndRelease` 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) — scripts/publish/release.mts:328, scripts/publish/release.mts:335
`readFileSync` in `main` 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) — scripts/publish/scan-ci-packages.mts:20, scripts/soak/external-tools.mts:640
`writeFileSync` in `main` 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) — scripts/publish/scan-ci-packages.mts:39, scripts/soak/external-tools.mts:643
`existsSync` in `scanTarball` 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. — scripts/publish/scan.mts:178
`existsSync` in `installAssetTool` 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. (×4) — scripts/soak/external-tools.mts:370, scripts/soak/external-tools.mts:374, scripts/soak/external-tools.mts:386, …
`mkdirSync` in `installAssetTool` 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. — scripts/soak/external-tools.mts:381
`rmSync` in `installAssetTool` 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. — scripts/soak/external-tools.mts:391
`writeFileSync` in `installAssetTool` 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. — scripts/soak/external-tools.mts:395
`chmodSync` in `installAssetTool` 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. — scripts/soak/external-tools.mts:397
`existsSync` in `installNpmTarball` 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) — scripts/soak/external-tools.mts:422, scripts/soak/external-tools.mts:431
`rmSync` in `installNpmTarball` 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) — scripts/soak/external-tools.mts:423, scripts/soak/external-tools.mts:433
`mkdirSync` in `installNpmTarball` 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. — scripts/soak/external-tools.mts:426
`readFileSync` in `installNpmTarball` 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. — scripts/soak/external-tools.mts:429
`writeFileSync` in `installNpmTarball` 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. — scripts/soak/external-tools.mts:448
`chmodSync` in `installNpmTarball` 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. — scripts/soak/external-tools.mts:449
`mkdtempSync` in `fixture` 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. — test-files/fetch_stream_fixture.ts:11
`existsSync` in `fixture` 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. — test-files/fetch_stream_fixture.ts:96
`readFileSync` in `fixture` 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. — test-files/fetch_stream_fixture.ts:97
`rmSync` in `close` 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. — test-files/fetch_stream_fixture.ts:98
`fs.mkdtempSync` in `unixEcho` 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. — test-files/test_gap_turnloop_net_sockets.ts:56
`fs.existsSync` in `unixEcho` 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. — test-files/test_gap_turnloop_net_sockets.ts:66
`fs.rmSync` in `unixEcho` 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. — test-files/test_gap_turnloop_net_sockets.ts:79
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.7 / 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.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
22 duplicated blocks under crates/ have copies in at least two of the sibling directories perry-codegen-js, perry-codegen-wasm — 18 of them are reported below, and 4 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 22 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 22 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 22 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. — crates/perry-codegen-js/src/web_runtime.js:3423
crates/perry-codegen-js/src/web_runtime.js:3423 · crates/perry-codegen-wasm/src/wasm_runtime.js:3933 — 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. — crates/perry-codegen-js/src/web_runtime.js:3423
crates/perry-codegen-js/src/web_runtime.js:1827 · crates/perry-codegen-wasm/src/wasm_runtime.js:3645 — 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. — crates/perry-codegen-js/src/web_runtime.js:1827
crates/perry-codegen-js/src/web_runtime.js:1416 · crates/perry-codegen-wasm/src/wasm_runtime.js:3521 — 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. — crates/perry-codegen-js/src/web_runtime.js:1416
scripts/turnloop/apps/mysql_parity.ts:25 · scripts/turnloop/apps/mysql_pool_parity.ts:18 — the two spans are one implementation copied and then locally edited — 379 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. — scripts/turnloop/apps/mysql_parity.ts:25
scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:20 · scripts/turnloop/apps/p9_worker_agent_acceptance.ts:36 — 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. — scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:20
scripts/test-exported-local-storage.mjs:9 · scripts/test-imported-value-class-collision.mjs:9 · scripts/test-object-array-methods.mjs:9 · scripts/test-string-static-spread.mjs:9 — the 4 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. There is one copy in each of 4 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — scripts/test-exported-local-storage.mjs:9
crates/perry-codegen-js/src/web_runtime.js:601 · crates/perry-codegen-wasm/src/wasm_runtime.js:3252 — 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. — crates/perry-codegen-js/src/web_runtime.js:601
crates/perry-codegen-js/src/web_runtime.js:3611 · crates/perry-codegen-wasm/src/wasm_runtime.js:4124 — 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. — crates/perry-codegen-js/src/web_runtime.js:3611
crates/perry-codegen-js/src/web_runtime.js:652 · crates/perry-codegen-wasm/src/wasm_runtime.js:3303 — 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. — crates/perry-codegen-js/src/web_runtime.js:652
scripts/test-async-resource-own-bind.mjs:20 · scripts/test-child-output-late-iterator.mjs:21 — 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. — scripts/test-async-resource-own-bind.mjs:20
upstream/actions/actions/upload-artifact/src/merge/input-helper.ts:9 · upstream/actions/actions/upload-artifact/src/upload/input-helper.ts:9 — the two spans are one implementation copied and then locally edited — 177 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. — upstream/actions/actions/upload-artifact/src/merge/input-helper.ts:9
crates/perry-codegen-wasm/src/wasm_runtime.js:2518 · crates/perry-codegen-wasm/src/wasm_runtime.js:2547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/perry-codegen-wasm/src/wasm_runtime.js:2518
crates/perry-codegen-wasm/src/wasm_runtime.js:845 · crates/perry-codegen-wasm/src/wasm_runtime.js:885 — 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. — crates/perry-codegen-wasm/src/wasm_runtime.js:845
upstream/actions/actions/checkout/src/git-command-manager.ts:545 · upstream/actions/actions/checkout/src/git-command-manager.ts: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. — upstream/actions/actions/checkout/src/git-command-manager.ts:545
packages/perry-threads/src/parallel.ts:15 · packages/perry-threads/src/parallel.ts:58 — both copies are in the same file, so extract the 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/perry-threads/src/parallel.ts:15
scripts/test-exported-local-storage.mjs:25 · scripts/test-import-meta-require-value.mjs:25 · scripts/test-imported-value-class-collision.mjs:26 · scripts/test-object-array-methods.mjs:26 · +1 more site(s) not listed — the 5 copies are spread across 5 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. — scripts/test-exported-local-storage.mjs:25
scripts/turnloop/apps/_helpers/p9_worker_gc_stress_worker.ts:17 · scripts/turnloop/apps/p9_worker_gc_stress.ts:22 — the two spans are one implementation copied and then locally edited — 205 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. — scripts/turnloop/apps/_helpers/p9_worker_gc_stress_worker.ts:17
upstream/actions/actions/configure-pages/src/config-parser.js:163 · upstream/actions/actions/configure-pages/src/config-parser.js: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. — upstream/actions/actions/configure-pages/src/config-parser.js:163
scripts/turnloop/apps/mongo_parity.ts:57 · scripts/turnloop/apps/mongo_tls_parity.ts:72 — 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. — scripts/turnloop/apps/mongo_parity.ts:57
scripts/turnloop/apps/mongo_parity.ts:17 · scripts/turnloop/apps/mongo_tls_parity.ts:32 — 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. — scripts/turnloop/apps/mongo_parity.ts:17
scripts/test-export-dollar-underscore-collision.mjs:20 · scripts/test-namespace-getter-binding-identity.mjs:30 — the two spans are one implementation copied and then locally edited — 260 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. — scripts/test-export-dollar-underscore-collision.mjs:20
crates/perry-codegen-js/src/web_runtime.js:1910 · crates/perry-codegen-wasm/src/wasm_runtime.js:3742 — 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. — crates/perry-codegen-js/src/web_runtime.js:1910
packages/perry-styling/src/color.ts:60 · packages/perry-styling/src/color.ts:84 — 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/perry-styling/src/color.ts:60
scripts/publish/release.mts:276 · scripts/publish/release.mts:306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/publish/release.mts:276
scripts/turnloop/apps/db_thread_census.ts:105 · scripts/turnloop/apps/db_thread_census.ts:128 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — scripts/turnloop/apps/db_thread_census.ts:105
crates/perry-codegen-js/src/web_runtime.js:1242 · crates/perry-codegen-wasm/src/wasm_runtime.js:3107 — 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. — crates/perry-codegen-js/src/web_runtime.js:1242
scripts/turnloop/apps/_helpers/tokio_worker_agent_census_worker.ts:7 · scripts/turnloop/apps/tokio_worker_agent_census.ts:28 — 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. — scripts/turnloop/apps/_helpers/tokio_worker_agent_census_worker.ts:7
scripts/turnloop/apps/db_thread_census.ts:33 · scripts/turnloop/apps/pg_thread_census.ts:32 — 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. — scripts/turnloop/apps/db_thread_census.ts:33
scripts/turnloop/apps/pg_parity.ts:38 · scripts/turnloop/apps/pg_tls_parity.ts:27 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — scripts/turnloop/apps/pg_parity.ts:38
upstream/actions/actions/download-artifact/src/download-artifact.ts:149 · upstream/actions/actions/upload-artifact/src/merge/merge-artifacts.ts:23 — the two spans are one implementation copied and then locally edited — 121 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. — upstream/actions/actions/download-artifact/src/download-artifact.ts:149
scripts/turnloop/apps/db_thread_census.ts:145 · scripts/turnloop/apps/pg_thread_census.ts:73 · scripts/turnloop/apps/pg_thread_census.ts:115 — the 3 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. — scripts/turnloop/apps/db_thread_census.ts:145
upstream/actions/astral-sh/setup-uv/src/save-cache.ts:15 · upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:22 — 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. — upstream/actions/astral-sh/setup-uv/src/save-cache.ts:15
upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:204 · upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:204
REDACTED:99 · REDACTED: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. — REDACTED:99
upstream/actions/actions/deploy-pages/src/internal/api-client.js:128 · upstream/actions/actions/deploy-pages/src/internal/api-client.js:146 — 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. — upstream/actions/actions/deploy-pages/src/internal/api-client.js:128
crates/perry-codegen-wasm/src/wasm_runtime.js:658 · crates/perry-codegen-wasm/src/wasm_runtime.js:1916 — 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. — crates/perry-codegen-wasm/src/wasm_runtime.js:658
crates/perry-codegen-wasm/src/wasm_runtime.js:681 · crates/perry-codegen-wasm/src/wasm_runtime.js:1935 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/perry-codegen-wasm/src/wasm_runtime.js:681
crates/perry-codegen-wasm/src/wasm_runtime.js:779 · crates/perry-codegen-wasm/src/wasm_runtime.js:2005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/perry-codegen-wasm/src/wasm_runtime.js:779
scripts/turnloop/apps/p9_socket_concurrency.ts:55 · scripts/turnloop/apps/p9_worker_message_fanin.ts:29 — the two spans are one implementation copied and then locally edited — 94 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. — scripts/turnloop/apps/p9_socket_concurrency.ts:55
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/perry-solid/src/index.ts:1 imports perry/ui, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/perry-solid/src/index.ts:1
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.
big has cyclomatic complexity 140 and cognitive complexity 145; 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. — test-files/test_gap_split_regions.ts:10
main has cyclomatic complexity 60 and cognitive complexity 76; 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. — upstream/actions/jdx/mr-boxington-action/src/index.ts:330
findConfigurationObject has cyclomatic complexity 58 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. — upstream/actions/actions/configure-pages/src/config-parser.js:138
(top-level) has cyclomatic complexity 56 and cognitive complexity 55; 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. — test-files/test_gap_builtin_constructor_statics2_inherited.ts:2
_perryCodeToKey has cyclomatic complexity 55 and cognitive complexity 29; 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. — crates/perry-codegen-js/src/web_runtime.js:1831
__perryCodeToKey has cyclomatic complexity 55 and cognitive complexity 29; 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. — crates/perry-codegen-wasm/src/wasm_runtime.js:3652
sloppyArm has cyclomatic complexity 45 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — test-files/test_gap_9459_property_set_strictness.cts:148
strictArm has cyclomatic complexity 45 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — test-files/test_gap_9459_property_set_strictness.cts:633
_mapKeyToAction has cyclomatic complexity 45 and cognitive complexity 43; 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. — crates/perry-codegen-js/src/web_runtime.js:2245
namedColor has cyclomatic complexity 40 and cognitive complexity 39; 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/perry-styling/src/color.ts:155
run has cyclomatic complexity 37 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. — test-files/_helpers/fake_mongo_server.ts:79
getSource has cyclomatic complexity 35 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. — upstream/actions/actions/checkout/src/git-source-provider.ts:18
generateTheme has cyclomatic complexity 34 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/perry-styling/src/generator.ts:52
ensureTagAndRelease has cyclomatic complexity 33 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. — scripts/publish/release.mts:123
getInputs has cyclomatic complexity 33 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — upstream/actions/actions/checkout/src/input-helper.ts:9
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files9.8 / 10Exemplary✓ 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.
crates/perry-codegen-wasm/src/wasm_runtime.js has 4745 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/perry-codegen-wasm/src/wasm_runtime.js:1
crates/perry-codegen-js/src/web_runtime.js has 3805 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/perry-codegen-js/src/web_runtime.js:1
test-files/test_gap_13049_chunked_literal_births.ts has 2985 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_13049_chunked_literal_births.ts:1
test-files/test_gap_element_receiver_regions.ts has 1769 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_element_receiver_regions.ts:1
test-files/test_gap_array_layout_multi_unit.ts has 1232 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_array_layout_multi_unit.ts:1
test-files/test_gap_10418_bigint_bitwise_typing.ts has 1017 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_10418_bigint_bitwise_typing.ts:1
test-files/test_gap_10420_call_arity_limits.ts has 944 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_10420_call_arity_limits.ts:1
upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts has 917 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:1
test-files/test_gap_builtin_constructor_statics2_inherited.ts has 894 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_builtin_constructor_statics2_inherited.ts:1
test-files/test_gap_forward_class_binding_class_captures.ts has 710 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_forward_class_binding_class_captures.ts:1
upstream/actions/jdx/mr-boxington-action/src/index.ts has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — upstream/actions/jdx/mr-boxington-action/src/index.ts:1
REDACTED has 661 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
upstream/actions/actions/checkout/src/git-command-manager.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. — upstream/actions/actions/checkout/src/git-command-manager.ts:1
test-files/test_gap_gc_11929_stable_home_marking.ts has 626 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_gc_11929_stable_home_marking.ts:1
test-files/test_gap_json_record_loop_clone.ts has 612 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_json_record_loop_clone.ts:1
test-files/test_gap_split_regions.ts has 600 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_split_regions.ts:1
test-files/test_gap_10476_builtin_named_guarded_receivers.ts has 590 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_10476_builtin_named_guarded_receivers.ts:1
test-files/test_gap_typed_array_compound_update.ts has 562 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_typed_array_compound_update.ts:1
test-files/test_gap_10894_typed_array_generic_annotation.ts has 558 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_10894_typed_array_generic_annotation.ts:1
upstream/actions/actions/checkout/src/git-auth-helper.ts has 538 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — upstream/actions/actions/checkout/src/git-auth-helper.ts:1
test-files/test_gap_9445_implicit_this_restore_sweep.ts has 521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_9445_implicit_this_restore_sweep.ts:1
test-files/test_gap_dynamic_get_matrix.ts has 506 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_dynamic_get_matrix.ts:1
upstream/actions/jdx/mr-boxington-action/src/lib.ts has 498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — upstream/actions/jdx/mr-boxington-action/src/lib.ts:1
test-files/test_gap_10419_generator_loop_header_yield.ts has 493 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_10419_generator_loop_header_yield.ts:1
packages/perry-updater/src/index.ts has 472 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/perry-updater/src/index.ts:1
test-files/test_gap_repsel_element_shape_loop_clone.ts has 471 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_repsel_element_shape_loop_clone.ts:1
test-files/_helpers/h2_wire.ts has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/_helpers/h2_wire.ts:1
test-files/test_gap_repsel_ptr_shape_locals.ts has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_repsel_ptr_shape_locals.ts:1
test-files/test_gap_typed_array_guarded_view_keys.ts has 446 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_typed_array_guarded_view_keys.ts:1
test-files/test_gap_lblk_labeled_blocks.ts has 432 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_lblk_labeled_blocks.ts:1
test-files/test_issue_945_scalar_method_guards.ts has 430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_issue_945_scalar_method_guards.ts:1
example-code/forgejo-deployment/main.ts has 427 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — example-code/forgejo-deployment/main.ts:1
test-files/test_gap_received_value_diagnostics.ts has 424 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_gap_received_value_diagnostics.ts:1
test-files/test_issue_5893_private_brand_freshness.ts has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_issue_5893_private_brand_freshness.ts:1
test-files/test_ffi_surface_runtime_core.ts has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — test-files/test_ffi_surface_runtime_core.ts: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 Coverage1.5 / 10Critical✓ 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) — upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:1, scripts/node_compat_matrix.mjs:1, upstream/actions/actions/checkout/src/git-command-manager.ts: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.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.0 / 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.
9021 file(s) (~393153 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: test-files/gc-dep-corpus/main.ts imports '../../node_modules/zod/src/index.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here.
4 file(s) (~36 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — test-files/_helpers/globalget
1 file(s) (~26 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — test-files/issue_1069
Nothing imports this binding — it is safe to review for removal. (×18) — packages/perry-styling/src/color.ts:196, scripts/publish/constants.mts:43, scripts/publish/constants.mts:50, …
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×13) — packages/perry-styling/src/cli.ts:26, test-files/fixtures/cjs-eval-with.cjs:1, REDACTED:16, …
Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect. (×5) — test-files/test_gap_11142_class_self_binding_static_factory.ts:177, test-files/test_gap_11791_private_error_texts.ts:23, test-files/test_gap_11791_private_transfer.ts:9, …
Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used. — test-files/test_gap_11791_private_error_texts.ts:24
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. (×9) — test-files/test_better_sqlite3_raw.ts:5, test-files/test_issue_9330_drizzle_mysql2_transaction.ts:7, test-files/test_effect_pipe_map.ts:22, …
Declared in the root 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. (×2)
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 — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are read from a Rust server this repository starts itself, and its production Rust starts none. What serves its HTTP is outside the Rust source, and only what this card names about it was assessed.
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.
a rustls `ServerCertVerifier` that accepts every certificate (`NoVerify`) is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on. — crates/perry-ext-net/src/tls.rs:521
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×13) — crates/perry-container-compose/src/compose.rs:21, crates/perry-container-compose/src/service.rs:4, crates/perry-container-compose/src/service.rs:21, …
`https://pa.skelpo.com/js/pa-R_kbATcyJ91THVHqtLpnN.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. — docs/theme/head.hbs:2
What to do
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 13 sites, not one: `crates/perry-container-compose/src/compose.rs:21` (`Md5::new`), `crates/perry-container-compose/src/service.rs:4` (`Md5::new`), `crates/perry-container-compose/src/service.rs:21` (`Md5::new`), `crates/perry-container-compose/src/testing/mock_backend.rs:130` (`Md5::new`), `crates/perry-http-client/src/ws/frame.rs:96` (`Sha1::new`), `crates/perry-stdlib/src/crypto/certificate.rs:197` (`Md5::new`), `crates/perry-stdlib/src/crypto/hash.rs:87` (`Md5::new`), `crates/perry-stdlib/src/crypto/hash_handles.rs:176` (`Sha1::new`), and 5 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
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.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. 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 document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. 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.
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.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
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 6/13 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
`resolveRelease` 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 })`. — upstream/actions/jdx/mr-boxington-action/src/index.ts:138
`fetchManifestResponse` 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 })`. — upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:169
`primary` 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 })`. — scripts/turnloop/apps/p9_thread_agent.ts:22
`doFetch` 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 })`. (×2) — scripts/turnloop/apps/p9_worker_agent_acceptance.ts:40, scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:24
`checkForUpdate` 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/perry-updater/src/index.ts:160
`downloadAndVerify` 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/perry-updater/src/index.ts:425
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 an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. 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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped4.6 / 10Weak✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — crates/perry-codegen-js/src/web_runtime.js:1210
`item.title` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — crates/perry-codegen-js/src/web_runtime.js:1668
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. 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. Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements 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 guard7.6 / 10Strong✓ Tool-verified
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.
This condition tests `fields` for emptiness and then indexes it on a branch that test does not reach. `fields[2]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `fields` being empty — so an empty `fields` indexes position 2 of nothing and throws. This same condition already shows the intended bracketing: `fields[4]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `fields` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `fields`. — scripts/measure_linux_rss_ab.py:295
What to do
Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×35) — upstream/actions/jdx/mr-boxington-action/src/index.ts:210, upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:69, upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:367, …
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — upstream/actions/actions/checkout/src/git-source-provider.ts:345
`catch (_e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — upstream/actions/Swatinem/rust-cache/src/config.ts:202
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — scripts/ci_ext_link_scope.py:170, scripts/node_suite_run.py:106, scripts/node_suite_run.py:123
What to do
Swallowed exception (empty catch)
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 log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. 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 `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/save-cache.ts:69
`info` at line 157 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/save-cache.ts:157
`info` at line 161 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/save-cache.ts:161
`info` at line 163 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/save-cache.ts:163
`info` at line 101 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:101
`info` at line 146 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:146
`info` at line 177 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:177
`info` at line 184 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:184
`info` at line 186 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:186
`info` at line 191 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:191
`info` at line 200 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:200
`info` at line 203 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:203
`info` at line 206 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:206
`info` at line 214 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:214
`info` at line 220 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:220
`info` at line 225 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:225
`info` at line 232 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:232
`info` at line 244 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:244
`info` at line 276 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:276
`info` at line 27 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/update-known-checksums.ts:27
`info` at line 71 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:71
`info` at line 74 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. (×2) — upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:74, scripts/publish/nightly.mts:74
`info` at line 90 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:90
`info` at line 183 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:183
`info` at line 259 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:259
`info` at line 296 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:296
`info` at line 310 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:310
`info` at line 132 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/download/download-version.ts:132
`info` at line 155 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/download/download-version.ts:155
`info` at line 110 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:110
`info` at line 172 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:172
`info` at line 181 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:181
`info` at line 59 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/cache/restore-cache.ts:59
`info` at line 81 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/cache/restore-cache.ts:81
`info` at line 115 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/cache/restore-cache.ts:115
`info` at line 121 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — upstream/actions/astral-sh/setup-uv/src/cache/restore-cache.ts:121
`info` at line 48 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — scripts/publish/nightly.mts:48
`log` at line 267 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.log({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.log('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — scripts/publish/pipeline.mts:267
`log` at line 301 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.log({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.log('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — scripts/publish/pipeline.mts:301
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
9/10 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~1.8 `!` null assertions per 1k TypeScript source lines — 45 assertion(s) across the 24700 source line(s) of the 243 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: scripts/soak/external-tools.mts (14), scripts/soak/soak.mts (10), scripts/soak/update-deps.mts (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 10 of 55 WCAG 2.2 Level A/AA success criteria (18%; ≈20% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 45 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 — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 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 — 16 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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: this repository stores data through 'sqlite' (crates/perry-stdlib/src/lib.rs:223) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'sqlite' (crates/perry-stdlib/src/lib.rs:223) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'sqlite' (crates/perry-stdlib/src/lib.rs:223) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 38 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
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 Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. 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 class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state 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
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 (rendered) — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: this repository stores data through 'sqlite' (crates/perry-stdlib/src/lib.rs:223) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D12 Dependency Hygiene — Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 6 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
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.
D21 Naming Consistency — Naming consistency is measured on C# only; Go, Java, JavaScript, Kotlin, Python, Ruby, Rust, Swift, TypeScript, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, TypeScript surface was not measured.
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+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (perry-wpfacts), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .cts, .go, .java, .kt, .mts, .py, .rb, .rs, .swift, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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.
D32 Data Compliance (PII/GDPR) — 12 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — applicable but not scored (4 signals for this style, 2 needed — the count is met but a required primary signal is absent): 2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 1112 value object(s); 10 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
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
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.
Orphaned knowledge scripts/perf_frontier_report.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/perry-container-compose/src/capabilities.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge example-code/forgejo-deployment/main.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge test-compat/npm-sweep/run.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Banned license: dssim-core — `dssim-core` 3.5.1 is published on crates.io under `AGPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository's REDACTED — so it is compiled by everything that builds this repository, not just by its test harness. The expression was read as SPDX, not as text: an `OR` is a choice and is only charged when every branch is banned, while an `AND` binds you to both operands and is charged when either is. Replace the crate, or record an accepted exception.
Unlisted import 'better-sqlite3' test-files/test_better_sqlite3_raw.ts:5— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'drizzle-orm' test-files/test_issue_9330_drizzle_mysql2_transaction.ts:7— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'effect' test-files/test_effect_pipe_map.ts:22— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'hono' test-files/test_hono_bundle.ts:9— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'lru-cache' test-files/test_parity_lru_cache.ts:5— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'minimatch' upstream/actions/actions/download-artifact/src/download-artifact.ts:6— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'reflect-metadata' test-files/test_decorators_builtin_metadata_9501.ts:5— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'semver' upstream/actions/actions/setup-node/src/distributions/base-distribution-prerelease.ts:3— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'ws' test-files/_helpers/gap_11044_ws_reexport/ws_facade.ts:5— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
TLS certificate validation disabled crates/perry-ext-net/src/tls.rs:521— a rustls `ServerCertVerifier` that accepts every certificate (`NoVerify`) is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail (cognitive 798) crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs:8— perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail has cognitive complexity 798 (threshold 15). Drivers by points: if/else 258 (729 pts), boolean chains 41, match/switch 7 (23 pts), loops 2 (5 pts) (nesting depth added 490). 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.
perry_runtime::object::field_get_set::get_field_by_name::get_field_by_name_past_data_probe (cognitive 471) crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs:600— perry_runtime::object::field_get_set::get_field_by_name::get_field_by_name_past_data_probe has cognitive complexity 471 (threshold 15). Drivers by points: if/else 141 (419 pts), boolean chains 27, match/switch 5 (25 pts) (nesting depth added 298). 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.
perry_runtime::object::field_get_set::has_property::object_has_property_generic (cognitive 382) crates/perry-runtime/src/object/field_get_set/has_property.rs:248— perry_runtime::object::field_get_set::has_property::object_has_property_generic has cognitive complexity 382 (threshold 15). Drivers by points: if/else 134 (360 pts), boolean chains 18, match/switch 2 (4 pts) (nesting depth added 228). 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.
perry_runtime::symbol::get::js_object_get_symbol_property_with_receiver (cognitive 365) crates/perry-runtime/src/symbol/get.rs:529— perry_runtime::symbol::get::js_object_get_symbol_property_with_receiver has cognitive complexity 365 (threshold 15). Drivers by points: if/else 123 (350 pts), boolean chains 15 (nesting depth added 227). 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.
perry_runtime::object::native_call_method::handle_methods::dispatch_handle (cognitive 364) crates/perry-runtime/src/object/native_call_method/handle_methods.rs:56— perry_runtime::object::native_call_method::handle_methods::dispatch_handle has cognitive complexity 364 (threshold 15). Drivers by points: if/else 106 (318 pts), boolean chains 37, loops 1 (5 pts), match/switch 1 (4 pts) (nesting depth added 219). 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.
perry_runtime::object::instanceof::static_dispatch::native_instanceof (cognitive 354) crates/perry-runtime/src/object/instanceof/static_dispatch.rs:210— perry_runtime::object::instanceof::static_dispatch::native_instanceof has cognitive complexity 354 (threshold 15). Drivers by points: if/else 178 (314 pts), boolean chains 29, match/switch 5 (11 pts) (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.
perry_runtime::object::descriptors::own_property (cognitive 339) crates/perry-runtime/src/object/descriptors.rs:226— perry_runtime::object::descriptors::own_property has cognitive complexity 339 (threshold 15). Drivers by points: if/else 131 (317 pts), boolean chains 14, match/switch 3 (8 pts) (nesting depth added 191). 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.
perry_runtime::object::object_ops::prototype::get_prototype_of_resolved (cognitive 312) crates/perry-runtime/src/object/object_ops/prototype.rs:264— perry_runtime::object::object_ops::prototype::get_prototype_of_resolved has cognitive complexity 312 (threshold 15). Drivers by points: if/else 137 (292 pts), boolean chains 17, match/switch 1 (3 pts) (nesting depth added 157). 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.
perry_runtime::object::field_set_by_name::tail::set_field_by_name_object_tail (cognitive 297) crates/perry-runtime/src/object/field_set_by_name/tail.rs:39— perry_runtime::object::field_set_by_name::tail::set_field_by_name_object_tail has cognitive complexity 297 (threshold 15). Drivers by points: if/else 119 (256 pts), boolean chains 33, match/switch 3 (8 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.
perry_runtime::object::native_call_method::native_call_method_tower (cognitive 269) crates/perry-runtime/src/object/native_call_method.rs:1228— perry_runtime::object::native_call_method::native_call_method_tower has cognitive complexity 269 (threshold 15). Drivers by points: if/else 123 (233 pts), boolean chains 31, match/switch 3 (5 pts) (nesting depth added 112). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_runtime::object::object_ops::define_property::apply_property_descriptor (cognitive 256) crates/perry-runtime/src/object/object_ops/define_property.rs:291— perry_runtime::object::object_ops::define_property::apply_property_descriptor has cognitive complexity 256 (threshold 15). Drivers by points: if/else 115 (225 pts), boolean chains 29, match/switch 1 (2 pts) (nesting depth added 111). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_runtime::object::instanceof::dynamic_dispatch::js_instanceof_dynamic (cognitive 252) crates/perry-runtime/src/object/instanceof/dynamic_dispatch.rs:85— perry_runtime::object::instanceof::dynamic_dispatch::js_instanceof_dynamic has cognitive complexity 252 (threshold 15). Drivers by points: if/else 98 (205 pts), boolean chains 33, match/switch 5 (13 pts), loops 1 (nesting depth added 115). 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.
perry_runtime::builtins::table::js_console_table_with_properties (cognitive 241) crates/perry-runtime/src/builtins/table.rs:285— perry_runtime::builtins::table::js_console_table_with_properties has cognitive complexity 241 (threshold 15). Drivers by points: if/else 52 (148 pts), loops 25 (85 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 158). 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.
perry_runtime::promise::microtasks::pump_protected (cognitive 232) crates/perry-runtime/src/promise/microtasks.rs:426— perry_runtime::promise::microtasks::pump_protected has cognitive complexity 232 (threshold 15). Drivers by points: if/else 76 (219 pts), boolean chains 6, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 146). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_runtime::object::buffer_dispatch::dispatch_buffer_method (cognitive 218) crates/perry-runtime/src/object/buffer_dispatch.rs:473— perry_runtime::object::buffer_dispatch::dispatch_buffer_method has cognitive complexity 218 (threshold 15). Drivers by points: if/else 112 (192 pts), boolean chains 23, match/switch 2 (3 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.
perry_runtime::object::field_set_by_name::js_object_set_field_by_name (cognitive 211) crates/perry-runtime/src/object/field_set_by_name.rs:46— perry_runtime::object::field_set_by_name::js_object_set_field_by_name has cognitive complexity 211 (threshold 15). Drivers by points: if/else 86 (187 pts), boolean chains 24 (nesting depth added 101). 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.
perry_runtime::object::descriptors::js_object_get_own_property_names_shape (cognitive 206) crates/perry-runtime/src/object/descriptors.rs:1187— perry_runtime::object::descriptors::js_object_get_own_property_names_shape has cognitive complexity 206 (threshold 15). Drivers by points: if/else 55 (120 pts), loops 23 (62 pts), boolean chains 19, match/switch 3 (5 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.
perry_runtime::object::delete_rest::js_object_delete_field (cognitive 196) crates/perry-runtime/src/object/delete_rest.rs:30— perry_runtime::object::delete_rest::js_object_delete_field has cognitive complexity 196 (threshold 15). Drivers by points: if/else 78 (180 pts), boolean chains 14, loops 1, match/switch 1 (nesting depth added 102). 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.
perry_runtime::object::native_call_method::primitive_methods::dispatch_primitive (cognitive 186) crates/perry-runtime/src/object/native_call_method/primitive_methods.rs:167— perry_runtime::object::native_call_method::primitive_methods::dispatch_primitive has cognitive complexity 186 (threshold 15). Drivers by points: if/else 69 (145 pts), match/switch 8 (21 pts), boolean chains 20 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_runtime::child_process::reactor::cp_reactor_pump_inner (cognitive 175) crates/perry-runtime/src/child_process/reactor.rs:1176— perry_runtime::child_process::reactor::cp_reactor_pump_inner has cognitive complexity 175 (threshold 15). Drivers by points: if/else 43 (139 pts), match/switch 6 (22 pts), loops 6 (11 pts), boolean chains 3 (nesting depth added 117). 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.
perry_runtime::object::global_this::fetch_globals::js_fetch_or_value_super (cognitive 154) crates/perry-runtime/src/object/global_this/fetch_globals.rs:606— perry_runtime::object::global_this::fetch_globals::js_fetch_or_value_super has cognitive complexity 154 (threshold 15). Drivers by points: if/else 77 (127 pts), boolean chains 19, match/switch 6 (8 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_runtime::object::global_this::populate::populate_global_this_builtins_inner (cognitive 146) crates/perry-runtime/src/object/global_this/populate.rs:73— perry_runtime::object::global_this::populate::populate_global_this_builtins_inner has cognitive complexity 146 (threshold 15). Drivers by points: if/else 54 (124 pts), loops 7 (10 pts), match/switch 3 (8 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.
perry_runtime::object::native_call_method::string_methods::dispatch_string (cognitive 145) crates/perry-runtime/src/object/native_call_method/string_methods.rs:3— perry_runtime::object::native_call_method::string_methods::dispatch_string has cognitive complexity 145 (threshold 15). Drivers by points: if/else 31 (83 pts), match/switch 13 (53 pts), boolean chains 5, loops 1 (4 pts) (nesting depth added 95). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_runtime::object::field_get_set::get_field_by_name::class_value_get_field (cognitive 142) crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs:94— perry_runtime::object::field_get_set::get_field_by_name::class_value_get_field has cognitive complexity 142 (threshold 15). Drivers by points: if/else 51 (120 pts), boolean chains 15, match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_runtime::object::native_get::try_data_lookup_key (cognitive 139) crates/perry-runtime/src/object/native_get.rs:132— perry_runtime::object::native_get::try_data_lookup_key has cognitive complexity 139 (threshold 15). Drivers by points: if/else 46 (117 pts), boolean chains 21, loops 1 (nesting depth added 71). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Hotspot: crates/perry/src/commands/compile/run_pipeline.rs crates/perry/src/commands/compile/run_pipeline.rs:565— crates/perry/src/commands/compile/run_pipeline.rs changed 173 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 936 in perry::commands::compile::run_pipeline::run_with_parse_cache at line 565. 43 of those changes were fix/bug commits, and the other 130 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry/src/commands/compile/run_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/perry-codegen/src/codegen/mod.rs crates/perry-codegen/src/codegen/mod.rs:606— crates/perry-codegen/src/codegen/mod.rs changed 184 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 365 in perry_codegen::codegen::lower_module at line 606. 26 of those changes were fix/bug commits, and the other 158 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs:8— crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 319 in perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail at line 8. 16 of those changes were fix/bug commits, and the other 63 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.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/perry-hir/src/stable_hash/expr.rs crates/perry-hir/src/stable_hash/expr.rs:31— crates/perry-hir/src/stable_hash/expr.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 659 in Expr::hash at line 31. 10 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-hir/src/stable_hash/expr.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/perry-codegen/src/codegen/method.rs crates/perry-codegen/src/codegen/method.rs:135— crates/perry-codegen/src/codegen/method.rs changed 136 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in perry_codegen::codegen::method::compile_method at line 135. 19 of those changes were fix/bug commits, and the other 117 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/method.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/perry-runtime/src/object/native_call_method.rs crates/perry-runtime/src/object/native_call_method.rs:1228— crates/perry-runtime/src/object/native_call_method.rs changed 112 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 150 in perry_runtime::object::native_call_method::native_call_method_tower at line 1228. 28 of those changes were fix/bug commits, and the other 84 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/native_call_method.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/perry/src/commands/compile/collect_modules.rs crates/perry/src/commands/compile/collect_modules.rs:167— crates/perry/src/commands/compile/collect_modules.rs changed 73 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 230 in perry::commands::compile::collect_modules::collect_module_one at line 167. 18 of those changes were fix/bug commits, and the other 55 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry/src/commands/compile/collect_modules.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/perry-hir/src/lower_decl/body_stmt.rs crates/perry-hir/src/lower_decl/body_stmt.rs:105— crates/perry-hir/src/lower_decl/body_stmt.rs changed 51 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 288 in perry_hir::lower_decl::body_stmt::lower_body_stmt_impl at line 105. 19 of those changes were fix/bug commits, and the other 32 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-hir/src/lower_decl/body_stmt.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/perry-codegen/src/codegen/function.rs crates/perry-codegen/src/codegen/function.rs:614— crates/perry-codegen/src/codegen/function.rs changed 141 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in perry_codegen::codegen::function::compile_function at line 614. 14 of those changes were fix/bug commits, and the other 127 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/function.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/perry-runtime/src/object/field_get_set/get_field_by_name.rs crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs:600— crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in perry_runtime::object::field_get_set::get_field_by_name::get_field_by_name_past_data_probe at line 600. 16 of those changes were fix/bug commits, and the other 56 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/field_get_set/get_field_by_name.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/perry-codegen/src/expr/property_get.rs crates/perry-codegen/src/expr/property_get.rs:72— crates/perry-codegen/src/expr/property_get.rs changed 91 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in perry_codegen::expr::property_get::lower at line 72. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/expr/property_get.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: scripts/gc_root_dominance_check.py scripts/gc_root_dominance_check.py:6812— scripts/gc_root_dominance_check.py changed 84 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 140 in gc_root_dominance_check.self_test at line 6812. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- scripts/gc_root_dominance_check.py`: 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/perry-codegen/src/expr/mod.rs crates/perry-codegen/src/expr/mod.rs:4392— crates/perry-codegen/src/expr/mod.rs changed 280 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in perry_codegen::expr::lower_expr_value at line 4392. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/expr/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/perry-codegen/src/codegen/string_pool.rs crates/perry-codegen/src/codegen/string_pool.rs:58— crates/perry-codegen/src/codegen/string_pool.rs changed 75 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in perry_codegen::codegen::string_pool::emit_string_pool at line 58. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/string_pool.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/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:156— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 164 in perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call at line 156. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.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/perry-codegen/src/codegen/closure.rs crates/perry-codegen/src/codegen/closure.rs:441— crates/perry-codegen/src/codegen/closure.rs changed 131 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in perry_codegen::codegen::closure::compile_closure at line 441. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/closure.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/perry-codegen/src/stmt/let_stmt.rs crates/perry-codegen/src/stmt/let_stmt.rs:22— crates/perry-codegen/src/stmt/let_stmt.rs changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 187 in perry_codegen::stmt::let_stmt::lower_let at line 22. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/stmt/let_stmt.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/perry-hir/src/lower/module_decl.rs crates/perry-hir/src/lower/module_decl.rs:89— crates/perry-hir/src/lower/module_decl.rs changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 228 in perry_hir::lower::module_decl::lower_module_decl at line 89. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-hir/src/lower/module_decl.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/perry-codegen/src/codegen/entry.rs crates/perry-codegen/src/codegen/entry.rs:105— crates/perry-codegen/src/codegen/entry.rs changed 139 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in perry_codegen::codegen::entry::compile_module_entry at line 105. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/entry.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/perry-codegen/src/lower_call/new.rs crates/perry-codegen/src/lower_call/new.rs:229— crates/perry-codegen/src/lower_call/new.rs changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in perry_codegen::lower_call::new::lower_new_impl_inner at line 229. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/lower_call/new.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/perry-runtime/src/object/field_set_by_name/tail.rs crates/perry-runtime/src/object/field_set_by_name/tail.rs:39— crates/perry-runtime/src/object/field_set_by_name/tail.rs changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 147 in perry_runtime::object::field_set_by_name::tail::set_field_by_name_object_tail at line 39. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/field_set_by_name/tail.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/perry-runtime/src/object/object_ops/prototype.rs crates/perry-runtime/src/object/object_ops/prototype.rs:264— crates/perry-runtime/src/object/object_ops/prototype.rs changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 152 in perry_runtime::object::object_ops::prototype::get_prototype_of_resolved at line 264. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/object_ops/prototype.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/perry-codegen/src/expr/instance_misc1.rs crates/perry-codegen/src/expr/instance_misc1.rs:266— crates/perry-codegen/src/expr/instance_misc1.rs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 207 in perry_codegen::expr::instance_misc1::lower at line 266. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/expr/instance_misc1.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/perry-runtime/src/object/descriptors.rs crates/perry-runtime/src/object/descriptors.rs:226— crates/perry-runtime/src/object/descriptors.rs changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 127 in perry_runtime::object::descriptors::own_property at line 226. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/descriptors.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/perry/src/commands/compile/link/build_and_run.rs crates/perry/src/commands/compile/link/build_and_run.rs:17— crates/perry/src/commands/compile/link/build_and_run.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 269 in perry::commands::compile::link::build_and_run::build_and_run_link at line 17. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry/src/commands/compile/link/build_and_run.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.
FunctionTooLong: perry::commands::compile::run_pipeline::run_with_parse_cache crates/perry/src/commands/compile/run_pipeline.rs:565— FunctionTooLong — perry::commands::compile::run_pipeline::run_with_parse_cache runs 4429 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 4329 over it, 44.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_hir::walker::expr_mut::walk_expr_children_mut crates/perry-hir/src/walker/expr_mut.rs:6— FunctionTooLong — perry_hir::walker::expr_mut::walk_expr_children_mut runs 1560 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 1460 over it, 15.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_hir::walker::expr_ref::walk_expr_children crates/perry-hir/src/walker/expr_ref.rs:7— FunctionTooLong — perry_hir::walker::expr_ref::walk_expr_children runs 1560 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 1460 over it, 15.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_hir::lower_decl::body_stmt::lower_body_stmt_impl crates/perry-hir/src/lower_decl/body_stmt.rs:105— FunctionTooLong — perry_hir::lower_decl::body_stmt::lower_body_stmt_impl runs 1534 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 1434 over it, 15.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: perry::commands::publish::run_async crates/perry/src/commands/publish/mod.rs:84— FunctionTooLong — perry::commands::publish::run_async runs 1349 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 1249 over it, 13.49× 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: perry_codegen::runtime_decls::strings::declare_phase_b_strings crates/perry-codegen/src/runtime_decls/strings.rs:12— FunctionTooLong — perry_codegen::runtime_decls::strings::declare_phase_b_strings runs 1254 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 1154 over it, 12.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry::commands::compile::collect_modules::collect_module_one crates/perry/src/commands/compile/collect_modules.rs:167— FunctionTooLong — perry::commands::compile::collect_modules::collect_module_one runs 1189 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 1089 over it, 11.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:156— FunctionTooLong — perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call runs 1128 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 1028 over it, 11.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: perry_codegen::expr::this_super_call::lower_impl crates/perry-codegen/src/expr/this_super_call.rs:201— FunctionTooLong — perry_codegen::expr::this_super_call::lower_impl runs 1078 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 978 over it, 10.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_hir::lower::module_decl::lower_module_decl crates/perry-hir/src/lower/module_decl.rs:89— FunctionTooLong — perry_hir::lower::module_decl::lower_module_decl runs 1014 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 914 over it, 10.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_codegen::runtime_decls::strings_part2::declare_phase_b_strings_part2 crates/perry-codegen/src/runtime_decls/strings_part2.rs:9— FunctionTooLong — perry_codegen::runtime_decls::strings_part2::declare_phase_b_strings_part2 runs 995 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 895 over it, 9.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.
FunctionTooLong: wasm_runtime.buildImports crates/perry-codegen-wasm/src/wasm_runtime.js:137— FunctionTooLong — buildImports runs 947 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 847 over it, 9.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.
FunctionTooLong: perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs:8— FunctionTooLong — perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail runs 932 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 832 over it, 9.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_hir::lower::expr_call::module_static::try_module_static_methods crates/perry-hir/src/lower/expr_call/module_static.rs:53— FunctionTooLong — perry_hir::lower::expr_call::module_static::try_module_static_methods runs 919 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 819 over it, 9.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_codegen::stmt::let_stmt::lower_let crates/perry-codegen/src/stmt/let_stmt.rs:22— FunctionTooLong — perry_codegen::stmt::let_stmt::lower_let runs 895 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 795 over it, 8.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.
FunctionTooLong: perry_codegen::expr::property_get::lower crates/perry-codegen/src/expr/property_get.rs:72— FunctionTooLong — perry_codegen::expr::property_get::lower runs 884 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 784 over it, 8.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_wpfacts::compute_in crates/perry-wpfacts/src/lib.rs:266— FunctionTooLong — perry_wpfacts::compute_in runs 878 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 778 over it, 8.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_codegen::lower_call::method_override::emit_guarded_direct_method_call crates/perry-codegen/src/lower_call/method_override.rs:764— FunctionTooLong — perry_codegen::lower_call::method_override::emit_guarded_direct_method_call runs 867 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 767 over it, 8.67× 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: perry_codegen::lower_call::options::fetch::lower_fetch_native_method crates/perry-codegen/src/lower_call/options/fetch.rs:28— FunctionTooLong — perry_codegen::lower_call::options::fetch::lower_fetch_native_method runs 856 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 756 over it, 8.56× 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: perry_codegen::expr::bigint_set::lower crates/perry-codegen/src/expr/bigint_set.rs:434— FunctionTooLong — perry_codegen::expr::bigint_set::lower runs 854 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 754 over it, 8.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: perry_hir::lower::expr_member::lower_member_inner crates/perry-hir/src/lower/expr_member.rs:241— FunctionTooLong — perry_hir::lower::expr_member::lower_member_inner runs 853 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 753 over it, 8.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.
FunctionTooLong: perry_hir::monomorph::substitute_expr::substitute_expr crates/perry-hir/src/monomorph/substitute_expr.rs:4— FunctionTooLong — perry_hir::monomorph::substitute_expr::substitute_expr runs 836 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 736 over it, 8.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: perry_codegen::lower_call::new::lower_new_impl_inner crates/perry-codegen/src/lower_call/new.rs:229— FunctionTooLong — perry_codegen::lower_call::new::lower_new_impl_inner runs 834 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 734 over it, 8.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: perry_transform::generator::linearize::linearize_body crates/perry-transform/src/generator/linearize.rs:607— FunctionTooLong — perry_transform::generator::linearize::linearize_body runs 818 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 718 over it, 8.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: perry_codegen::lower_call::builtin::lower_builtin_new crates/perry-codegen/src/lower_call/builtin.rs:166— FunctionTooLong — perry_codegen::lower_call::builtin::lower_builtin_new runs 816 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 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.
FileTooLong: stmt/loops.rs crates/perry-codegen/src/stmt/loops.rs— FileTooLong — 6269 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 138 free functions. The bar is 500 significant lines; this is 5769 over it, 12.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: compile/run_pipeline.rs crates/perry/src/commands/compile/run_pipeline.rs— FileTooLong — 4805 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 4305 over it, 9.61× 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: scripts/gc_root_dominance_check.py scripts/gc_root_dominance_check.py— FileTooLong — 4021 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3521 over it, 8.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/wasm_runtime.js crates/perry-codegen-wasm/src/wasm_runtime.js— FileTooLong — 3600 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 3100 over it, 7.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: object/shapes.rs crates/perry-runtime/src/object/shapes.rs— FileTooLong — 3480 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 182 free functions. The bar is 500 significant lines; this is 2980 over it, 6.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/web_runtime.js crates/perry-codegen-js/src/web_runtime.js— FileTooLong — 2999 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 2499 over it, 6.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: expr/mod.rs crates/perry-codegen/src/expr/mod.rs— FileTooLong — 2259 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 1759 over it, 4.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: src/typed_feedback.rs crates/perry-runtime/src/typed_feedback.rs— FileTooLong — 1909 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 90 free functions. The bar is 500 significant lines; this is 1409 over it, 3.82× 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/streams.rs crates/perry-stdlib/src/streams.rs— FileTooLong — 1864 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 138 free functions. The bar is 500 significant lines; this is 1364 over it, 3.73× 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: gc/policy.rs crates/perry-runtime/src/gc/policy.rs— FileTooLong — 1819 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 148 free functions. The bar is 500 significant lines; this is 1319 over it, 3.64× 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/gen_rest.rs crates/perry-wpfacts/src/gen_rest.rs— FileTooLong — 1658 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: Gen (23-1982). The bar is 500 significant lines; this is 1158 over it, 3.32× 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: lower_decl/body_stmt.rs crates/perry-hir/src/lower_decl/body_stmt.rs— FileTooLong — 1643 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 1143 over it, 3.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/map.rs crates/perry-runtime/src/map.rs— FileTooLong — 1630 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 100 free functions. The bar is 500 significant lines; this is 1130 over it, 3.26× 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: walker/expr_mut.rs crates/perry-hir/src/walker/expr_mut.rs— FileTooLong — 1561 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 1061 over it, 3.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: walker/expr_ref.rs crates/perry-hir/src/walker/expr_ref.rs— FileTooLong — 1561 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 1061 over it, 3.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: inline/call_inliner.rs crates/perry-transform/src/inline/call_inliner.rs— FileTooLong — 1557 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 1057 over it, 3.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/gc_store_site_inventory.py scripts/gc_store_site_inventory.py— FileTooLong — 1482 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 982 over it, 2.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: ir/expr.rs crates/perry-hir/src/ir/expr.rs— FileTooLong — 1473 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: Expr (2 blocks, 57-2956). The bar is 500 significant lines; this is 973 over it, 2.95× 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: object/runtime_layouts.rs crates/perry-runtime/src/object/runtime_layouts.rs— FileTooLong — 1461 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 961 over it, 2.92× 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: collectors/hir_facts.rs crates/perry-codegen/src/collectors/hir_facts.rs— FileTooLong — 1429 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 929 over it, 2.86× 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: publish/mod.rs crates/perry/src/commands/publish/mod.rs— FileTooLong — 1422 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 922 over it, 2.84× 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: dir_glob_watch/watch.rs crates/perry-runtime/src/fs/dir_glob_watch/watch.rs— FileTooLong — 1398 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 91 free functions. The bar is 500 significant lines; this is 898 over it, 2.80× 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: object/builtin_method.rs crates/perry-runtime/src/object/builtin_method.rs— FileTooLong — 1396 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 119 free functions. The bar is 500 significant lines; this is 896 over it, 2.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: scripts/wpfacts_recompute.py scripts/wpfacts_recompute.py— FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 867 over it, 2.73× 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: analysis/value_types.rs crates/perry-hir/src/analysis/value_types.rs— FileTooLong — 1360 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 860 over it, 2.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
perry_codegen::codegen::lower_module (cognitive 781) crates/perry-codegen/src/codegen/mod.rs:606— perry_codegen::codegen::lower_module has cognitive complexity 781 (threshold 15). Drivers by points: if/else 216 (528 pts), loops 94 (156 pts), boolean chains 49, match/switch 20 (48 pts) (nesting depth added 402). 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.
perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call (cognitive 490) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:156— perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call has cognitive complexity 490 (threshold 15). Drivers by points: if/else 103 (321 pts), loops 24 (83 pts), boolean chains 50, match/switch 9 (36 pts) (nesting depth added 304). 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.
perry_codegen::stmt::let_stmt::lower_let (cognitive 382) crates/perry-codegen/src/stmt/let_stmt.rs:22— perry_codegen::stmt::let_stmt::lower_let has cognitive complexity 382 (threshold 15). Drivers by points: if/else 144 (299 pts), boolean chains 32, loops 10 (28 pts), match/switch 9 (23 pts) (nesting depth added 187). 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.
perry_codegen::codegen::method::compile_method (cognitive 333) crates/perry-codegen/src/codegen/method.rs:135— perry_codegen::codegen::method::compile_method has cognitive complexity 333 (threshold 15). Drivers by points: if/else 112 (231 pts), loops 14 (50 pts), boolean chains 30, match/switch 7 (22 pts) (nesting depth added 170). 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.
perry_codegen::expr::this_super_call::lower_impl (cognitive 320) crates/perry-codegen/src/expr/this_super_call.rs:201— perry_codegen::expr::this_super_call::lower_impl has cognitive complexity 320 (threshold 15). Drivers by points: if/else 75 (208 pts), loops 17 (56 pts), match/switch 26 (47 pts), boolean chains 9 (nesting depth added 193). 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.
perry_codegen::lower_call::new::lower_new_impl_inner (cognitive 305) crates/perry-codegen/src/lower_call/new.rs:229— perry_codegen::lower_call::new::lower_new_impl_inner has cognitive complexity 305 (threshold 15). Drivers by points: if/else 105 (221 pts), boolean chains 39, loops 11 (30 pts), match/switch 8 (15 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.
perry_codegen::expr::property_get::lower (cognitive 304) crates/perry-codegen/src/expr/property_get.rs:72— perry_codegen::expr::property_get::lower has cognitive complexity 304 (threshold 15). Drivers by points: if/else 93 (261 pts), boolean chains 33, match/switch 4 (6 pts), loops 1 (4 pts) (nesting depth added 173). 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.
perry_codegen::expr::new_dynamic::lower (cognitive 291) crates/perry-codegen/src/expr/new_dynamic.rs:43— perry_codegen::expr::new_dynamic::lower has cognitive complexity 291 (threshold 15). Drivers by points: if/else 71 (242 pts), loops 9 (33 pts), match/switch 4 (11 pts), boolean chains 5 (nesting depth added 202). 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.
perry_codegen::expr::literals_vars::lower (cognitive 277) crates/perry-codegen/src/expr/literals_vars.rs:348— perry_codegen::expr::literals_vars::lower has cognitive complexity 277 (threshold 15). Drivers by points: if/else 105 (256 pts), boolean chains 11, match/switch 9 (10 pts) (nesting depth added 152). 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.
perry_codegen::lower_call::early_branches::try_lower_closure_typed_local_call (cognitive 268) crates/perry-codegen/src/lower_call/early_branches.rs:378— perry_codegen::lower_call::early_branches::try_lower_closure_typed_local_call has cognitive complexity 268 (threshold 15). Drivers by points: if/else 50 (191 pts), loops 10 (54 pts), match/switch 8 (20 pts), boolean chains 3 (nesting depth added 197). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_codegen::codegen::string_pool::emit_string_pool (cognitive 265) crates/perry-codegen/src/codegen/string_pool.rs:58— perry_codegen::codegen::string_pool::emit_string_pool has cognitive complexity 265 (threshold 15). Drivers by points: if/else 90 (173 pts), loops 43 (59 pts), boolean chains 22, match/switch 6 (11 pts) (nesting depth added 104). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen::expr::index_set::lower (cognitive 228) crates/perry-codegen/src/expr/index_set.rs:519— perry_codegen::expr::index_set::lower has cognitive complexity 228 (threshold 15). Drivers by points: if/else 69 (212 pts), boolean chains 15, match/switch 1 (nesting depth added 143). 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.
perry_codegen::collectors::escape_check::check_escapes_in_expr (cognitive 226) crates/perry-codegen/src/collectors/escape_check.rs:227— perry_codegen::collectors::escape_check::check_escapes_in_expr has cognitive complexity 226 (threshold 15). Drivers by points: if/else 69 (176 pts), loops 20 (40 pts), match/switch 4 (9 pts), boolean chains 1 (nesting depth added 132). 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.
perry_codegen::lower_call::builtin::lower_builtin_new (cognitive 204) crates/perry-codegen/src/lower_call/builtin.rs:166— perry_codegen::lower_call::builtin::lower_builtin_new has cognitive complexity 204 (threshold 15). Drivers by points: if/else 50 (87 pts), match/switch 41 (68 pts), loops 21 (49 pts) (nesting depth added 92). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen::codegen::module_globals_emit::emit_module_globals (cognitive 193) crates/perry-codegen/src/codegen/module_globals_emit.rs:187— perry_codegen::codegen::module_globals_emit::emit_module_globals has cognitive complexity 193 (threshold 15). Drivers by points: if/else 34 (100 pts), loops 31 (54 pts), match/switch 6 (28 pts), boolean chains 11 (nesting depth added 111). Of this number, 184 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_codegen::lower_call::method_override::emit_guarded_direct_method_call (cognitive 193) crates/perry-codegen/src/lower_call/method_override.rs:764— perry_codegen::lower_call::method_override::emit_guarded_direct_method_call has cognitive complexity 193 (threshold 15). Drivers by points: if/else 76 (118 pts), loops 20 (37 pts), boolean chains 20, match/switch 10 (18 pts) (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen::expr::index_get::lower (cognitive 192) crates/perry-codegen/src/expr/index_get.rs:826— perry_codegen::expr::index_get::lower has cognitive complexity 192 (threshold 15). Drivers by points: if/else 58 (170 pts), boolean chains 12, match/switch 4 (10 pts) (nesting depth added 118). 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.
perry_codegen::lower_call::extern_func::try_lower_extern_func_call (cognitive 178) crates/perry-codegen/src/lower_call/extern_func.rs:626— perry_codegen::lower_call::extern_func::try_lower_extern_func_call has cognitive complexity 178 (threshold 15). Drivers by points: if/else 75 (133 pts), match/switch 8 (24 pts), boolean chains 11, loops 5 (10 pts) (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen::lower_call::options::fetch::lower_fetch_native_method (cognitive 178) crates/perry-codegen/src/lower_call/options/fetch.rs:28— perry_codegen::lower_call::options::fetch::lower_fetch_native_method has cognitive complexity 178 (threshold 15). Drivers by points: if/else 75 (144 pts), match/switch 14 (31 pts), boolean chains 3 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen::root_reload::apply_to_function (cognitive 178) crates/perry-codegen/src/root_reload.rs:486— perry_codegen::root_reload::apply_to_function has cognitive complexity 178 (threshold 15). Drivers by points: if/else 30 (87 pts), loops 24 (50 pts), match/switch 6 (22 pts), boolean chains 19 (nesting depth added 99). Of this number, 175 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.
perry_codegen::expr::static_method::lower (cognitive 172) crates/perry-codegen/src/expr/static_method.rs:183— perry_codegen::expr::static_method::lower has cognitive complexity 172 (threshold 15). Drivers by points: if/else 43 (121 pts), loops 8 (31 pts), boolean chains 12, match/switch 3 (8 pts) (nesting depth added 106). 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.
perry_codegen::expr::call_spread::lower (cognitive 169) crates/perry-codegen/src/expr/call_spread.rs:122— perry_codegen::expr::call_spread::lower has cognitive complexity 169 (threshold 15). Drivers by points: if/else 38 (119 pts), loops 6 (25 pts), match/switch 5 (14 pts), boolean chains 11 (nesting depth added 109). 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.
perry_codegen::codegen::function::compile_function (cognitive 167) crates/perry-codegen/src/codegen/function.rs:614— perry_codegen::codegen::function::compile_function has cognitive complexity 167 (threshold 15). Drivers by points: if/else 76 (120 pts), boolean chains 20, loops 12 (16 pts), match/switch 6 (11 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen::codegen::split_regions::try_extract (cognitive 167) crates/perry-codegen/src/codegen/split_regions.rs:509— perry_codegen::codegen::split_regions::try_extract has cognitive complexity 167 (threshold 15). Drivers by points: if/else 59 (107 pts), loops 19 (27 pts), boolean chains 23, match/switch 7 (10 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.
perry_codegen::codegen::artifacts::emit_module_artifacts (cognitive 155) crates/perry-codegen/src/codegen/artifacts.rs:33— perry_codegen::codegen::artifacts::emit_module_artifacts has cognitive complexity 155 (threshold 15). Drivers by points: if/else 49 (98 pts), loops 23 (34 pts), boolean chains 15, match/switch 3 (8 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail (cyclomatic 319) crates/perry-runtime/src/object/field_get_set/get_field_by_name_tail.rs:8— perry_runtime::object::field_get_set::get_field_by_name_tail::get_field_by_name_object_tail has cyclomatic complexity 319 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::native_module::constants::get_native_module_constant (cyclomatic 243) crates/perry-runtime/src/object/native_module/constants.rs:184— perry_runtime::object::native_module::constants::get_native_module_constant has cyclomatic complexity 243 (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.
perry_runtime::object::instanceof::static_dispatch::native_instanceof (cyclomatic 189) crates/perry-runtime/src/object/instanceof/static_dispatch.rs:210— perry_runtime::object::instanceof::static_dispatch::native_instanceof has cyclomatic complexity 189 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::buffer_dispatch::dispatch_buffer_method (cyclomatic 180) crates/perry-runtime/src/object/buffer_dispatch.rs:473— perry_runtime::object::buffer_dispatch::dispatch_buffer_method has cyclomatic complexity 180 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::field_get_set::get_field_by_name::get_field_by_name_past_data_probe (cyclomatic 177) crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs:600— perry_runtime::object::field_get_set::get_field_by_name::get_field_by_name_past_data_probe has cyclomatic complexity 177 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::native_call_method::handle_methods::dispatch_handle (cyclomatic 154) crates/perry-runtime/src/object/native_call_method/handle_methods.rs:56— perry_runtime::object::native_call_method::handle_methods::dispatch_handle has cyclomatic complexity 154 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::object_ops::prototype::get_prototype_of_resolved (cyclomatic 152) crates/perry-runtime/src/object/object_ops/prototype.rs:264— perry_runtime::object::object_ops::prototype::get_prototype_of_resolved has cyclomatic complexity 152 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::native_call_method::native_call_method_tower (cyclomatic 150) crates/perry-runtime/src/object/native_call_method.rs:1228— perry_runtime::object::native_call_method::native_call_method_tower has cyclomatic complexity 150 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::field_set_by_name::tail::set_field_by_name_object_tail (cyclomatic 147) crates/perry-runtime/src/object/field_set_by_name/tail.rs:39— perry_runtime::object::field_set_by_name::tail::set_field_by_name_object_tail has cyclomatic complexity 147 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::symbol::get::js_object_get_symbol_property_with_receiver (cyclomatic 136) crates/perry-runtime/src/symbol/get.rs:529— perry_runtime::symbol::get::js_object_get_symbol_property_with_receiver has cyclomatic complexity 136 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::field_get_set::has_property::object_has_property_generic (cyclomatic 135) crates/perry-runtime/src/object/field_get_set/has_property.rs:248— perry_runtime::object::field_get_set::has_property::object_has_property_generic has cyclomatic complexity 135 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::instanceof::dynamic_dispatch::js_instanceof_dynamic (cyclomatic 132) crates/perry-runtime/src/object/instanceof/dynamic_dispatch.rs:85— perry_runtime::object::instanceof::dynamic_dispatch::js_instanceof_dynamic has cyclomatic complexity 132 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::descriptors::own_property (cyclomatic 127) crates/perry-runtime/src/object/descriptors.rs:226— perry_runtime::object::descriptors::own_property has cyclomatic complexity 127 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::runtime_layouts::runtime_layout_word (cyclomatic 126) crates/perry-runtime/src/object/runtime_layouts.rs:1538— perry_runtime::object::runtime_layouts::runtime_layout_word has cyclomatic complexity 126 (threshold 15). Of this number, 123 points are the body's own statements and 3 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.
perry_runtime::object::object_ops::define_property::apply_property_descriptor (cyclomatic 117) crates/perry-runtime/src/object/object_ops/define_property.rs:291— perry_runtime::object::object_ops::define_property::apply_property_descriptor has cyclomatic complexity 117 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::native_call_method::primitive_methods::dispatch_primitive (cyclomatic 102) crates/perry-runtime/src/object/native_call_method/primitive_methods.rs:167— perry_runtime::object::native_call_method::primitive_methods::dispatch_primitive has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::field_set_by_name::js_object_set_field_by_name (cyclomatic 100) crates/perry-runtime/src/object/field_set_by_name.rs:46— perry_runtime::object::field_set_by_name::js_object_set_field_by_name 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.
perry_runtime::object::descriptors::js_object_get_own_property_names_shape (cyclomatic 97) crates/perry-runtime/src/object/descriptors.rs:1187— perry_runtime::object::descriptors::js_object_get_own_property_names_shape has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::global_this::populate::populate_global_this_builtins_inner (cyclomatic 93) crates/perry-runtime/src/object/global_this/populate.rs:73— perry_runtime::object::global_this::populate::populate_global_this_builtins_inner 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.
perry_runtime::object::native_call_method::string_methods::dispatch_string (cyclomatic 93) crates/perry-runtime/src/object/native_call_method/string_methods.rs:3— perry_runtime::object::native_call_method::string_methods::dispatch_string 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.
perry_runtime::object::global_this::fetch_globals::js_fetch_or_value_super (cyclomatic 90) crates/perry-runtime/src/object/global_this/fetch_globals.rs:606— perry_runtime::object::global_this::fetch_globals::js_fetch_or_value_super 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.
perry_runtime::object::delete_rest::js_object_delete_field (cyclomatic 87) crates/perry-runtime/src/object/delete_rest.rs:30— perry_runtime::object::delete_rest::js_object_delete_field has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_runtime::object::class_registry::construct::builtin::construct (cyclomatic 83) crates/perry-runtime/src/object/class_registry/construct/builtin.rs:5— perry_runtime::object::class_registry::construct::builtin::construct has cyclomatic complexity 83 (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.
perry_runtime::object::native_call_method::typed_array::dispatch_typed_array_method (cyclomatic 81) crates/perry-runtime/src/object/native_call_method/typed_array.rs:40— perry_runtime::object::native_call_method::typed_array::dispatch_typed_array_method 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.
perry_runtime::gc::copying::run_copied_minor_attempt (cyclomatic 79) crates/perry-runtime/src/gc/copying.rs:1016— perry_runtime::gc::copying::run_copied_minor_attempt has cyclomatic complexity 79 (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.
perry_codegen::codegen::lower_module (cyclomatic 365) crates/perry-codegen/src/codegen/mod.rs:606— perry_codegen::codegen::lower_module has cyclomatic complexity 365 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::expr::instance_misc1::lower (cyclomatic 207) crates/perry-codegen/src/expr/instance_misc1.rs:266— perry_codegen::expr::instance_misc1::lower has cyclomatic complexity 207 (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.
perry_codegen::stmt::let_stmt::lower_let (cyclomatic 187) crates/perry-codegen/src/stmt/let_stmt.rs:22— perry_codegen::stmt::let_stmt::lower_let has cyclomatic complexity 187 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::collectors::escape_check::check_escapes_in_expr (cyclomatic 180) crates/perry-codegen/src/collectors/escape_check.rs:227— perry_codegen::collectors::escape_check::check_escapes_in_expr has cyclomatic complexity 180 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call (cyclomatic 164) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:156— perry_codegen::lower_call::property_get::dynamic_dispatch::try_lower_instance_method_call has cyclomatic complexity 164 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::lower_call::builtin::lower_builtin_new (cyclomatic 161) crates/perry-codegen/src/lower_call/builtin.rs:166— perry_codegen::lower_call::builtin::lower_builtin_new has cyclomatic complexity 161 (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.
perry_codegen::lower_call::options::fetch::lower_fetch_native_method (cyclomatic 153) crates/perry-codegen/src/lower_call/options/fetch.rs:28— perry_codegen::lower_call::options::fetch::lower_fetch_native_method has cyclomatic complexity 153 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::collectors::refs::refs_expr (cyclomatic 150) crates/perry-codegen/src/collectors/refs.rs:206— perry_codegen::collectors::refs::refs_expr has cyclomatic complexity 150 (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.
perry_codegen::lower_call::new::lower_new_impl_inner (cyclomatic 149) crates/perry-codegen/src/lower_call/new.rs:229— perry_codegen::lower_call::new::lower_new_impl_inner has cyclomatic complexity 149 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::codegen::method::compile_method (cyclomatic 142) crates/perry-codegen/src/codegen/method.rs:135— perry_codegen::codegen::method::compile_method has cyclomatic complexity 142 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::expr::property_get::lower (cyclomatic 139) crates/perry-codegen/src/expr/property_get.rs:72— perry_codegen::expr::property_get::lower has cyclomatic complexity 139 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::expr::this_super_call::lower_impl (cyclomatic 139) crates/perry-codegen/src/expr/this_super_call.rs:201— perry_codegen::expr::this_super_call::lower_impl has cyclomatic complexity 139 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::codegen::string_pool::emit_string_pool (cyclomatic 138) crates/perry-codegen/src/codegen/string_pool.rs:58— perry_codegen::codegen::string_pool::emit_string_pool has cyclomatic complexity 138 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::collectors::escape_news::collect_used_new_fields_in_expr (cyclomatic 126) crates/perry-codegen/src/collectors/escape_news.rs:231— perry_codegen::collectors::escape_news::collect_used_new_fields_in_expr has cyclomatic complexity 126 (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.
perry_codegen::expr::literals_vars::lower (cyclomatic 112) crates/perry-codegen/src/expr/literals_vars.rs:348— perry_codegen::expr::literals_vars::lower 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.
perry_codegen::codegen::split_regions::try_extract (cyclomatic 107) crates/perry-codegen/src/codegen/split_regions.rs:509— perry_codegen::codegen::split_regions::try_extract has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::expr::logical_collections::lower (cyclomatic 107) crates/perry-codegen/src/expr/logical_collections.rs:548— perry_codegen::expr::logical_collections::lower has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::collectors::i32_locals::collect_localset_ids_in_expr_filtered (cyclomatic 106) crates/perry-codegen/src/collectors/i32_locals.rs:1233— perry_codegen::collectors::i32_locals::collect_localset_ids_in_expr_filtered has cyclomatic complexity 106 (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.
perry_codegen::lower_call::method_override::emit_guarded_direct_method_call (cyclomatic 105) crates/perry-codegen/src/lower_call/method_override.rs:764— perry_codegen::lower_call::method_override::emit_guarded_direct_method_call 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.
perry_codegen::codegen::function::compile_function (cyclomatic 103) crates/perry-codegen/src/codegen/function.rs:614— perry_codegen::codegen::function::compile_function has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::expr::compare::lower (cyclomatic 97) crates/perry-codegen/src/expr/compare.rs:1292— perry_codegen::expr::compare::lower has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen::expr::arrays_finds::lower (cyclomatic 95) crates/perry-codegen/src/expr/arrays_finds.rs:429— perry_codegen::expr::arrays_finds::lower has cyclomatic complexity 95 (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.
perry_codegen::lower_call::extern_func::try_lower_extern_func_call (cyclomatic 93) crates/perry-codegen/src/lower_call/extern_func.rs:626— perry_codegen::lower_call::extern_func::try_lower_extern_func_call 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.
perry_codegen::expr::string_regex_proc::lower (cyclomatic 92) crates/perry-codegen/src/expr/string_regex_proc.rs:18— perry_codegen::expr::string_regex_proc::lower has cyclomatic complexity 92 (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.
perry_codegen::codegen::artifacts::emit_module_artifacts (cyclomatic 90) crates/perry-codegen/src/codegen/artifacts.rs:33— perry_codegen::codegen::artifacts::emit_module_artifacts 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.
perry_hir::lower::module_decl::lower_module_decl (cognitive 883) crates/perry-hir/src/lower/module_decl.rs:89— perry_hir::lower::module_decl::lower_module_decl has cognitive complexity 883 (threshold 15). Drivers by points: if/else 150 (710 pts), match/switch 22 (113 pts), loops 10 (37 pts), boolean chains 23 (nesting depth added 678). 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.
perry_hir::lower_decl::body_stmt::lower_body_stmt_impl (cognitive 746) crates/perry-hir/src/lower_decl/body_stmt.rs:105— perry_hir::lower_decl::body_stmt::lower_body_stmt_impl has cognitive complexity 746 (threshold 15). Drivers by points: if/else 212 (552 pts), match/switch 29 (90 pts), loops 17 (64 pts), boolean chains 40 (nesting depth added 448). 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.
perry_hir::lower::stmt::lower_stmt_inner (cognitive 657) crates/perry-hir/src/lower/stmt.rs:483— perry_hir::lower::stmt::lower_stmt_inner has cognitive complexity 657 (threshold 15). Drivers by points: if/else 109 (505 pts), match/switch 15 (75 pts), loops 17 (72 pts), boolean chains 5 (nesting depth added 511). 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.
perry_hir::lower::expr_call::module_static::try_module_static_methods (cognitive 585) crates/perry-hir/src/lower/expr_call/module_static.rs:53— perry_hir::lower::expr_call::module_static::try_module_static_methods has cognitive complexity 585 (threshold 15). Drivers by points: if/else 106 (447 pts), match/switch 17 (86 pts), loops 4 (27 pts), boolean chains 25 (nesting depth added 433). 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.
perry_hir::destructuring::var_decl::native_fetch::register_native_fetch_and_streams (cognitive 528) crates/perry-hir/src/destructuring/var_decl/native_fetch.rs:20— perry_hir::destructuring::var_decl::native_fetch::register_native_fetch_and_streams has cognitive complexity 528 (threshold 15). Drivers by points: if/else 106 (467 pts), match/switch 9 (49 pts), boolean chains 12 (nesting depth added 401). 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.
perry_hir::lower::expr_member::lower_member_inner (cognitive 521) crates/perry-hir/src/lower/expr_member.rs:241— perry_hir::lower::expr_member::lower_member_inner has cognitive complexity 521 (threshold 15). Drivers by points: if/else 147 (375 pts), match/switch 23 (98 pts), boolean chains 46, loops 2 (nesting depth added 303). Of this number, 515 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_hir::lower::expr_new::lower_new (cognitive 470) crates/perry-hir/src/lower/expr_new.rs:37— perry_hir::lower::expr_new::lower_new has cognitive complexity 470 (threshold 15). Drivers by points: if/else 134 (337 pts), match/switch 22 (66 pts), boolean chains 55, loops 3 (12 pts) (nesting depth added 256). 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.
perry_hir::lower::expr_call::local_array_methods::try_local_array_methods (cognitive 369) crates/perry-hir/src/lower/expr_call/local_array_methods.rs:162— perry_hir::lower::expr_call::local_array_methods::try_local_array_methods has cognitive complexity 369 (threshold 15). Drivers by points: if/else 58 (267 pts), match/switch 10 (70 pts), boolean chains 32 (nesting depth added 269). 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.
perry_hir::lower::lower_module_fn::lower_module_full_with_platform_globals (cognitive 367) crates/perry-hir/src/lower/lower_module_fn.rs:889— perry_hir::lower::lower_module_fn::lower_module_full_with_platform_globals has cognitive complexity 367 (threshold 15). Drivers by points: if/else 81 (252 pts), loops 44 (79 pts), match/switch 10 (21 pts), boolean chains 15 (nesting depth added 217). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_hir::lower_decl::class_decl::lower_class_decl (cognitive 325) crates/perry-hir/src/lower_decl/class_decl.rs:111— perry_hir::lower_decl::class_decl::lower_class_decl has cognitive complexity 325 (threshold 15). Drivers by points: if/else 86 (214 pts), match/switch 25 (55 pts), loops 17 (33 pts), boolean chains 23 (nesting depth added 174). 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.
perry_hir::lower::lower_expr::arm_unary::lower_unary_expr (cognitive 287) crates/perry-hir/src/lower/lower_expr/arm_unary.rs:9— perry_hir::lower::lower_expr::arm_unary::lower_unary_expr has cognitive complexity 287 (threshold 15). Drivers by points: if/else 69 (238 pts), boolean chains 35, match/switch 2 (8 pts), loops 3 (6 pts) (nesting depth added 178). 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.
perry_hir::lower::stmt_loops::lower_stmt_for_of_inner (cognitive 286) crates/perry-hir/src/lower/stmt_loops.rs:654— perry_hir::lower::stmt_loops::lower_stmt_for_of_inner has cognitive complexity 286 (threshold 15). Drivers by points: if/else 121 (201 pts), match/switch 20 (38 pts), boolean chains 25, loops 7 (22 pts) (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_hir::lower::expr_call::globals::try_global_builtins (cognitive 269) crates/perry-hir/src/lower/expr_call/globals.rs:38— perry_hir::lower::expr_call::globals::try_global_builtins has cognitive complexity 269 (threshold 15). Drivers by points: if/else 86 (212 pts), match/switch 8 (30 pts), loops 5 (20 pts), boolean chains 7 (nesting depth added 163). 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.
perry_hir::lower::expr_function::lower_fn_expr_anon (cognitive 251) crates/perry-hir/src/lower/expr_function.rs:594— perry_hir::lower::expr_function::lower_fn_expr_anon has cognitive complexity 251 (threshold 15). Drivers by points: if/else 63 (183 pts), loops 18 (56 pts), boolean chains 8, match/switch 1 (4 pts) (nesting depth added 161). 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.
perry_hir::lower::expr_member::member_tail::lower_member_tail (cognitive 251) crates/perry-hir/src/lower/expr_member/member_tail.rs:19— perry_hir::lower::expr_member::member_tail::lower_member_tail has cognitive complexity 251 (threshold 15). Drivers by points: if/else 49 (160 pts), match/switch 18 (54 pts), boolean chains 32, loops 2 (5 pts) (nesting depth added 150). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_hir::walker::expr_mut::walk_expr_children_mut (cognitive 246) crates/perry-hir/src/walker/expr_mut.rs:6— perry_hir::walker::expr_mut::walk_expr_children_mut has cognitive complexity 246 (threshold 15). Drivers by points: if/else 77 (149 pts), loops 44 (88 pts), match/switch 5 (9 pts) (nesting depth added 120). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_hir::walker::expr_ref::walk_expr_children (cognitive 246) crates/perry-hir/src/walker/expr_ref.rs:7— perry_hir::walker::expr_ref::walk_expr_children has cognitive complexity 246 (threshold 15). Drivers by points: if/else 77 (149 pts), loops 44 (88 pts), match/switch 5 (9 pts) (nesting depth added 120). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_hir::lower::expr_call::array_only_methods::try_array_only_methods (cognitive 236) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:415— perry_hir::lower::expr_call::array_only_methods::try_array_only_methods has cognitive complexity 236 (threshold 15). Drivers by points: if/else 42 (163 pts), match/switch 8 (39 pts), boolean chains 34 (nesting depth added 152). 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.
perry_hir::destructuring::var_decl::native_new::register_native_from_new_and_calls (cognitive 214) crates/perry-hir/src/destructuring/var_decl/native_new.rs:15— perry_hir::destructuring::var_decl::native_new::register_native_from_new_and_calls has cognitive complexity 214 (threshold 15). Drivers by points: if/else 43 (182 pts), match/switch 4 (30 pts), boolean chains 2 (nesting depth added 165). 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.
perry_hir::lower_types::infer_call_return_type (cognitive 208) crates/perry-hir/src/lower_types.rs:1349— perry_hir::lower_types::infer_call_return_type has cognitive complexity 208 (threshold 15). Drivers by points: if/else 38 (121 pts), match/switch 19 (81 pts), boolean chains 6 (nesting depth added 145). 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.
perry_hir::lower::expr_call::lower_call_inner (cognitive 203) crates/perry-hir/src/lower/expr_call/mod.rs:286— perry_hir::lower::expr_call::lower_call_inner has cognitive complexity 203 (threshold 15). Drivers by points: if/else 53 (112 pts), match/switch 31 (81 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 114). 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.
perry_hir::lower::widget_decl::try_lower_widget_decl (cognitive 196) crates/perry-hir/src/lower/widget_decl.rs:17— perry_hir::lower::widget_decl::try_lower_widget_decl has cognitive complexity 196 (threshold 15). Drivers by points: if/else 42 (156 pts), match/switch 10 (22 pts), loops 5 (17 pts), boolean chains 1 (nesting depth added 138). 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.
perry_hir::js_transform::imports::transform_expr (cognitive 181) crates/perry-hir/src/js_transform/imports.rs:537— perry_hir::js_transform::imports::transform_expr has cognitive complexity 181 (threshold 15). Drivers by points: if/else 44 (103 pts), loops 28 (73 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 106). 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.
perry_hir::lower::expr_call::native_module::try_native_module_methods (cognitive 179) crates/perry-hir/src/lower/expr_call/native_module.rs:337— perry_hir::lower::expr_call::native_module::try_native_module_methods has cognitive complexity 179 (threshold 15). Drivers by points: if/else 34 (123 pts), match/switch 12 (49 pts), boolean chains 7 (nesting depth added 126). 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.
perry_hir::lower::expr_object::lower_object (cognitive 177) crates/perry-hir/src/lower/expr_object.rs:704— perry_hir::lower::expr_object::lower_object has cognitive complexity 177 (threshold 15). Drivers by points: if/else 51 (116 pts), match/switch 19 (62 pts), loops 9 (15 pts), boolean chains 7 (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. This shape REPEATS in the file: one other method here (perry_hir::lower::expr_object::lower_object::is_closed_shape) 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.
perry_hir::walker::expr_mut::walk_expr_children_mut (cyclomatic 332) crates/perry-hir/src/walker/expr_mut.rs:6— perry_hir::walker::expr_mut::walk_expr_children_mut has cyclomatic complexity 332 (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.
perry_hir::walker::expr_ref::walk_expr_children (cyclomatic 332) crates/perry-hir/src/walker/expr_ref.rs:7— perry_hir::walker::expr_ref::walk_expr_children has cyclomatic complexity 332 (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.
perry_hir::lower::expr_member::lower_member_inner (cyclomatic 303) crates/perry-hir/src/lower/expr_member.rs:241— perry_hir::lower::expr_member::lower_member_inner has cyclomatic complexity 303 (threshold 15). Of this number, 290 points are the body's own statements and 13 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.
perry_hir::lower_decl::body_stmt::lower_body_stmt_impl (cyclomatic 288) crates/perry-hir/src/lower_decl/body_stmt.rs:105— perry_hir::lower_decl::body_stmt::lower_body_stmt_impl has cyclomatic complexity 288 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::expr_call::module_static::try_module_static_methods (cyclomatic 261) crates/perry-hir/src/lower/expr_call/module_static.rs:53— perry_hir::lower::expr_call::module_static::try_module_static_methods has cyclomatic complexity 261 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::module_decl::lower_module_decl (cyclomatic 228) crates/perry-hir/src/lower/module_decl.rs:89— perry_hir::lower::module_decl::lower_module_decl has cyclomatic complexity 228 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::expr_new::lower_new (cyclomatic 217) crates/perry-hir/src/lower/expr_new.rs:37— perry_hir::lower::expr_new::lower_new has cyclomatic complexity 217 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::analysis::value_types::infer_expr_type (cyclomatic 189) crates/perry-hir/src/analysis/value_types.rs:551— perry_hir::analysis::value_types::infer_expr_type has cyclomatic complexity 189 (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.
perry_hir::lower::stmt::lower_stmt_inner (cyclomatic 172) crates/perry-hir/src/lower/stmt.rs:483— perry_hir::lower::stmt::lower_stmt_inner has cyclomatic complexity 172 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower_decl::class_decl::lower_class_decl (cyclomatic 163) crates/perry-hir/src/lower_decl/class_decl.rs:111— perry_hir::lower_decl::class_decl::lower_class_decl has cyclomatic complexity 163 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::expr_call::globals::try_global_builtins (cyclomatic 161) crates/perry-hir/src/lower/expr_call/globals.rs:38— perry_hir::lower::expr_call::globals::try_global_builtins has cyclomatic complexity 161 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::js_transform::imports::transform_expr (cyclomatic 156) crates/perry-hir/src/js_transform/imports.rs:537— perry_hir::js_transform::imports::transform_expr has cyclomatic complexity 156 (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.
perry_hir::lower::lower_module_fn::lower_module_full_with_platform_globals (cyclomatic 150) crates/perry-hir/src/lower/lower_module_fn.rs:889— perry_hir::lower::lower_module_fn::lower_module_full_with_platform_globals has cyclomatic complexity 150 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::stmt_loops::lower_stmt_for_of_inner (cyclomatic 149) crates/perry-hir/src/lower/stmt_loops.rs:654— perry_hir::lower::stmt_loops::lower_stmt_for_of_inner has cyclomatic complexity 149 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::destructuring::var_decl::native_fetch::register_native_fetch_and_streams (cyclomatic 141) crates/perry-hir/src/destructuring/var_decl/native_fetch.rs:20— perry_hir::destructuring::var_decl::native_fetch::register_native_fetch_and_streams has cyclomatic complexity 141 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::expr_call::local_array_methods::try_local_array_methods (cyclomatic 138) crates/perry-hir/src/lower/expr_call/local_array_methods.rs:162— perry_hir::lower::expr_call::local_array_methods::try_local_array_methods has cyclomatic complexity 138 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::expr_member::member_tail::lower_member_tail (cyclomatic 123) crates/perry-hir/src/lower/expr_member/member_tail.rs:19— perry_hir::lower::expr_member::member_tail::lower_member_tail has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::lower::lower_expr::arm_unary::lower_unary_expr (cyclomatic 120) crates/perry-hir/src/lower/lower_expr/arm_unary.rs:9— perry_hir::lower::lower_expr::arm_unary::lower_unary_expr 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.
perry_hir::lower::expr_call::array_only_methods::try_array_only_methods (cyclomatic 110) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:415— perry_hir::lower::expr_call::array_only_methods::try_array_only_methods has cyclomatic complexity 110 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::monomorph::update_call_sites::update_call_sites_in_expr (cyclomatic 104) crates/perry-hir/src/monomorph/update_call_sites.rs:127— perry_hir::monomorph::update_call_sites::update_call_sites_in_expr has cyclomatic complexity 104 (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.
perry_hir::lower_decl::class_decl::from_ast::lower_class_from_ast (cyclomatic 102) crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:10— perry_hir::lower_decl::class_decl::from_ast::lower_class_from_ast has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_hir::monomorph::driver::collect_instantiations_in_expr (cyclomatic 101) crates/perry-hir/src/monomorph/driver.rs:284— perry_hir::monomorph::driver::collect_instantiations_in_expr has cyclomatic complexity 101 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
perry_hir::lower_types::infer_type_from_expr_inner (cyclomatic 100) crates/perry-hir/src/lower_types.rs:417— perry_hir::lower_types::infer_type_from_expr_inner 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.
perry_hir::lower_types::infer_call_return_type (cyclomatic 100) crates/perry-hir/src/lower_types.rs:1349— perry_hir::lower_types::infer_call_return_type 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.
perry_hir::lower::expr_object::lower_object (cyclomatic 98) crates/perry-hir/src/lower/expr_object.rs:704— perry_hir::lower::expr_object::lower_object has cyclomatic complexity 98 (threshold 15). Of this number, 85 points are the body's own statements and 13 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.
perry::commands::compile::run_pipeline::run_with_parse_cache (cognitive 2499) crates/perry/src/commands/compile/run_pipeline.rs:565— perry::commands::compile::run_pipeline::run_with_parse_cache has cognitive complexity 2499 (threshold 15). Drivers by points: if/else 610 (1796 pts), loops 178 (410 pts), match/switch 70 (174 pts), boolean chains 119 (nesting depth added 1522). 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.
perry::commands::compile::link::build_and_run::build_and_run_link (cognitive 754) crates/perry/src/commands/compile/link/build_and_run.rs:17— perry::commands::compile::link::build_and_run::build_and_run_link has cognitive complexity 754 (threshold 15). Drivers by points: if/else 188 (516 pts), loops 34 (138 pts), boolean chains 65, match/switch 15 (35 pts) (nesting depth added 452). 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.
perry::commands::publish::run_async (cognitive 594) crates/perry/src/commands/publish/mod.rs:84— perry::commands::publish::run_async has cognitive complexity 594 (threshold 15). Drivers by points: if/else 298 (506 pts), boolean chains 36, match/switch 15 (36 pts), loops 6 (16 pts) (nesting depth added 239). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry::commands::compile::collect_modules::collect_module_one (cognitive 569) crates/perry/src/commands/compile/collect_modules.rs:167— perry::commands::compile::collect_modules::collect_module_one has cognitive complexity 569 (threshold 15). Drivers by points: if/else 153 (404 pts), match/switch 32 (80 pts), loops 18 (49 pts), boolean chains 36 (nesting depth added 330). 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.
perry::commands::compile::host_config::apply_pkg_and_toml_config (cognitive 563) crates/perry/src/commands/compile/host_config.rs:114— perry::commands::compile::host_config::apply_pkg_and_toml_config has cognitive complexity 563 (threshold 15). Drivers by points: if/else 118 (395 pts), loops 22 (98 pts), match/switch 21 (51 pts), boolean chains 19 (nesting depth added 383). Of this number, 536 points are the body's own statements and 27 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry::commands::compile::cjs_wrap::wrap::wrap_commonjs_with_addon_paths (cognitive 202) crates/perry/src/commands/compile/cjs_wrap/wrap.rs:280— perry::commands::compile::cjs_wrap::wrap::wrap_commonjs_with_addon_paths has cognitive complexity 202 (threshold 15). Drivers by points: if/else 122 (172 pts), loops 18 (27 pts), boolean chains 24, match/switch 4 (6 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (perry::commands::compile::cjs_wrap::wrap::wrap_commonjs_with_addon_paths::require_site_in_try) 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.
perry::commands::compile::cjs_wrap::hoist_classes::extract_top_level_class_decls_with_exports (cognitive 170) crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs:229— perry::commands::compile::cjs_wrap::hoist_classes::extract_top_level_class_decls_with_exports has cognitive complexity 170 (threshold 15). Drivers by points: if/else 24 (89 pts), loops 16 (54 pts), boolean chains 21, match/switch 1 (6 pts) (nesting depth added 108). 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.
perry::commands::compile::bundle_ios::build_ios_app_bundle (cognitive 155) crates/perry/src/commands/compile/bundle_ios.rs:34— perry::commands::compile::bundle_ios::build_ios_app_bundle has cognitive complexity 155 (threshold 15). Drivers by points: if/else 57 (119 pts), loops 12 (26 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 81). Of this number, 145 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry::commands::compile::link::platform_cmd::select_linker_command (cognitive 147) crates/perry/src/commands/compile/link/platform_cmd.rs:118— perry::commands::compile::link::platform_cmd::select_linker_command has cognitive complexity 147 (threshold 15). Drivers by points: if/else 73 (121 pts), boolean chains 14, loops 4 (9 pts), match/switch 1 (3 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry::commands::setup::ios::ios_wizard (cognitive 140) crates/perry/src/commands/setup/ios.rs:13— perry::commands::setup::ios::ios_wizard has cognitive complexity 140 (threshold 15). Drivers by points: if/else 69 (131 pts), boolean chains 4, loops 1 (4 pts), match/switch 1 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry::commands::check::run (cognitive 131) crates/perry/src/commands/check.rs:112— perry::commands::check::run has cognitive complexity 131 (threshold 15). Drivers by points: if/else 50 (87 pts), match/switch 10 (21 pts), boolean chains 13, loops 4 (10 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.
perry::commands::compile::collect_modules::finish::collect_module_finish (cognitive 128) crates/perry/src/commands/compile/collect_modules/finish.rs:11— perry::commands::compile::collect_modules::finish::collect_module_finish has cognitive complexity 128 (threshold 15). Drivers by points: if/else 17 (61 pts), loops 14 (57 pts), match/switch 2 (8 pts), boolean chains 2 (nesting depth added 93). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry::commands::compile::cjs_wrap::hoist_classes::collect_top_level_let_const_var_names (cognitive 125) crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs:724— perry::commands::compile::cjs_wrap::hoist_classes::collect_top_level_let_const_var_names has cognitive complexity 125 (threshold 15). Drivers by points: if/else 15 (46 pts), loops 14 (44 pts), boolean chains 29, match/switch 2 (6 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry::commands::publish::preflight::ios_preflight_validation (cognitive 123) crates/perry/src/commands/publish/preflight.rs:82— perry::commands::publish::preflight::ios_preflight_validation has cognitive complexity 123 (threshold 15). Drivers by points: if/else 31 (113 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 86). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry::commands::compile::cjs_wrap::extract_exports::extract_object_literal_exports_from_require (cognitive 111) crates/perry/src/commands/compile/cjs_wrap/extract_exports.rs:185— perry::commands::compile::cjs_wrap::extract_exports::extract_object_literal_exports_from_require has cognitive complexity 111 (threshold 15). Drivers by points: if/else 22 (58 pts), loops 12 (28 pts), boolean chains 19, match/switch 4 (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.
perry::commands::compile::collect_modules::feature_detect::detect_optional_feature_usage (cognitive 100) crates/perry/src/commands/compile/collect_modules/feature_detect.rs:522— perry::commands::compile::collect_modules::feature_detect::detect_optional_feature_usage has cognitive complexity 100 (threshold 15). Drivers by points: boolean chains 53, if/else 46 (47 pts) (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.
perry::commands::compile::cjs_wrap::family_syntax::analyze (cognitive 99) crates/perry/src/commands/compile/cjs_wrap/family_syntax.rs:249— perry::commands::compile::cjs_wrap::family_syntax::analyze has cognitive complexity 99 (threshold 15). Drivers by points: if/else 23 (59 pts), match/switch 5 (21 pts), loops 7 (14 pts), boolean chains 5 (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.
perry::commands::compile::resolve::resolve_import_with_bunfs (cognitive 95) crates/perry/src/commands/compile/resolve.rs:1580— perry::commands::compile::resolve::resolve_import_with_bunfs has cognitive complexity 95 (threshold 15). Drivers by points: if/else 34 (82 pts), boolean chains 8, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry::commands::compile::cjs_wrap::extract_exports::extract_exports_from_source (cognitive 94) crates/perry/src/commands/compile/cjs_wrap/extract_exports.rs:406— perry::commands::compile::cjs_wrap::extract_exports::extract_exports_from_source has cognitive complexity 94 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 13 (29 pts), boolean chains 20, match/switch 2 (6 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.
perry::commands::compile::strip_dedup::strip_duplicate_objects_from_lib_with_evidence (cognitive 87) crates/perry/src/commands/compile/strip_dedup.rs:622— perry::commands::compile::strip_dedup::strip_duplicate_objects_from_lib_with_evidence has cognitive complexity 87 (threshold 15). Drivers by points: if/else 51 (72 pts), loops 4 (9 pts), boolean chains 4, match/switch 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.
perry::commands::run::remote::remote_build_and_launch (cognitive 86) crates/perry/src/commands/run/remote.rs:12— perry::commands::run::remote::remote_build_and_launch has cognitive complexity 86 (threshold 15). Drivers by points: if/else 40 (66 pts), match/switch 8 (12 pts), boolean chains 7, loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry::commands::compile::object_cache::compute_object_cache_key_with_env (cognitive 83) crates/perry/src/commands/compile/object_cache.rs:311— perry::commands::compile::object_cache::compute_object_cache_key_with_env has cognitive complexity 83 (threshold 15). Drivers by points: if/else 53 (67 pts), loops 9 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 19). 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.
perry::commands::compile::collect_modules::static_require_transform::transform_static_literal_requires_with_bunfs (cognitive 77) crates/perry/src/commands/compile/collect_modules/static_require_transform.rs:21— perry::commands::compile::collect_modules::static_require_transform::transform_static_literal_requires_with_bunfs has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (62 pts), loops 6 (9 pts), boolean chains 6 (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.
perry::commands::compile::resolve::resolve_with_extensions (cognitive 70) crates/perry/src/commands/compile/resolve.rs:607— perry::commands::compile::resolve::resolve_with_extensions has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (49 pts), loops 5 (14 pts), boolean chains 7 (nesting depth added 40). 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.
perry::commands::run::android::build_and_run_android_impl (cognitive 67) crates/perry/src/commands/run/android.rs:37— perry::commands::run::android::build_and_run_android_impl has cognitive complexity 67 (threshold 15). Drivers by points: if/else 33 (57 pts), match/switch 3 (6 pts), loops 2 (3 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.
Duplicated block (5 lines × 2) crates/perry-codegen-arkts/src/widgets/foreach.rs:36— crates/perry-codegen-arkts/src/widgets/foreach.rs:36-40 | crates/perry-codegen-arkts/src/widgets/scroll.rs:199-203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/perry-codegen-glance/src/emit.rs:703— crates/perry-codegen-glance/src/emit.rs:703-707 | crates/perry-codegen-wear-tiles/src/emit.rs:468-472 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 2) crates/perry-codegen/src/builtin_proto.rs:322— crates/perry-codegen/src/builtin_proto.rs:322-326 | crates/perry-codegen/src/expr/method_site.rs:674-678 — 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/perry-codegen/src/codegen/artifacts.rs:395— crates/perry-codegen/src/codegen/artifacts.rs:395-399 | crates/perry-codegen/src/codegen/export_value_wrappers.rs:182-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/perry-codegen/src/codegen/closure.rs:324— crates/perry-codegen/src/codegen/closure.rs:324-328 | crates/perry-codegen/src/codegen/closure.rs:370-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 (5 lines × 2) crates/perry-codegen/src/codegen/export_value_wrappers.rs:227— crates/perry-codegen/src/codegen/export_value_wrappers.rs:227-231 | crates/perry-codegen/src/codegen/export_value_wrappers.rs:291-295 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/function.rs:298— crates/perry-codegen/src/codegen/function.rs:298-302 | crates/perry-codegen/src/codegen/method_trampolines.rs:97-101 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_trampolines.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/codegen/function.rs:309— crates/perry-codegen/src/codegen/function.rs:309-313 | crates/perry-codegen/src/codegen/function.rs:506-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.
Duplicated block (5 lines × 2) crates/perry-codegen/src/codegen/function.rs:764— crates/perry-codegen/src/codegen/function.rs:764-768 | crates/perry-codegen/src/codegen/method_static.rs:79-83 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 268 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/codegen/mod.rs:1938— crates/perry-codegen/src/codegen/mod.rs:1938-1942 | crates/perry-codegen/src/codegen/mod.rs:1987-1991 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/source_need/flow.rs:1698— crates/perry-codegen/src/codegen/source_need/flow.rs:1698-1702 | crates/perry-codegen/src/codegen/source_need/flow.rs:1766-1770 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/split_regions.rs:481— crates/perry-codegen/src/codegen/split_regions.rs:481-485 | crates/perry-codegen/src/collectors/typed_locals.rs:126-130 — 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/perry-codegen/src/codegen/static_constfn.rs:37— crates/perry-codegen/src/codegen/static_constfn.rs:37-41 | crates/perry-codegen/src/codegen/static_constfn.rs:572-576 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/static_fields.rs:156— crates/perry-codegen/src/codegen/static_fields.rs:156-160 | crates/perry-codegen/src/codegen/static_fields.rs:292-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 (5 lines × 2) crates/perry-codegen/src/codegen/static_shape_ids.rs:701— crates/perry-codegen/src/codegen/static_shape_ids.rs:701-705 | crates/perry-codegen/src/codegen/static_shape_ids.rs:721-725 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/typed_abi.rs:101— crates/perry-codegen/src/codegen/typed_abi.rs:101-105 | crates/perry-codegen/src/expr/proven_view_guarded.rs:101-105 — 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/perry-codegen/src/collectors/ptr_shape_elements.rs:797— crates/perry-codegen/src/collectors/ptr_shape_elements.rs:797-801 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:1011-1015 — both copies are in the same file, so extract the block into 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/perry-codegen/src/dialect/mod.rs:875— crates/perry-codegen/src/dialect/mod.rs:875-879 | crates/perry-codegen/src/dialect/mod.rs:1013-1017 — both copies are in the same file, so extract the block into 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/perry-codegen/src/dialect/mod.rs:960— crates/perry-codegen/src/dialect/mod.rs:960-970 | crates/perry-codegen/src/dialect/mod.rs:1064-1068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/perry-codegen/src/expr/array_literal.rs:439— crates/perry-codegen/src/expr/array_literal.rs:439-443 | crates/perry-codegen/src/expr/array_literal.rs:453-457 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/arrays_finds.rs:890— crates/perry-codegen/src/expr/arrays_finds.rs:890-894 | crates/perry-codegen/src/expr/arrays_finds.rs:898-902 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/binary.rs:878— crates/perry-codegen/src/expr/binary.rs:878-882 | crates/perry-codegen/src/expr/binary.rs:918-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 (5 lines × 2) crates/perry-codegen/src/expr/byte_cell.rs:289— crates/perry-codegen/src/expr/byte_cell.rs:289-293 | crates/perry-codegen/src/expr/byte_cell.rs:546-550 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/calls/crypto_misc.rs:94— crates/perry-codegen/src/expr/calls/crypto_misc.rs:94-98 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:278-282 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/calls/fs.rs:450— crates/perry-codegen/src/expr/calls/fs.rs:450-455 | crates/perry-codegen/src/expr/calls/fs.rs:466-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
perry_transform::inline::call_inliner::try_inline_simple_call (cognitive 170) crates/perry-transform/src/inline/call_inliner.rs:1596— perry_transform::inline::call_inliner::try_inline_simple_call has cognitive complexity 170 (threshold 15). Drivers by points: if/else 29 (137 pts), loops 3 (20 pts), match/switch 2 (10 pts), boolean chains 3 (nesting depth added 133). 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.
perry_transform::generator::linearize::linearize_body (cognitive 147) crates/perry-transform/src/generator/linearize.rs:607— perry_transform::generator::linearize::linearize_body has cognitive complexity 147 (threshold 15). Drivers by points: if/else 34 (95 pts), loops 9 (31 pts), match/switch 4 (12 pts), boolean chains 9 (nesting depth added 91). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_transform::inline::call_inliner::inline_calls_in_stmts (cognitive 135) crates/perry-transform/src/inline/call_inliner.rs:344— perry_transform::inline::call_inliner::inline_calls_in_stmts has cognitive complexity 135 (threshold 15). Drivers by points: if/else 31 (97 pts), loops 5 (18 pts), match/switch 5 (15 pts), boolean chains 5 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_transform::generator::lower::transform_generator_function_with_extra_captures (cognitive 133) crates/perry-transform/src/generator/lower.rs:301— perry_transform::generator::lower::transform_generator_function_with_extra_captures has cognitive complexity 133 (threshold 15). Drivers by points: if/else 67 (107 pts), loops 15 (16 pts), boolean chains 9, match/switch 1 (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.
perry_transform::inline::call_inliner::try_inline_call (cognitive 102) crates/perry-transform/src/inline/call_inliner.rs:2051— perry_transform::inline::call_inliner::try_inline_call has cognitive complexity 102 (threshold 15). Drivers by points: if/else 19 (65 pts), loops 6 (27 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 69). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_transform::inline::inline_functions_inner (cognitive 93) crates/perry-transform/src/inline/mod.rs:280— perry_transform::inline::inline_functions_inner has cognitive complexity 93 (threshold 15). Drivers by points: if/else 31 (66 pts), loops 32 (63 pts), boolean chains 5, match/switch 1 (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. This shape REPEATS in the file: one other method here (perry_transform::inline::inline_functions_inner::walk_stmt_exprs) 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.
perry_transform::inline::cross_module::localize_cross_module_functions (cognitive 86) crates/perry-transform/src/inline/cross_module.rs:571— perry_transform::inline::cross_module::localize_cross_module_functions has cognitive complexity 86 (threshold 15). Drivers by points: if/else 20 (55 pts), loops 13 (26 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_transform::deforest::detect::detect_producers (cognitive 62) crates/perry-transform/src/deforest/detect.rs:18— perry_transform::deforest::detect::detect_producers has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 19 (31 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.
perry_transform::aggregate_scalar::rewrite_return_record_stmts (cognitive 61) crates/perry-transform/src/aggregate_scalar.rs:971— perry_transform::aggregate_scalar::rewrite_return_record_stmts has cognitive complexity 61 (threshold 15). Drivers by points: if/else 16 (49 pts), loops 4 (10 pts), match/switch 1 (2 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.
perry_transform::finally_inline::process_stmts (cognitive 56) crates/perry-transform/src/finally_inline.rs:235— perry_transform::finally_inline::process_stmts has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (35 pts), match/switch 4 (13 pts), loops 3 (7 pts), boolean chains 1 (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.
perry_transform::inline::call_inliner::inline_calls_in_expr (cognitive 53) crates/perry-transform/src/inline/call_inliner.rs:884— perry_transform::inline::call_inliner::inline_calls_in_expr has cognitive complexity 53 (threshold 15). Drivers by points: loops 12 (24 pts), if/else 12 (22 pts), match/switch 3 (7 pts) (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.
perry_transform::generator::transform_generator_closures_in_stmts (cognitive 52) crates/perry-transform/src/generator/mod.rs:253— perry_transform::generator::transform_generator_closures_in_stmts has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 4 (9 pts), match/switch 2 (5 pts) (nesting depth added 35). Of this number, 51 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_transform::generator::private_frame::lower_list (cognitive 52) crates/perry-transform/src/generator/private_frame.rs:343— perry_transform::generator::private_frame::lower_list has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (80 pts), loops 9 (19 pts), match/switch 6 (15 pts), boolean chains 1 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (perry_transform::generator::private_frame::lower_list::ids, perry_transform::generator::private_frame::lower_list::catch_binders) 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.
perry_transform::aggregate_scalar::return_record_stmts_are_safe (cognitive 50) crates/perry-transform/src/aggregate_scalar.rs:757— perry_transform::aggregate_scalar::return_record_stmts_are_safe has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 7, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 24). Of this number, 42 points are the body's own statements and 8 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.
perry_transform::inline::factory_specialize::specialize_captured_class_factories::rewrite_to_specialized_class (cognitive 50) crates/perry-transform/src/inline/factory_specialize.rs:801— perry_transform::inline::factory_specialize::specialize_captured_class_factories::rewrite_to_specialized_class has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 6 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (perry_transform::inline::factory_specialize::specialize_captured_class_factories, perry_transform::inline::factory_specialize::specialize_captured_class_factories::resolve_factory_return_class, perry_transform::inline::factory_specialize::specialize_captured_class_factories::visit_stmts, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
perry_transform::unroll::refresh_in_stmt (cognitive 50) crates/perry-transform/src/unroll/mod.rs:820— perry_transform::unroll::refresh_in_stmt has cognitive complexity 50 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 11 (23 pts), match/switch 1 (nesting depth added 27). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_transform::inline::factory_specialize::specialize_captured_class_factories (cognitive 47) crates/perry-transform/src/inline/factory_specialize.rs:21— perry_transform::inline::factory_specialize::specialize_captured_class_factories has cognitive complexity 47 (threshold 15). Drivers by points: if/else 64 (135 pts), loops 20 (37 pts), match/switch 10 (13 pts), boolean chains 4 (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. This shape REPEATS in the file: 4 other methods here (perry_transform::inline::factory_specialize::specialize_captured_class_factories::resolve_factory_return_class, perry_transform::inline::factory_specialize::specialize_captured_class_factories::visit_stmts, perry_transform::inline::factory_specialize::specialize_captured_class_factories::rewrite_call_init, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
perry_transform::async_to_generator::hoist_awaits_in_stmt (cognitive 46) crates/perry-transform/src/async_to_generator.rs:502— perry_transform::async_to_generator::hoist_awaits_in_stmt has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 3 (7 pts), boolean chains 2, match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_transform::i18n::apply_i18n (cognitive 46) crates/perry-transform/src/i18n.rs:70— perry_transform::i18n::apply_i18n has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 15 (23 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_transform::generator::transform_generators (cognitive 45) crates/perry-transform/src/generator/mod.rs:110— perry_transform::generator::transform_generators has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 8 (12 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.
perry_transform::inline::closure_analysis::find_max_local_id::check_stmt (cognitive 45) crates/perry-transform/src/inline/closure_analysis.rs:716— perry_transform::inline::closure_analysis::find_max_local_id::check_stmt has cognitive complexity 45 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 9 (18 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.
perry_transform::async_to_generator::transform_async_to_generator (cognitive 42) crates/perry-transform/src/async_to_generator.rs:110— perry_transform::async_to_generator::transform_async_to_generator has cognitive complexity 42 (threshold 15). Drivers by points: loops 13 (30 pts), if/else 4 (12 pts) (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.
perry_transform::state_desugar::try_rewrite_state_access (cognitive 42) crates/perry-transform/src/state_desugar.rs:937— perry_transform::state_desugar::try_rewrite_state_access has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 2 (10 pts), boolean chains 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_transform::deforest::scan::scan_stmt_call_sites (cognitive 41) crates/perry-transform/src/deforest/scan.rs:27— perry_transform::deforest::scan::scan_stmt_call_sites has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (11 pts), match/switch 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.
perry_transform::generator::break_continue::body_contains_yield (cognitive 40) crates/perry-transform/src/generator/break_continue.rs:276— perry_transform::generator::break_continue::body_contains_yield has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 2 (4 pts), boolean chains 3, 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.
Duplicated block (6 lines × 2) crates/perry-codegen-arkts/src/mutations.rs:565— crates/perry-codegen-arkts/src/mutations.rs:565-570 | crates/perry-codegen-arkts/src/mutations.rs:593-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/perry-codegen-arkts/src/widgets/inputs.rs:56— crates/perry-codegen-arkts/src/widgets/inputs.rs:56-61 | crates/perry-codegen-arkts/src/widgets/inputs.rs:82-87 — both copies are in the same file, so extract the block into 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/perry-codegen-glance/src/emit_glue.rs:10— crates/perry-codegen-glance/src/emit_glue.rs:10-15 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:11-16 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (6 lines × 2) crates/perry-codegen-glance/src/emit_glue.rs:22— crates/perry-codegen-glance/src/emit_glue.rs:22-28 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:21-26 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (6 lines × 2) crates/perry-codegen/src/codegen/export_value_wrappers.rs:308— crates/perry-codegen/src/codegen/export_value_wrappers.rs:308-313 | crates/perry-codegen/src/codegen/module_globals_emit.rs:646-651 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/perry-codegen/src/codegen/method_trampolines.rs:154— crates/perry-codegen/src/codegen/method_trampolines.rs:154-159 | crates/perry-codegen/src/codegen/method_trampolines.rs:411-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/perry-codegen/src/codegen/method_trampolines.rs:331— crates/perry-codegen/src/codegen/method_trampolines.rs:331-336 | crates/perry-codegen/src/lower_call/method_override.rs:422-428 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/perry-codegen/src/codegen/realm_image.rs:182— crates/perry-codegen/src/codegen/realm_image.rs:182-187 | crates/perry-codegen/src/codegen/realm_image.rs:309-314 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_arrays.rs:189— crates/perry-codegen/src/collectors/escape_arrays.rs:189-194 | crates/perry-codegen/src/expr/property_get.rs:112-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/perry-codegen/src/collectors/literal_method_home.rs:67— crates/perry-codegen/src/collectors/literal_method_home.rs:67-72 | crates/perry-codegen/src/collectors/typed_locals.rs:1178-1183 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/array_methods.rs:147— crates/perry-codegen/src/expr/array_methods.rs:147-152 | crates/perry-codegen/src/expr/array_methods.rs:361-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 (6 lines × 2) crates/perry-codegen/src/expr/bigint_set.rs:1511— crates/perry-codegen/src/expr/bigint_set.rs:1511-1518 | crates/perry-codegen/src/expr/bigint_set.rs:1537-1542 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/body_call.rs:162— crates/perry-codegen/src/expr/body_call.rs:162-167 | crates/perry-codegen/src/expr/collection_receiver.rs:68-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/buffer_access.rs:821— crates/perry-codegen/src/expr/buffer_access.rs:821-826 | crates/perry-codegen/src/expr/proven_view_access.rs:597-602 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/byte_cell.rs:543— crates/perry-codegen/src/expr/byte_cell.rs:543-548 | crates/perry-codegen/src/expr/static_method.rs:348-353 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:20— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:20-25 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:634-639 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_kdf.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/calls/crypto_keys.rs:42— crates/perry-codegen/src/expr/calls/crypto_keys.rs:42-47 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:165-170 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_keys.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 8 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/class_field_push.rs:35— crates/perry-codegen/src/expr/class_field_push.rs:35-40 | crates/perry-codegen/src/stmt/loops.rs:3301-3306 — before extracting anything, compare `crates/perry-codegen/src/expr/class_field_push.rs` and `crates/perry-codegen/src/stmt/loops.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 2) crates/perry-codegen/src/expr/compare.rs:137— crates/perry-codegen/src/expr/compare.rs:137-142 | crates/perry-codegen/src/lower_string_concat.rs:289-294 — before extracting anything, compare `crates/perry-codegen/src/expr/compare.rs` and `crates/perry-codegen/src/lower_string_concat.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 2) crates/perry-codegen/src/expr/compare.rs:136— crates/perry-codegen/src/expr/compare.rs:136-141 | crates/perry-codegen/src/stmt/loops.rs:6784-6789 — before extracting anything, compare `crates/perry-codegen/src/expr/compare.rs` and `crates/perry-codegen/src/stmt/loops.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 2) crates/perry-codegen/src/expr/i32_fast_path.rs:1154— crates/perry-codegen/src/expr/i32_fast_path.rs:1154-1159 | crates/perry-codegen/src/expr/i32_fast_path.rs:1217-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/index_get.rs:413— crates/perry-codegen/src/expr/index_get.rs:413-418 | crates/perry-codegen/src/expr/index_get.rs:1248-1253 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/js_runtime.rs:30— crates/perry-codegen/src/expr/js_runtime.rs:30-35 | crates/perry-codegen/src/expr/js_runtime.rs:54-59 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/literals_vars.rs:367— crates/perry-codegen/src/expr/literals_vars.rs:367-372 | crates/perry-codegen/src/expr/this_super_call.rs:212-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/perry-codegen/src/expr/object_literal.rs:288— crates/perry-codegen/src/expr/object_literal.rs:288-293 | crates/perry-codegen/src/lower_call/new_alloc.rs:973-978 — 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/perry-audio-miniaudio/src/lib.rs:1000— crates/perry-audio-miniaudio/src/lib.rs:1000-1007 | crates/perry-audio-miniaudio/src/lib.rs:1022-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/perry-codegen-arkts/src/widgets/structure.rs:148— crates/perry-codegen-arkts/src/widgets/structure.rs:148-155 | crates/perry-codegen-arkts/src/widgets/structure.rs:314-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/perry-codegen-glance/src/emit.rs:86— crates/perry-codegen-glance/src/emit.rs:86-93 | crates/perry-codegen-wear-tiles/src/emit.rs:103-110 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/perry-codegen-glance/src/emit_glue.rs:110— crates/perry-codegen-glance/src/emit_glue.rs:110-117 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:61-68 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (8 lines × 2) crates/perry-codegen-wasm/src/emit/locals.rs:67— crates/perry-codegen-wasm/src/emit/locals.rs:67-74 | crates/perry-codegen-wasm/src/emit/locals.rs:229-236 — both copies are in the same file, so extract the block into 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/perry-codegen/src/closure_births.rs:196— crates/perry-codegen/src/closure_births.rs:196-203 | crates/perry-codegen/src/expr/literal_descriptor.rs:330-337 — 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/perry-codegen/src/codegen/artifact_display_names.rs:77— crates/perry-codegen/src/codegen/artifact_display_names.rs:77-84 | crates/perry-codegen/src/codegen/artifact_display_names.rs:86-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 (8 lines × 2) crates/perry-codegen/src/codegen/closure.rs:315— crates/perry-codegen/src/codegen/closure.rs:315-322 | crates/perry-codegen/src/codegen/closure.rs:361-368 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/global_transfer.rs:171— crates/perry-codegen/src/codegen/global_transfer.rs:171-178 | crates/perry-codegen/src/codegen/global_transfer.rs:225-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.
Duplicated block (8 lines × 2) crates/perry-codegen/src/codegen/method.rs:1092— crates/perry-codegen/src/codegen/method.rs:1092-1099 | crates/perry-codegen/src/codegen/method.rs:1281-1288 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/method.rs:1677— crates/perry-codegen/src/codegen/method.rs:1677-1684 | crates/perry-codegen/src/codegen/method_static.rs:576-583 — before extracting anything, compare `crates/perry-codegen/src/codegen/method.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/perry-codegen/src/codegen/method_trampolines.rs:160— crates/perry-codegen/src/codegen/method_trampolines.rs:160-167 | crates/perry-codegen/src/codegen/method_trampolines.rs:431-438 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/method_trampolines.rs:360— crates/perry-codegen/src/codegen/method_trampolines.rs:360-370 | crates/perry-codegen/src/codegen/method_trampolines.rs:438-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/perry-codegen/src/codegen/param_guard.rs:1334— crates/perry-codegen/src/codegen/param_guard.rs:1334-1341 | crates/perry-codegen/src/module.rs:904-911 — 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/perry-codegen/src/codegen/realm_image.rs:174— crates/perry-codegen/src/codegen/realm_image.rs:174-181 | crates/perry-codegen/src/codegen/realm_image.rs:301-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/perry-codegen/src/codegen/static_prototype.rs:206— crates/perry-codegen/src/codegen/static_prototype.rs:206-213 | crates/perry-codegen/src/codegen/static_prototype.rs:375-382 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/definite_init.rs:452— crates/perry-codegen/src/collectors/definite_init.rs:452-459 | crates/perry-codegen/src/collectors/definite_init.rs:466-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:340— crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:340-347 | crates/perry-codegen/src/collectors/spec_abi_sites.rs:1390-1397 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/perry-codegen/src/collectors/int_valued_ta_locals.rs:1577— crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:1577-1584 | crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:1586-1593 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/pointer_locals.rs:235— crates/perry-codegen/src/collectors/pointer_locals.rs:235-242 | crates/perry-hir/src/analysis/value_types.rs:999-1006 — before extracting anything, compare `crates/perry-codegen/src/collectors/pointer_locals.rs` and `crates/perry-hir/src/analysis/value_types.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/perry-codegen/src/collectors/ptr_shape_returns.rs:153— crates/perry-codegen/src/collectors/ptr_shape_returns.rs:153-160 | crates/perry-codegen/src/collectors/ptr_shape_returns.rs:274-281 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/segview.rs:731— crates/perry-codegen/src/collectors/segview.rs:731-738 | crates/perry-codegen/src/collectors/segview.rs:1352-1359 — both copies are in the same file, so extract the block into 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/perry-codegen/src/concat_site_cache.rs:199— crates/perry-codegen/src/concat_site_cache.rs:199-206 | crates/perry-codegen/src/expr/number_to_string_inline.rs:38-47 — 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/perry-codegen/src/concat_site_cache.rs:198— crates/perry-codegen/src/concat_site_cache.rs:198-206 | crates/perry-codegen/src/expr/array_push.rs:1128-1135 — 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/perry-codegen/src/expr/array_literal.rs:292— crates/perry-codegen/src/expr/array_literal.rs:292-299 | crates/perry-codegen/src/lower_call/new_alloc.rs:768-782 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/lower_call/new_alloc.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-audio-miniaudio/src/lib.rs:719— crates/perry-audio-miniaudio/src/lib.rs:719-725 | crates/perry-audio-miniaudio/src/lib.rs:741-747 — both copies are in the same file, so extract the block into 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/perry-codegen-glance/src/emit.rs:40— crates/perry-codegen-glance/src/emit.rs:40-46 | crates/perry-codegen-wear-tiles/src/emit.rs:41-47 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen-js/src/emit/mod.rs:314— crates/perry-codegen-js/src/emit/mod.rs:314-320 | crates/perry-codegen-js/src/emit/mod.rs:365-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/perry-codegen/src/codegen/closure.rs:263— crates/perry-codegen/src/codegen/closure.rs:263-269 | crates/perry-codegen/src/codegen/closure.rs:407-413 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/closure.rs:729— crates/perry-codegen/src/codegen/closure.rs:729-735 | crates/perry-codegen/src/codegen/function.rs:905-911 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/codegen/function.rs:1800— crates/perry-codegen/src/codegen/function.rs:1800-1806 | crates/perry-codegen/src/codegen/method_static.rs:570-576 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 268 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/codegen/mod.rs:1511— crates/perry-codegen/src/codegen/mod.rs:1511-1517 | crates/perry-codegen/src/codegen/mod.rs:1524-1530 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/static_constfn.rs:431— crates/perry-codegen/src/codegen/static_constfn.rs:431-437 | crates/perry-codegen/src/layout_desc/array_families.rs:548-554 — 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/perry-codegen/src/codegen/static_prototype.rs:193— crates/perry-codegen/src/codegen/static_prototype.rs:193-199 | crates/perry-codegen/src/codegen/static_prototype.rs:360-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 (7 lines × 2) crates/perry-codegen/src/codegen/static_prototype.rs:200— crates/perry-codegen/src/codegen/static_prototype.rs:200-206 | crates/perry-codegen/src/codegen/static_prototype.rs:260-266 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/typed_abi/lower.rs:233— crates/perry-codegen/src/codegen/typed_abi/lower.rs:233-239 | crates/perry-codegen/src/codegen/typed_abi/lower.rs:508-514 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/byte_read_key.rs:168— crates/perry-codegen/src/collectors/byte_read_key.rs:168-175 | crates/perry-codegen/src/collectors/pointer_locals.rs:75-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/perry-codegen/src/collectors/definite_init.rs:531— crates/perry-codegen/src/collectors/definite_init.rs:531-537 | crates/perry-codegen/src/collectors/definite_init.rs:637-643 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/i32_locals.rs:128— crates/perry-codegen/src/collectors/i32_locals.rs:128-139 | crates/perry-codegen/src/collectors/integer_locals.rs:1147-1153 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/integer_locals.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/collectors/ptr_numarray.rs:246— crates/perry-codegen/src/collectors/ptr_numarray.rs:246-252 | crates/perry-codegen/src/collectors/ptr_shape.rs:226-232 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/collectors/ptr_numarray.rs:798— crates/perry-codegen/src/collectors/ptr_numarray.rs:798-804 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:1100-1106 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape_elements.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/expr/array_pop.rs:67— crates/perry-codegen/src/expr/array_pop.rs:67-73 | crates/perry-codegen/src/expr/ic_fast_split.rs:77-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/perry-codegen/src/expr/calls.rs:354— crates/perry-codegen/src/expr/calls.rs:354-360 | crates/perry-codegen/src/expr/calls.rs:399-405 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/calls/crypto_keys.rs:57— crates/perry-codegen/src/expr/calls/crypto_keys.rs:57-63 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:559-565 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_keys.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 8 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/expr/checked_super.rs:124— crates/perry-codegen/src/expr/checked_super.rs:124-130 | crates/perry-codegen/src/expr/checked_super.rs:131-137 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/compare.rs:667— crates/perry-codegen/src/expr/compare.rs:667-673 | crates/perry-codegen/src/expr/compare.rs:1132-1138 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_get.rs:125— crates/perry-codegen/src/expr/index_get.rs:125-131 | crates/perry-codegen/src/expr/index_set.rs:178-184 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get.rs` and `crates/perry-codegen/src/expr/index_set.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/perry-codegen/src/expr/index_get.rs:956— crates/perry-codegen/src/expr/index_get.rs:956-962 | crates/perry-codegen/src/expr/index_get.rs:1352-1358 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:321— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:321-327 | crates/perry-codegen/src/stmt/versioned_indexed_loop.rs:322-328 — 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/perry-codegen/src/expr/js_runtime.rs:133— crates/perry-codegen/src/expr/js_runtime.rs:133-139 | crates/perry-codegen/src/expr/js_runtime.rs:231-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyFunctions: perry_runtime::object::builtin_proto_entries crates/perry-runtime/src/object/builtin_proto_entries.rs:60— TooManyFunctions — 227 free functions. The bar is 30 free functions; this is 197 over it, 7.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: perry_ui_ios::ffi::widgets_advanced crates/perry-ui-ios/src/ffi/widgets_advanced.rs:12— TooManyFunctions — 115 free functions. The bar is 30 free functions; this is 85 over it, 3.83× 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: perry_ui_macos::lib_ffi::advanced_widgets crates/perry-ui-macos/src/lib_ffi/advanced_widgets.rs:9— TooManyFunctions — 83 free functions. The bar is 30 free functions; this is 53 over it, 2.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_ui_macos::lib_ffi::window_misc crates/perry-ui-macos/src/lib_ffi/window_misc.rs:10— TooManyFunctions — 81 free functions. The bar is 30 free functions; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::dns::ffi crates/perry-runtime/src/dns/ffi.rs:6— TooManyFunctions — 80 free functions. The bar is 30 free functions; this is 50 over it, 2.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.
TooManyFunctions: perry_ext_net::payload_prototype crates/perry-ext-net/src/payload_prototype.rs:8— TooManyFunctions — 79 free functions. The bar is 30 free functions; 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.
TooManyFunctions: perry_ui_macos::lib_ffi::core_widgets crates/perry-ui-macos/src/lib_ffi/core_widgets.rs:11— TooManyFunctions — 78 free functions. The bar is 30 free functions; this is 48 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_ui_tvos::ffi::advanced_widgets crates/perry-ui-tvos/src/ffi/advanced_widgets.rs:13— TooManyFunctions — 77 free functions. The bar is 30 free functions; this is 47 over it, 2.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: perry_ui_visionos::ffi_widgets_extra crates/perry-ui-visionos/src/ffi_widgets_extra.rs:14— TooManyFunctions — 77 free functions. The bar is 30 free functions; this is 47 over it, 2.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: perry_runtime::object::global_this::builtin_thunks crates/perry-runtime/src/object/global_this/builtin_thunks.rs:3— TooManyFunctions — 72 free functions. The bar is 30 free functions; this is 42 over it, 2.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.
TooManyFunctions: perry_ui_android::ffi::canvas_picker crates/perry-ui-android/src/ffi/canvas_picker.rs:12— TooManyFunctions — 72 free functions. The bar is 30 free functions; this is 42 over it, 2.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.
TooManyFunctions: perry_ui_visionos::ffi_system crates/perry-ui-visionos/src/ffi_system.rs:19— TooManyFunctions — 68 free functions. The bar is 30 free functions; this is 38 over it, 2.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.
TooManyFunctions: perry_ui_macos::lib_ffi::interactivity crates/perry-ui-macos/src/lib_ffi/interactivity.rs:9— TooManyFunctions — 65 free functions. The bar is 30 free functions; this is 35 over it, 2.17× 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: perry_runtime::object::date_proto_thunks crates/perry-runtime/src/object/date_proto_thunks.rs:27— TooManyFunctions — 61 free functions. The bar is 30 free functions; this is 31 over it, 2.03× 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: perry_ui_android::ffi::embed_misc crates/perry-ui-android/src/ffi/embed_misc.rs:14— TooManyFunctions — 59 free functions. The bar is 30 free functions; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::buffer::numeric crates/perry-runtime/src/buffer/numeric.rs:19— TooManyFunctions — 57 free functions. The bar is 30 free functions; this is 27 over it, 1.90× 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: perry_runtime::buffer::store::layout crates/perry-runtime/src/buffer/store/layout.rs:12— TooManyFunctions — 56 free functions. The bar is 30 free functions; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::dyn_eval::bridge crates/perry-runtime/src/dyn_eval/bridge.rs:35— TooManyFunctions — 53 free functions. The bar is 30 free functions; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::node_submodules::stream_promises crates/perry-runtime/src/node_submodules/stream_promises.rs:29— TooManyFunctions — 53 free functions. The bar is 30 free functions; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::closure::dispatch::calln crates/perry-runtime/src/closure/dispatch/calln.rs:165— TooManyFunctions — 52 free functions. The bar is 30 free functions; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::url_hooks crates/perry-runtime/src/url_hooks.rs:33— TooManyFunctions — 52 free functions. The bar is 30 free functions; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::util_mime crates/perry-runtime/src/util_mime.rs:29— TooManyFunctions — 52 free functions. The bar is 30 free functions; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_ui_tvos::ffi::media_extras crates/perry-ui-tvos/src/ffi/media_extras.rs:15— TooManyFunctions — 52 free functions. The bar is 30 free functions; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_ui_visionos::ffi_core crates/perry-ui-visionos/src/ffi_core.rs:14— TooManyFunctions — 52 free functions. The bar is 30 free functions; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: perry_runtime::object::util_types crates/perry-runtime/src/object/util_types.rs:10— TooManyFunctions — 51 free functions. The bar is 30 free functions; 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.
perry::commands::compile::run_pipeline::run_with_parse_cache (cyclomatic 936) crates/perry/src/commands/compile/run_pipeline.rs:565— perry::commands::compile::run_pipeline::run_with_parse_cache has cyclomatic complexity 936 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::publish::run_async (cyclomatic 297) crates/perry/src/commands/publish/mod.rs:84— perry::commands::publish::run_async has cyclomatic complexity 297 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::compile::link::build_and_run::build_and_run_link (cyclomatic 269) crates/perry/src/commands/compile/link/build_and_run.rs:17— perry::commands::compile::link::build_and_run::build_and_run_link has cyclomatic complexity 269 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::compile::collect_modules::collect_module_one (cyclomatic 230) crates/perry/src/commands/compile/collect_modules.rs:167— perry::commands::compile::collect_modules::collect_module_one has cyclomatic complexity 230 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::compile::host_config::apply_pkg_and_toml_config (cyclomatic 188) crates/perry/src/commands/compile/host_config.rs:114— perry::commands::compile::host_config::apply_pkg_and_toml_config has cyclomatic complexity 188 (threshold 15). Of this number, 182 points are the body's own statements and 6 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.
perry::commands::compile::cjs_wrap::wrap::wrap_commonjs_with_addon_paths (cyclomatic 135) crates/perry/src/commands/compile/cjs_wrap/wrap.rs:280— perry::commands::compile::cjs_wrap::wrap::wrap_commonjs_with_addon_paths has cyclomatic complexity 135 (threshold 15). Of this number, 123 points are the body's own statements and 12 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.
perry::commands::compile::collect_modules::feature_detect::detect_optional_feature_usage (cyclomatic 100) crates/perry/src/commands/compile/collect_modules/feature_detect.rs:522— perry::commands::compile::collect_modules::feature_detect::detect_optional_feature_usage has cyclomatic complexity 100 (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.
perry::commands::compile::link::platform_cmd::select_linker_command (cyclomatic 75) crates/perry/src/commands/compile/link/platform_cmd.rs:118— perry::commands::compile::link::platform_cmd::select_linker_command has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::compile::cjs_wrap::extract_exports::extract_object_literal_exports_from_require (cyclomatic 69) crates/perry/src/commands/compile/cjs_wrap/extract_exports.rs:185— perry::commands::compile::cjs_wrap::extract_exports::extract_object_literal_exports_from_require has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::compile::cjs_wrap::hoist_classes::collect_top_level_let_const_var_names (cyclomatic 69) crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs:724— perry::commands::compile::cjs_wrap::hoist_classes::collect_top_level_let_const_var_names has cyclomatic complexity 69 (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.
perry::commands::compile::cjs_wrap::hoist_classes::extract_top_level_class_decls_with_exports (cyclomatic 66) crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs:229— perry::commands::compile::cjs_wrap::hoist_classes::extract_top_level_class_decls_with_exports has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry::commands::check::run (cyclomatic 64) crates/perry/src/commands/check.rs:112— perry::commands::check::run 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.
perry::commands::compile::optimized_libs::features::auto_optimized_cross_features (cyclomatic 62) crates/perry/src/commands/compile/optimized_libs/features.rs:127— perry::commands::compile::optimized_libs::features::auto_optimized_cross_features has cyclomatic complexity 62 (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.
perry::commands::compile::bundle_ios::build_ios_app_bundle (cyclomatic 61) crates/perry/src/commands/compile/bundle_ios.rs:34— perry::commands::compile::bundle_ios::build_ios_app_bundle has cyclomatic complexity 61 (threshold 15). Of this number, 59 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.
perry::commands::compile::cjs_wrap::extract_exports::extract_exports_from_source (cyclomatic 59) crates/perry/src/commands/compile/cjs_wrap/extract_exports.rs:406— perry::commands::compile::cjs_wrap::extract_exports::extract_exports_from_source has cyclomatic complexity 59 (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.
perry::commands::run::remote::remote_build_and_launch (cyclomatic 59) crates/perry/src/commands/run/remote.rs:12— perry::commands::run::remote::remote_build_and_launch 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.
perry::commands::setup::ios::ios_wizard (cyclomatic 53) crates/perry/src/commands/setup/ios.rs:13— perry::commands::setup::ios::ios_wizard 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.
perry::commands::compile::cjs_wrap::hoist_classes::rewrite_module_exports_class_expression (cyclomatic 50) crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs:27— perry::commands::compile::cjs_wrap::hoist_classes::rewrite_module_exports_class_expression has cyclomatic complexity 50 (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.
perry::commands::compile::strip_dedup::strip_duplicate_objects_from_lib_with_evidence (cyclomatic 50) crates/perry/src/commands/compile/strip_dedup.rs:622— perry::commands::compile::strip_dedup::strip_duplicate_objects_from_lib_with_evidence 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.
perry::main_inner (cyclomatic 49) crates/perry/src/main.rs:389— perry::main_inner 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.
perry::commands::compile::cjs_wrap::family_syntax::analyze (cyclomatic 45) crates/perry/src/commands/compile/cjs_wrap/family_syntax.rs:249— perry::commands::compile::cjs_wrap::family_syntax::analyze 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.
perry::commands::compile::lowering_report::aggregate_record (cyclomatic 44) crates/perry/src/commands/compile/lowering_report.rs:270— perry::commands::compile::lowering_report::aggregate_record 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.
perry::commands::compile::cjs_wrap::hoist_classes::collect_pattern_binding_names (cyclomatic 42) crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs:602— perry::commands::compile::cjs_wrap::hoist_classes::collect_pattern_binding_names has cyclomatic complexity 42 (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.
perry::commands::compile::object_cache::compute_object_cache_key_with_env (cyclomatic 42) crates/perry/src/commands/compile/object_cache.rs:311— perry::commands::compile::object_cache::compute_object_cache_key_with_env has cyclomatic complexity 42 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
perry::commands::compile::resolve::resolve_import_with_bunfs (cyclomatic 42) crates/perry/src/commands/compile/resolve.rs:1580— perry::commands::compile::resolve::resolve_import_with_bunfs 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.
perry_stdlib::crypto::cipher::cipher_step (cognitive 197) crates/perry-stdlib/src/crypto/cipher.rs:793— perry_stdlib::crypto::cipher::cipher_step has cognitive complexity 197 (threshold 15). Drivers by points: match/switch 48 (102 pts), if/else 47 (89 pts), boolean chains 6 (nesting depth added 96). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
perry_stdlib::webcrypto::jwk::js_webcrypto_import_key (cognitive 173) crates/perry-stdlib/src/webcrypto/jwk.rs:14— perry_stdlib::webcrypto::jwk::js_webcrypto_import_key has cognitive complexity 173 (threshold 15). Drivers by points: if/else 80 (110 pts), boolean chains 43, match/switch 12 (20 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.
perry_stdlib::webcrypto::keys::js_webcrypto_generate_key (cognitive 153) crates/perry-stdlib/src/webcrypto/keys.rs:18— perry_stdlib::webcrypto::keys::js_webcrypto_generate_key has cognitive complexity 153 (threshold 15). Drivers by points: if/else 55 (90 pts), match/switch 28 (49 pts), boolean chains 14 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_stdlib::webcrypto::hmac::js_webcrypto_verify (cognitive 107) crates/perry-stdlib/src/webcrypto/hmac.rs:212— perry_stdlib::webcrypto::hmac::js_webcrypto_verify has cognitive complexity 107 (threshold 15). Drivers by points: if/else 29 (55 pts), match/switch 20 (42 pts), boolean chains 10 (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.
perry_stdlib::readline::pump::js_readline_process_pending (cognitive 78) crates/perry-stdlib/src/readline/pump.rs:358— perry_stdlib::readline::pump::js_readline_process_pending has cognitive complexity 78 (threshold 15). Drivers by points: if/else 28 (48 pts), loops 9 (22 pts), boolean chains 4, match/switch 2 (4 pts) (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.
perry_stdlib::worker_threads::channel_pump::js_worker_threads_channels_process_pending (cognitive 78) crates/perry-stdlib/src/worker_threads/channel_pump.rs:17— perry_stdlib::worker_threads::channel_pump::js_worker_threads_channels_process_pending has cognitive complexity 78 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 11 (24 pts), boolean chains 12, match/switch 2 (4 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.
perry_stdlib::tls::event_pump::js_tls_process_pending (cognitive 77) crates/perry-stdlib/src/tls/event_pump.rs:33— perry_stdlib::tls::event_pump::js_tls_process_pending has cognitive complexity 77 (threshold 15). Drivers by points: if/else 11 (43 pts), loops 11 (32 pts), match/switch 1 (2 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.
perry_stdlib::webcrypto::hmac::js_webcrypto_sign (cognitive 77) crates/perry-stdlib/src/webcrypto/hmac.rs:9— perry_stdlib::webcrypto::hmac::js_webcrypto_sign has cognitive complexity 77 (threshold 15). Drivers by points: if/else 24 (39 pts), match/switch 15 (30 pts), boolean chains 8 (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.
perry_stdlib::webcrypto::jwk::js_webcrypto_export_key (cognitive 75) crates/perry-stdlib/src/webcrypto/jwk.rs:393— perry_stdlib::webcrypto::jwk::js_webcrypto_export_key has cognitive complexity 75 (threshold 15). Drivers by points: if/else 27 (45 pts), match/switch 7 (18 pts), boolean chains 12 (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.
perry_stdlib::webcrypto::wrap::js_webcrypto_unwrap_key (cognitive 71) crates/perry-stdlib/src/webcrypto/wrap.rs:372— perry_stdlib::webcrypto::wrap::js_webcrypto_unwrap_key has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (35 pts), match/switch 20 (34 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.
perry_stdlib::fetch::request_copy::js_request_new_from_input (cognitive 68) crates/perry-stdlib/src/fetch/request_copy.rs:10— perry_stdlib::fetch::request_copy::js_request_new_from_input has cognitive complexity 68 (threshold 15). Drivers by points: if/else 36 (57 pts), boolean chains 7, match/switch 1 (3 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_stdlib::webcrypto::wrap::js_webcrypto_wrap_key (cognitive 67) crates/perry-stdlib/src/webcrypto/wrap.rs:139— perry_stdlib::webcrypto::wrap::js_webcrypto_wrap_key has cognitive complexity 67 (threshold 15). Drivers by points: if/else 23 (35 pts), match/switch 17 (30 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_stdlib::streams::gc::scan_stream_roots_with (cognitive 61) crates/perry-stdlib/src/streams/gc.rs:137— perry_stdlib::streams::gc::scan_stream_roots_with has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 8 (19 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.
perry_stdlib::webcrypto::aes::js_webcrypto_encrypt (cognitive 59) crates/perry-stdlib/src/webcrypto/aes.rs:721— perry_stdlib::webcrypto::aes::js_webcrypto_encrypt has cognitive complexity 59 (threshold 15). Drivers by points: match/switch 19 (30 pts), if/else 18 (28 pts), boolean chains 1 (nesting depth added 21). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (perry_stdlib::webcrypto::aes::js_webcrypto_decrypt) 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.
perry_stdlib::webcrypto::aes::js_webcrypto_decrypt (cognitive 59) crates/perry-stdlib/src/webcrypto/aes.rs:958— perry_stdlib::webcrypto::aes::js_webcrypto_decrypt has cognitive complexity 59 (threshold 15). Drivers by points: match/switch 19 (30 pts), if/else 18 (28 pts), boolean chains 1 (nesting depth added 21). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (perry_stdlib::webcrypto::aes::js_webcrypto_encrypt) 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.
perry_stdlib::turnloop_client::exchange::feed (cognitive 57) crates/perry-stdlib/src/turnloop_client/exchange.rs:831— perry_stdlib::turnloop_client::exchange::feed has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (38 pts), match/switch 6 (15 pts), boolean chains 3, loops 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.
perry_stdlib::readline::pump::route_pending_stdin_input (cognitive 56) crates/perry-stdlib/src/readline/pump.rs:253— perry_stdlib::readline::pump::route_pending_stdin_input has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 5, loops 2 (3 pts) (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.
perry_stdlib::sqlite::bind::bind_node_sqlite_params (cognitive 54) crates/perry-stdlib/src/sqlite/bind.rs:283— perry_stdlib::sqlite::bind::bind_node_sqlite_params has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (49 pts), loops 3 (5 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_stdlib::fetch::gc::scan_fetch_roots_with (cognitive 41) crates/perry-stdlib/src/fetch/gc.rs:154— perry_stdlib::fetch::gc::scan_fetch_roots_with has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 7 (16 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_stdlib::streams::release_web_streams_in_freed_ranges (cognitive 40) crates/perry-stdlib/src/streams.rs:665— perry_stdlib::streams::release_web_streams_in_freed_ranges has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 9 (11 pts), boolean chains 6 (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.
perry_stdlib::webcrypto::jwk::jwk_import_key_bytes (cognitive 39) crates/perry-stdlib/src/webcrypto/jwk.rs:766— perry_stdlib::webcrypto::jwk::jwk_import_key_bytes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (35 pts), match/switch 1 (3 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.
perry_stdlib::streams::js_reader_read (cognitive 38) crates/perry-stdlib/src/streams.rs:2358— perry_stdlib::streams::js_reader_read has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (35 pts), match/switch 3 (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.
perry_stdlib::cheerio::js_cheerio_selection_children (cognitive 36) crates/perry-stdlib/src/cheerio.rs:251— perry_stdlib::cheerio::js_cheerio_selection_children has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (29 pts), loops 2 (7 pts) (nesting depth added 28). 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.
perry_stdlib::crypto::util::crypto_key_input_to_public_pem (cognitive 35) crates/perry-stdlib/src/crypto/util.rs:775— perry_stdlib::crypto::util::crypto_key_input_to_public_pem has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (35 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.
perry_stdlib::crypto::random::js_crypto_native_dispatch (cognitive 33) crates/perry-stdlib/src/crypto/random.rs:305— perry_stdlib::crypto::random::js_crypto_native_dispatch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 7, match/switch 2 (3 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.
Duplicated block (10 lines × 2) crates/perry-codegen/src/builtin_proto.rs:244— crates/perry-codegen/src/builtin_proto.rs:244-253 | crates/perry-codegen/src/lower_call/scalar_method.rs:991-1003 — 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 lines × 2) crates/perry-codegen/src/codegen/class_declarations.rs:99— crates/perry-codegen/src/codegen/class_declarations.rs:99-108 | crates/perry-codegen/src/codegen/class_declarations.rs:118-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 (10 lines × 2) crates/perry-codegen/src/codegen/function.rs:1289— crates/perry-codegen/src/codegen/function.rs:1289-1298 | crates/perry-codegen/src/codegen/method_static.rs:245-254 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 268 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/codegen/helpers.rs:707— crates/perry-codegen/src/codegen/helpers.rs:707-716 | crates/perry-codegen/src/lower_call/new_helpers.rs:774-783 — 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 lines × 2) crates/perry-codegen/src/codegen/reach_report.rs:270— crates/perry-codegen/src/codegen/reach_report.rs:270-279 | crates/perry-codegen/src/codegen/source_need/flow.rs:418-427 — 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 lines × 2) crates/perry-codegen/src/codegen/reach_report.rs:1212— crates/perry-codegen/src/codegen/reach_report.rs:1212-1221 | crates/perry-codegen/src/codegen/reach_report.rs:1228-1237 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/source_need/flow.rs:920— crates/perry-codegen/src/codegen/source_need/flow.rs:920-929 | crates/perry-codegen/src/codegen/source_need/flow.rs:937-946 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/typed_abi.rs:1592— crates/perry-codegen/src/codegen/typed_abi.rs:1592-1601 | crates/perry-codegen/src/codegen/typed_abi.rs:1620-1629 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_arrays.rs:179— crates/perry-codegen/src/collectors/escape_arrays.rs:179-188 | crates/perry-codegen/src/collectors/escape_arrays.rs:195-204 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_check.rs:832— crates/perry-codegen/src/collectors/escape_check.rs:832-841 | crates/perry-codegen/src/collectors/escape_check.rs:1092-1101 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_news.rs:812— crates/perry-codegen/src/collectors/escape_news.rs:812-821 | crates/perry-codegen/src/collectors/escape_news.rs:868-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 (10 lines × 2) crates/perry-codegen/src/collectors/pointer_locals.rs:220— crates/perry-codegen/src/collectors/pointer_locals.rs:220-229 | crates/perry-hir/src/analysis/value_types.rs:987-996 — before extracting anything, compare `crates/perry-codegen/src/collectors/pointer_locals.rs` and `crates/perry-hir/src/analysis/value_types.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/perry-codegen/src/collectors/repsel_benefit.rs:448— crates/perry-codegen/src/collectors/repsel_benefit.rs:448-457 | crates/perry-hir/src/type_alias_resolve.rs:507-516 — 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 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1358— crates/perry-codegen/src/dialect/mod.rs:1358-1367 | crates/perry-codegen/src/dialect/mod.rs:1497-1506 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/buffer_access.rs:656— crates/perry-codegen/src/expr/buffer_access.rs:656-665 | crates/perry-codegen/src/expr/buffer_access.rs:774-783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/perry-codegen/src/expr/buffer_access.rs:716— crates/perry-codegen/src/expr/buffer_access.rs:716-725 | crates/perry-codegen/src/expr/buffer_access.rs:886-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/perry-codegen/src/expr/call_spread.rs:707— crates/perry-codegen/src/expr/call_spread.rs:707-716 | crates/perry-codegen/src/lower_call/early_branches.rs:50-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.
Duplicated block (10 lines × 2) crates/perry-codegen/src/expr/calls/crypto_keys.rs:17— crates/perry-codegen/src/expr/calls/crypto_keys.rs:17-26 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:105-114 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/calls/crypto_misc.rs:463— crates/perry-codegen/src/expr/calls/crypto_misc.rs:463-472 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:510-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 (10 lines × 2) crates/perry-codegen/src/expr/child_proc.rs:405— crates/perry-codegen/src/expr/child_proc.rs:405-417 | crates/perry-codegen/src/expr/child_proc.rs:479-488 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/i32_fast_path.rs:1782— crates/perry-codegen/src/expr/i32_fast_path.rs:1782-1791 | crates/perry-codegen/src/expr/i32_fast_path.rs:1810-1819 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_get/guarded_array.rs:576— crates/perry-codegen/src/expr/index_get/guarded_array.rs:576-585 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:654-663 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_set.rs:205— crates/perry-codegen/src/expr/index_set.rs:205-214 | crates/perry-codegen/src/expr/proven_view_access.rs:56-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 both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/perry-codegen/src/expr/js_runtime.rs:49— crates/perry-codegen/src/expr/js_runtime.rs:49-58 | crates/perry-codegen/src/expr/js_runtime.rs:148-157 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/layout_read.rs:151— crates/perry-codegen/src/expr/layout_read.rs:151-160 | crates/perry-codegen/src/expr/layout_read.rs:245-254 — both copies are in the same file, so extract the block into 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/perry-codegen-glance/src/emit.rs:652— crates/perry-codegen-glance/src/emit.rs:652-660 | crates/perry-codegen-wear-tiles/src/emit.rs:437-445 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/perry-codegen/src/codegen/class_artifacts.rs:345— crates/perry-codegen/src/codegen/class_artifacts.rs:345-353 | crates/perry-codegen/src/codegen/class_artifacts.rs:479-487 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/class_artifacts.rs:408— crates/perry-codegen/src/codegen/class_artifacts.rs:408-416 | crates/perry-codegen/src/codegen/class_artifacts.rs:522-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.
Duplicated block (9 lines × 2) crates/perry-codegen/src/codegen/closure.rs:1578— crates/perry-codegen/src/codegen/closure.rs:1578-1586 | crates/perry-codegen/src/codegen/function.rs:1803-1811 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/codegen/method.rs:1200— crates/perry-codegen/src/codegen/method.rs:1200-1208 | crates/perry-codegen/src/codegen/method.rs:1287-1295 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/method.rs:1420— crates/perry-codegen/src/codegen/method.rs:1420-1428 | crates/perry-codegen/src/codegen/method.rs:1512-1520 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/mod.rs:1952— crates/perry-codegen/src/codegen/mod.rs:1952-1960 | crates/perry-codegen/src/codegen/mod.rs:1965-1974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/perry-codegen/src/codegen/spec_return_proof.rs:226— crates/perry-codegen/src/codegen/spec_return_proof.rs:226-234 | crates/perry-codegen/src/lower_call/func_ref.rs:671-679 — before extracting anything, compare `crates/perry-codegen/src/codegen/spec_return_proof.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/perry-codegen/src/collectors/escape_objects.rs:579— crates/perry-codegen/src/collectors/escape_objects.rs:579-587 | crates/perry-codegen/src/collectors/escape_objects.rs:595-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.
Duplicated block (9 lines × 2) crates/perry-codegen/src/collectors/hir_facts.rs:1770— crates/perry-codegen/src/collectors/hir_facts.rs:1770-1778 | crates/perry-codegen/src/collectors/hir_facts.rs:1796-1804 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/hot_callees.rs:158— crates/perry-codegen/src/collectors/hot_callees.rs:158-166 | crates/perry-codegen/src/collectors/hot_callees.rs:247-255 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/integer_locals.rs:764— crates/perry-codegen/src/collectors/integer_locals.rs:764-772 | crates/perry-codegen/src/collectors/integer_locals.rs:1105-1113 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/mutation.rs:424— crates/perry-codegen/src/collectors/mutation.rs:424-432 | crates/perry-codegen/src/stmt/region_loop/plan.rs:549-557 — 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/perry-codegen/src/collectors/receiver_regions.rs:1268— crates/perry-codegen/src/collectors/receiver_regions.rs:1268-1276 | crates/perry-hir/src/lower_decl/class_captures.rs:1443-1451 — 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/perry-codegen/src/collectors/this_as_value.rs:36— crates/perry-codegen/src/collectors/this_as_value.rs:36-44 | crates/perry-codegen/src/collectors/this_as_value.rs:72-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/perry-codegen/src/expr/array_push.rs:383— crates/perry-codegen/src/expr/array_push.rs:383-391 | crates/perry-codegen/src/lower_array_method.rs:78-86 — 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/perry-codegen/src/expr/bigint_set.rs:108— crates/perry-codegen/src/expr/bigint_set.rs:108-116 | crates/perry-codegen/src/expr/math_simple.rs:231-239 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/calls.rs:254— crates/perry-codegen/src/expr/calls.rs:254-262 | crates/perry-codegen/src/expr/calls.rs:778-786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/perry-codegen/src/expr/calls.rs:674— crates/perry-codegen/src/expr/calls.rs:674-682 | crates/perry-codegen/src/expr/calls.rs:762-770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/perry-codegen/src/expr/compare.rs:485— crates/perry-codegen/src/expr/compare.rs:485-493 | crates/perry-codegen/src/expr/compare.rs:534-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.
Duplicated block (9 lines × 2) crates/perry-codegen/src/expr/dyn_extern_i18n.rs:978— crates/perry-codegen/src/expr/dyn_extern_i18n.rs:978-986 | crates/perry-codegen/src/expr/instance_misc1.rs:423-431 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/perry-codegen/src/expr/i32_fast_path.rs:1366— crates/perry-codegen/src/expr/i32_fast_path.rs:1366-1374 | crates/perry-codegen/src/expr/i32_fast_path.rs:1604-1612 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/instance_misc1.rs:1655— crates/perry-codegen/src/expr/instance_misc1.rs:1655-1663 | crates/perry-codegen/src/expr/instance_misc1.rs:1669-1677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/perry-codegen/src/expr/literals_vars.rs:907— crates/perry-codegen/src/expr/literals_vars.rs:907-915 | crates/perry-codegen/src/expr/literals_vars.rs:1006-1014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/perry-codegen/src/expr/logical_collections.rs:1261— crates/perry-codegen/src/expr/logical_collections.rs:1261-1270 | crates/perry-codegen/src/expr/logical_collections.rs:1280-1288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
perry_transform::generator::lower::transform_generator_function_with_extra_captures (cyclomatic 73) crates/perry-transform/src/generator/lower.rs:301— perry_transform::generator::lower::transform_generator_function_with_extra_captures has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_transform::generator::linearize::linearize_body (cyclomatic 70) crates/perry-transform/src/generator/linearize.rs:607— perry_transform::generator::linearize::linearize_body 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.
perry_transform::inline::call_inliner::inline_calls_in_stmts (cyclomatic 52) crates/perry-transform/src/inline/call_inliner.rs:344— perry_transform::inline::call_inliner::inline_calls_in_stmts 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.
perry_transform::inline::inline_functions_inner (cyclomatic 48) crates/perry-transform/src/inline/mod.rs:280— perry_transform::inline::inline_functions_inner 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. This shape REPEATS in the file: one other method here (perry_transform::inline::inline_functions_inner::walk_stmt_exprs) 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.
perry_transform::inline::call_inliner::inline_calls_in_expr (cyclomatic 48) crates/perry-transform/src/inline/call_inliner.rs:884— perry_transform::inline::call_inliner::inline_calls_in_expr has cyclomatic complexity 48 (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.
perry_transform::inline::call_inliner::try_inline_simple_call (cyclomatic 38) crates/perry-transform/src/inline/call_inliner.rs:1596— perry_transform::inline::call_inliner::try_inline_simple_call 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.
perry_transform::aggregate_scalar::return_record_stmts_are_safe (cyclomatic 36) crates/perry-transform/src/aggregate_scalar.rs:757— perry_transform::aggregate_scalar::return_record_stmts_are_safe has cyclomatic complexity 36 (threshold 15). Of this number, 29 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_transform::inline::cross_module::localize_cross_module_functions (cyclomatic 35) crates/perry-transform/src/inline/cross_module.rs:571— perry_transform::inline::cross_module::localize_cross_module_functions 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.
perry_transform::unroll::refresh_in_stmt (cyclomatic 34) crates/perry-transform/src/unroll/mod.rs:820— perry_transform::unroll::refresh_in_stmt has cyclomatic complexity 34 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
perry_transform::deforest::detect::detect_producers (cyclomatic 32) crates/perry-transform/src/deforest/detect.rs:18— perry_transform::deforest::detect::detect_producers 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.
perry_transform::inline::closure_analysis::find_max_local_id::check_stmt (cyclomatic 32) crates/perry-transform/src/inline/closure_analysis.rs:716— perry_transform::inline::closure_analysis::find_max_local_id::check_stmt has cyclomatic complexity 32 (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.
perry_transform::async_to_generator::hoist_awaits_in_stmt (cyclomatic 31) crates/perry-transform/src/async_to_generator.rs:502— perry_transform::async_to_generator::hoist_awaits_in_stmt 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.
perry_transform::finally_inline::process_stmts (cyclomatic 31) crates/perry-transform/src/finally_inline.rs:235— perry_transform::finally_inline::process_stmts 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.
perry_transform::inline::call_inliner::try_inline_call (cyclomatic 31) crates/perry-transform/src/inline/call_inliner.rs:2051— perry_transform::inline::call_inliner::try_inline_call 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.
perry_transform::generator::break_continue::body_contains_yield (cyclomatic 29) crates/perry-transform/src/generator/break_continue.rs:276— perry_transform::generator::break_continue::body_contains_yield 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.
perry_transform::generator::private_frame::lower_list (cyclomatic 29) crates/perry-transform/src/generator/private_frame.rs:343— perry_transform::generator::private_frame::lower_list has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (perry_transform::generator::private_frame::lower_list::ids) 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.
perry_transform::local_copies::clean_function (cyclomatic 29) crates/perry-transform/src/local_copies.rs:100— perry_transform::local_copies::clean_function 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.
perry_transform::unroll::substitute_localget_with_int_in_stmt (cyclomatic 29) crates/perry-transform/src/unroll/mod.rs:648— perry_transform::unroll::substitute_localget_with_int_in_stmt 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.
perry_transform::aggregate_scalar::rewrite_return_record_stmts (cyclomatic 28) crates/perry-transform/src/aggregate_scalar.rs:971— perry_transform::aggregate_scalar::rewrite_return_record_stmts 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.
perry_transform::inline::inline_functions_inner::walk_stmt_exprs (cyclomatic 28) crates/perry-transform/src/inline/mod.rs:315— perry_transform::inline::inline_functions_inner::walk_stmt_exprs has cyclomatic complexity 28 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (perry_transform::inline::inline_functions_inner) 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.
perry_transform::deforest::scan::scan_stmt_call_sites (cyclomatic 27) crates/perry-transform/src/deforest/scan.rs:27— perry_transform::deforest::scan::scan_stmt_call_sites 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.
perry_transform::generator::iter_result_rewrite::rewrite_stmt (cyclomatic 26) crates/perry-transform/src/generator/iter_result_rewrite.rs:66— perry_transform::generator::iter_result_rewrite::rewrite_stmt has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_transform::inline::closure_analysis::collect_closure_captured_local_ids::visit_stmt (cyclomatic 26) crates/perry-transform/src/inline/closure_analysis.rs:295— perry_transform::inline::closure_analysis::collect_closure_captured_local_ids::visit_stmt has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_transform::inline::closure_analysis::collect_mutated_local_ids::visit_stmt (cyclomatic 26) crates/perry-transform/src/inline/closure_analysis.rs:406— perry_transform::inline::closure_analysis::collect_mutated_local_ids::visit_stmt has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_transform::inline::exact_receivers::collect_exact_receiver_refs_in_stmt (cyclomatic 26) crates/perry-transform/src/inline/exact_receivers.rs:447— perry_transform::inline::exact_receivers::collect_exact_receiver_refs_in_stmt has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Duplicated block (11 lines × 2) crates/perry-codegen-glance/src/emit.rs:479— crates/perry-codegen-glance/src/emit.rs:479-489 | crates/perry-codegen-swiftui/src/emit.rs:919-929 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-swiftui/src/emit.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen-wasm/src/emit/stmt.rs:95— crates/perry-codegen-wasm/src/emit/stmt.rs:95-105 | crates/perry-codegen-wasm/src/emit/stmt.rs:143-153 — both copies are in the same file, so extract the block into 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/perry-codegen-wasm/src/emit/stmt.rs:123— crates/perry-codegen-wasm/src/emit/stmt.rs:123-133 | crates/perry-codegen-wasm/src/emit/stmt.rs:169-179 — both copies are in the same file, so extract the block into 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/perry-codegen/src/array_record_stack.rs:34— crates/perry-codegen/src/array_record_stack.rs:34-44 | crates/perry-codegen/src/lower_conditional_array_record.rs:147-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/perry-codegen/src/codegen/method.rs:578— crates/perry-codegen/src/codegen/method.rs:578-588 | crates/perry-codegen/src/codegen/method_static.rs:250-260 — before extracting anything, compare `crates/perry-codegen/src/codegen/method.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/codegen/method_entries.rs:86— crates/perry-codegen/src/codegen/method_entries.rs:86-96 | crates/perry-codegen/src/codegen/method_entries.rs:190-200 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/param_guard.rs:452— crates/perry-codegen/src/codegen/param_guard.rs:452-462 | crates/perry-codegen/src/collectors/hot_callees.rs:806-816 — 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/perry-codegen/src/collectors/escape_objects.rs:180— crates/perry-codegen/src/collectors/escape_objects.rs:180-190 | crates/perry-codegen/src/collectors/escape_objects.rs:192-202 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_objects.rs:434— crates/perry-codegen/src/collectors/escape_objects.rs:434-444 | crates/perry-codegen/src/collectors/escape_objects.rs:459-469 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/hot_callees.rs:365— crates/perry-codegen/src/collectors/hot_callees.rs:365-375 | crates/perry-codegen/src/collectors/loop_bounded_i32.rs:856-866 — before extracting anything, compare `crates/perry-codegen/src/collectors/hot_callees.rs` and `crates/perry-codegen/src/collectors/loop_bounded_i32.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/collectors/int_valued_ta_locals.rs:786— crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:786-796 | crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:868-878 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/proven_args.rs:233— crates/perry-codegen/src/collectors/proven_args.rs:233-243 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:831-841 — before extracting anything, compare `crates/perry-codegen/src/collectors/proven_args.rs` and `crates/perry-codegen/src/collectors/ptr_shape_elements.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. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/bigint_set.rs:422— crates/perry-codegen/src/expr/bigint_set.rs:422-432 | crates/perry-codegen/src/expr/math_simple.rs:159-169 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/binary.rs:1346— crates/perry-codegen/src/expr/binary.rs:1346-1356 | crates/perry-codegen/src/expr/binary.rs:1358-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 (11 lines × 2) crates/perry-codegen/src/expr/buffer_access.rs:455— crates/perry-codegen/src/expr/buffer_access.rs:455-465 | crates/perry-codegen/src/lower_call/buffer_intrinsic.rs:573-583 — 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/perry-codegen/src/expr/call_spread.rs:274— crates/perry-codegen/src/expr/call_spread.rs:274-284 | crates/perry-codegen/src/expr/call_spread.rs:309-319 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/dyn_extern_i18n.rs:1093— crates/perry-codegen/src/expr/dyn_extern_i18n.rs:1093-1103 | crates/perry-codegen/src/expr/static_field_meta.rs:884-894 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/perry-codegen/src/expr/i32_fast_path.rs:753— crates/perry-codegen/src/expr/i32_fast_path.rs:753-763 | crates/perry-codegen/src/expr/i32_fast_path.rs:770-780 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_get.rs:139— crates/perry-codegen/src/expr/index_get.rs:139-149 | crates/perry-codegen/src/expr/index_set.rs:191-201 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get.rs` and `crates/perry-codegen/src/expr/index_set.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/index_get.rs:1395— crates/perry-codegen/src/expr/index_get.rs:1395-1405 | crates/perry-codegen/src/expr/index_get.rs:1419-1429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:362— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:362-372 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1068-1078 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs` and `crates/perry-codegen/src/stmt/stable_packed_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen/src/expr/instance_misc1.rs:1355— crates/perry-codegen/src/expr/instance_misc1.rs:1355-1365 | crates/perry-codegen/src/expr/logical_collections.rs:1088-1098 — before extracting anything, compare `crates/perry-codegen/src/expr/instance_misc1.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/misc_methods.rs:459— crates/perry-codegen/src/expr/misc_methods.rs:459-469 | crates/perry-codegen/src/expr/misc_methods.rs:596-606 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/mod.rs:3119— crates/perry-codegen/src/expr/mod.rs:3119-3129 | crates/perry-codegen/src/expr/mod.rs:3162-3172 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/this_super_call.rs:119— crates/perry-codegen/src/expr/this_super_call.rs:119-129 | crates/perry-codegen/src/expr/this_super_call.rs:178-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
MethodTooLong: Gen.expr_rest crates/perry-wpfacts/src/gen_rest.rs:136— MethodTooLong — expr_rest runs 1574 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 1474 over it, 15.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: JsEmitter.emit_expr_continued crates/perry-codegen-js/src/emit/exprs_more.rs:19— MethodTooLong — emit_expr_continued runs 1314 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 1214 over it, 13.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WasmModuleEmitter.compile crates/perry-codegen-wasm/src/emit/compile.rs:9— MethodTooLong — compile runs 1179 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 1079 over it, 11.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: JsEmitter.emit_expr crates/perry-codegen-js/src/emit/exprs.rs:65— MethodTooLong — emit_expr runs 898 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 798 over it, 8.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: Gen.expr_inner crates/perry-wpfacts/src/gen_expr.rs:425— MethodTooLong — expr_inner runs 889 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 789 over it, 8.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_native_method crates/perry-codegen-wasm/src/emit/expr/native_method.rs:9— MethodTooLong — try_emit_expr_native_method runs 744 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 644 over it, 7.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Model.apply_inner crates/perry-wpfacts/src/solve/apply.rs:4— MethodTooLong — apply_inner runs 738 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 638 over it, 7.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Expr.hash crates/perry-hir/src/stable_hash/expr.rs:31— MethodTooLong — hash runs 656 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 556 over it, 6.56× 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: WasmModuleEmitter.collect_strings_in_expr crates/perry-codegen-wasm/src/emit/string_collection.rs:453— MethodTooLong — collect_strings_in_expr runs 467 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 367 over it, 4.67× 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: FuncEmitCtx.try_emit_expr_classes crates/perry-codegen-wasm/src/emit/expr/classes.rs:9— MethodTooLong — try_emit_expr_classes runs 448 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 348 over it, 4.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_arrays crates/perry-codegen-wasm/src/emit/expr/arrays.rs:9— MethodTooLong — try_emit_expr_arrays runs 409 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 309 over it, 4.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_objects crates/perry-codegen-wasm/src/emit/expr/objects.rs:9— MethodTooLong — try_emit_expr_objects runs 348 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 248 over it, 3.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_literals_vars crates/perry-codegen-wasm/src/emit/expr/literals_vars.rs:9— MethodTooLong — try_emit_expr_literals_vars runs 338 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 238 over it, 3.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Gen.stand_in_fn_of crates/perry-wpfacts/src/gen/import_values.rs:596— MethodTooLong — stand_in_fn_of runs 308 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 208 over it, 3.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_buffers crates/perry-codegen-wasm/src/emit/expr/buffers.rs:9— MethodTooLong — try_emit_expr_buffers runs 306 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 206 over it, 3.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_net_fetch_crypto crates/perry-codegen-wasm/src/emit/expr/net_fetch_crypto.rs:9— MethodTooLong — try_emit_expr_net_fetch_crypto runs 302 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 202 over it, 3.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ComposeEngine.up crates/perry-container-compose/src/compose.rs:228— MethodTooLong — up runs 299 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 199 over it, 2.99× 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: FuncEmitCtx.emit_method_call crates/perry-codegen-wasm/src/emit/method_call.rs:12— MethodTooLong — emit_method_call runs 272 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 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Gen.stand_in_class crates/perry-wpfacts/src/gen/class_values.rs:636— MethodTooLong — stand_in_class runs 264 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 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_url_process_path crates/perry-codegen-wasm/src/emit/expr/url_process_path.rs:9— MethodTooLong — try_emit_expr_url_process_path runs 260 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 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.try_emit_expr_date_error crates/perry-codegen-wasm/src/emit/expr/date_error.rs:9— MethodTooLong — try_emit_expr_date_error runs 256 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 156 over it, 2.56× 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: Host.new_prepared crates/perry-component-host/src/lib.rs:191— MethodTooLong — new_prepared runs 252 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 152 over it, 2.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FuncEmitCtx.emit_stmt crates/perry-codegen-wasm/src/emit/stmt.rs:10— MethodTooLong — emit_stmt runs 246 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 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: ArrayFactCollector.collect_expr crates/perry-codegen/src/collectors/hir_facts.rs:1534— MethodTooLong — collect_expr 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: Gen.runtime_extern crates/perry-wpfacts/src/gen_call.rs:466— MethodTooLong — runtime_extern runs 214 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
TodoComment test-files/test_zlib_brotli_decompress.ts:5— // is a TODO follow-up); we just confirm the shim returns a truthy — 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 test-files/fixtures/issue_uuid_cross_module/producer.ts:4— // dropped the function body entirely (the `// TODO: properly lower function — 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 scripts/gc_runtime_root_holders.py:1083— # enumerated, verdict not established — a dated 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/perry-wasi/src/p2/host/filesystem.rs:265— // TODO delete the path flags from this function — 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/perry-wasi/src/p2/host/filesystem/sync.rs:155— // TODO delete the path flags from this function — 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/perry-wasi/src/io/impls.rs:174— // TODO: We could optimize this to not allocate one big zeroed buffer, and instead write — 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/perry-wasi/src/filesystem/primitives/set_times.rs:5— //! TODO: `check_set_times` etc. — 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/perry-wasi/src/filesystem/primitives/windows/fs/create_file_at_w.rs:231— // TODO: How should we handle FILE_FLAG_SESSION_AWARE? — 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/perry-wasi/src/filesystem/primitives/windows/fs/open_impl.rs:33— // TODO: Replace this with `Path::file_prefix` once that's stable. For now, — 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/perry-wasi/src/filesystem/primitives/tests/cap_basics.rs:202— // TODO: Check the error message — 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/perry-wasi/src/filesystem/primitives/tests/fs_additional.rs:14— // TODO investigate why this one is failing — 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/perry-wasi/src/filesystem/primitives/tests/fs_additional.rs:227— // TODO investigate why this one is failing — 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/perry-wasi/src/filesystem/primitives/tests/fs_additional.rs:352— // TODO investigate why this one is failing — 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/perry-wasi/src/filesystem/primitives/tests/fs_additional.rs:394— // TODO investigate why this one is failing — 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/perry-wasi/src/filesystem/primitives/tests/fs_additional.rs:382— // TODO: Platform-specific error code. — 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/perry-wasi/src/filesystem/primitives/tests/fs_additional.rs:416— // TODO: Platform-specific error code. — 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/perry-wasi/src/filesystem/primitives/tests/rename.rs:29— // TODO: Platform-specific error code. — 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/perry-wasi/src/filesystem/primitives/tests/rename.rs:129— // TODO: Platform-specific error code. — 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/perry-wasi/src/filesystem/primitives/tests/rename.rs:150— // TODO: Platform-specific error code. — 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/perry-wasi/src/filesystem/primitives/tests/rename.rs:211— // TODO: Platform-specific error code. — 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/perry-wasi/src/filesystem/primitives/tests/paths_containing_nul.rs:26— // TODO: Re-enable this assertion once the `io_error_more` — 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/perry-wasi/src/filesystem/primitives/tests/rename.rs:70— // TODO: Blocked on error message discrepancies — 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/perry-wasi/src/filesystem/primitives/tests/sys_common/symlink_junction.rs:102— // TODO: use `byte_offfset_from` when pointer_byte_offsets is stable — 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/perry-wasi/src/filesystem/primitives/tests/sys_common/symlink_junction.rs:119— // TODO: use io::ErrorKind::InvalidFilename when io_error_more is stabilized — 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/perry-wasi/src/filesystem/primitives/manually/open.rs:393— // POSIX returns `ENOENT` on an empty path. TODO: On Windows, we should — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (12 lines × 2) crates/perry-codegen-glance/src/emit.rs:598— crates/perry-codegen-glance/src/emit.rs:598-609 | crates/perry-codegen-wear-tiles/src/emit.rs:418-429 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/perry-codegen-glance/src/lib.rs:71— crates/perry-codegen-glance/src/lib.rs:71-82 | crates/perry-codegen-swiftui/src/lib.rs:147-158 — 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/perry-codegen-js/src/minify.rs:236— crates/perry-codegen-js/src/minify.rs:236-247 | crates/perry-codegen-wasm/src/minify.rs:232-243 — before extracting anything, compare `crates/perry-codegen-js/src/minify.rs` and `crates/perry-codegen-wasm/src/minify.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/perry-codegen/src/codegen/arguments.rs:294— crates/perry-codegen/src/codegen/arguments.rs:294-305 | crates/perry-codegen/src/codegen/arguments.rs:323-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/perry-codegen/src/codegen/string_pool.rs:295— crates/perry-codegen/src/codegen/string_pool.rs:295-306 | crates/perry-codegen/src/codegen/string_pool.rs:309-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/perry-codegen/src/collectors/clamp_detect.rs:21— crates/perry-codegen/src/collectors/clamp_detect.rs:21-32 | crates/perry-codegen/src/collectors/clamp_detect.rs:97-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/perry-codegen/src/collectors/clamp_detect.rs:48— crates/perry-codegen/src/collectors/clamp_detect.rs:48-59 | crates/perry-codegen/src/collectors/clamp_detect.rs:123-134 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_check.rs:874— crates/perry-codegen/src/collectors/escape_check.rs:874-885 | crates/perry-codegen/src/collectors/escape_check.rs:993-1004 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_check.rs:940— crates/perry-codegen/src/collectors/escape_check.rs:940-951 | crates/perry-codegen/src/collectors/escape_check.rs:1024-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.
Duplicated block (12 lines × 2) crates/perry-codegen/src/collectors/escape_news.rs:663— crates/perry-codegen/src/collectors/escape_news.rs:663-674 | crates/perry-codegen/src/collectors/escape_news.rs:747-758 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/i32_locals.rs:1536— crates/perry-codegen/src/collectors/i32_locals.rs:1536-1547 | crates/perry-codegen/src/collectors/refs.rs:542-553 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/collectors/param_ranges.rs:195— crates/perry-codegen/src/collectors/param_ranges.rs:195-206 | crates/perry-codegen/src/layout_families.rs:374-385 — before extracting anything, compare `crates/perry-codegen/src/collectors/param_ranges.rs` and `crates/perry-codegen/src/layout_families.rs` as WHOLE FILES: this scan already matched 3 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 (12 lines × 2) crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:352— crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:352-363 | crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:389-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/perry-codegen/src/collectors/sealed_buffers.rs:600— crates/perry-codegen/src/collectors/sealed_buffers.rs:600-611 | crates/perry-codegen/src/collectors/sealed_buffers.rs:659-670 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/i32_fast_path.rs:1082— crates/perry-codegen/src/expr/i32_fast_path.rs:1082-1093 | crates/perry-codegen/src/expr/i32_fast_path.rs:1494-1505 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_get.rs:1274— crates/perry-codegen/src/expr/index_get.rs:1274-1285 | crates/perry-codegen/src/expr/index_set.rs:844-856 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get.rs` and `crates/perry-codegen/src/expr/index_set.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/index_get/guarded_array.rs:868— crates/perry-codegen/src/expr/index_get/guarded_array.rs:868-879 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:945-956 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/instance_misc1.rs:989— crates/perry-codegen/src/expr/instance_misc1.rs:989-1000 | crates/perry-codegen/src/expr/misc_methods.rs:1195-1206 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/perry-codegen/src/expr/layout_read.rs:170— crates/perry-codegen/src/expr/layout_read.rs:170-181 | crates/perry-codegen/src/expr/layout_read.rs:307-318 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/layout_read.rs:199— crates/perry-codegen/src/expr/layout_read.rs:199-210 | crates/perry-codegen/src/expr/layout_read.rs:868-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.
Duplicated block (12 lines × 2) crates/perry-codegen/src/expr/layout_read.rs:318— crates/perry-codegen/src/expr/layout_read.rs:318-329 | crates/perry-codegen/src/expr/layout_read.rs:835-846 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/pod_record.rs:264— crates/perry-codegen/src/expr/pod_record.rs:264-275 | crates/perry-codegen/src/expr/pod_record.rs:337-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.
Duplicated block (12 lines × 2) crates/perry-codegen/src/expr/property_get/helpers.rs:202— crates/perry-codegen/src/expr/property_get/helpers.rs:202-213 | crates/perry-codegen/src/expr/property_set.rs:598-609 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) crates/perry-codegen/src/expr/proven_view_access.rs:373— crates/perry-codegen/src/expr/proven_view_access.rs:373-384 | crates/perry-codegen/src/expr/proven_view_access.rs:494-505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/perry-codegen/src/expr/proxy_reflect.rs:421— crates/perry-codegen/src/expr/proxy_reflect.rs:421-432 | crates/perry-codegen/src/expr/proxy_reflect.rs:440-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
perry_ext_http::server::handle_dispatch::js_ext_http_server_dispatch_method (cognitive 194) crates/perry-ext-http/src/server/handle_dispatch.rs:258— perry_ext_http::server::handle_dispatch::js_ext_http_server_dispatch_method has cognitive complexity 194 (threshold 15). Drivers by points: if/else 91 (179 pts), boolean chains 12, loops 1 (2 pts), match/switch 1 (nesting depth added 89). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::client_turnloop::native_client::run (cognitive 75) crates/perry-ext-http/src/client_turnloop/native_client.rs:221— perry_ext_http::client_turnloop::native_client::run has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (65 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::server::http2_server::pump::process_pending_h2_events (cognitive 72) crates/perry-ext-http/src/server/http2_server/pump.rs:169— perry_ext_http::server::http2_server::pump::process_pending_h2_events has cognitive complexity 72 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 10 (30 pts), match/switch 3 (7 pts), boolean chains 1 (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.
perry_ext_http::client_request_surface::dispatch_method (cognitive 51) crates/perry-ext-http/src/client_request_surface.rs:616— perry_ext_http::client_request_surface::dispatch_method has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 8, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::agent::agent_new_with_protocol (cognitive 47) crates/perry-ext-http/src/agent.rs:1017— perry_ext_http::agent::agent_new_with_protocol has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 6 (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.
perry_ext_http::server::turnloop_h2::stream::pump_outbox (cognitive 40) crates/perry-ext-http/src/server/turnloop_h2/stream.rs:719— perry_ext_http::server::turnloop_h2::stream::pump_outbox has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::server::response_end::standalone_end (cognitive 33) crates/perry-ext-http/src/server/response_end.rs:136— perry_ext_http::server::response_end::standalone_end has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (26 pts), match/switch 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.
perry_ext_http::server::response_header_values::set (cognitive 29) crates/perry-ext-http/src/server/response_header_values.rs:177— perry_ext_http::server::response_header_values::set has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (28 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.
perry_ext_http::server::turnloop_serve::conn::decode_step (cognitive 29) crates/perry-ext-http/src/server/turnloop_serve/conn.rs:492— perry_ext_http::server::turnloop_serve::conn::decode_step has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (7 pts), boolean chains 5, 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.
perry_ext_http::validation::validate_client_options (cognitive 28) crates/perry-ext-http/src/validation.rs:48— perry_ext_http::validation::validate_client_options has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::server::http2_server::dispatch::js_ext_http2_session_dispatch_method (cognitive 27) crates/perry-ext-http/src/server/http2_server/dispatch.rs:34— perry_ext_http::server::http2_server::dispatch::js_ext_http2_session_dispatch_method has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1, 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.
perry_ext_http::server::turnloop_h2::conn::pump (cognitive 27) crates/perry-ext-http/src/server/turnloop_h2/conn.rs:893— perry_ext_http::server::turnloop_h2::conn::pump has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 3 (4 pts), boolean chains 3, 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.
perry_ext_http::client_events::handle_response_event (cognitive 25) crates/perry-ext-http/src/client_events.rs:253— perry_ext_http::client_events::handle_response_event has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 6 (10 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.
perry_ext_http::agent::release_request (cognitive 24) crates/perry-ext-http/src/agent.rs:695— perry_ext_http::agent::release_request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (21 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, 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.
perry_ext_http::client_events::handle_response_end_event (cognitive 24) crates/perry-ext-http/src/client_events.rs:632— perry_ext_http::client_events::handle_response_end_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (8 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.
perry_ext_http::client_overload::parse_client_args (cognitive 24) crates/perry-ext-http/src/client_overload.rs:52— perry_ext_http::client_overload::parse_client_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 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.
perry_ext_http::response_headers::build_response_headers_object (cognitive 24) crates/perry-ext-http/src/response_headers.rs:117— perry_ext_http::response_headers::build_response_headers_object has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::server::types::jsvalue_to_body_bytes (cognitive 24) crates/perry-ext-http/src/server/types.rs:296— perry_ext_http::server::types::jsvalue_to_body_bytes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (23 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.
perry_ext_http::client_turnloop::prepare (cognitive 23) crates/perry-ext-http/src/client_turnloop/mod.rs:214— perry_ext_http::client_turnloop::prepare has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::root_scanner::scan_http_roots (cognitive 23) crates/perry-ext-http/src/root_scanner.rs:7— perry_ext_http::root_scanner::scan_http_roots has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 7 (10 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.
perry_ext_http::server::bun_server::process_pending_promises (cognitive 23) crates/perry-ext-http/src/server/bun_server.rs:601— perry_ext_http::server::bun_server::process_pending_promises has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::server::server::process_pending (cognitive 23) crates/perry-ext-http/src/server/server.rs:1231— perry_ext_http::server::server::process_pending has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::server::turnloop_h2::conn::flush (cognitive 23) crates/perry-ext-http/src/server/turnloop_h2/conn.rs:1055— perry_ext_http::server::turnloop_h2::conn::flush has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_http::dispatch_request_snapshot (cognitive 22) crates/perry-ext-http/src/lib.rs:1486— perry_ext_http::dispatch_request_snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (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.
perry_ext_http::server::handle_dispatch::js_ext_http_server_response_dispatch_method (cognitive 22) crates/perry-ext-http/src/server/handle_dispatch.rs:875— perry_ext_http::server::handle_dispatch::js_ext_http_server_response_dispatch_method has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (13 lines × 2) crates/perry-codegen-wasm/src/emit/stmt.rs:150— crates/perry-codegen-wasm/src/emit/stmt.rs:150-162 | crates/perry-codegen-wasm/src/emit/stmt.rs:235-247 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/function.rs:233— crates/perry-codegen/src/codegen/function.rs:233-245 | crates/perry-codegen/src/codegen/method_trampolines.rs:32-44 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_trampolines.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/codegen/function.rs:247— crates/perry-codegen/src/codegen/function.rs:247-259 | crates/perry-codegen/src/codegen/method_trampolines.rs:46-58 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_trampolines.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/collectors/i32_locals.rs:1277— crates/perry-codegen/src/collectors/i32_locals.rs:1277-1289 | crates/perry-codegen/src/collectors/refs.rs:240-252 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/array_push.rs:302— crates/perry-codegen/src/expr/array_push.rs:302-314 | crates/perry-codegen/src/expr/write_barrier.rs:850-862 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/perry-codegen/src/expr/binary.rs:1673— crates/perry-codegen/src/expr/binary.rs:1673-1685 | crates/perry-codegen/src/expr/binary.rs:1705-1717 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/byte_cell.rs:42— crates/perry-codegen/src/expr/byte_cell.rs:42-54 | crates/perry-codegen/src/expr/byte_cell.rs:515-527 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/calls/fs.rs:89— crates/perry-codegen/src/expr/calls/fs.rs:89-101 | crates/perry-codegen/src/expr/calls/fs.rs:160-172 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/class_field_push.rs:44— crates/perry-codegen/src/expr/class_field_push.rs:44-56 | crates/perry-codegen/src/stmt/loops.rs:3310-3322 — before extracting anything, compare `crates/perry-codegen/src/expr/class_field_push.rs` and `crates/perry-codegen/src/stmt/loops.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/expr/i32_fast_path.rs:672— crates/perry-codegen/src/expr/i32_fast_path.rs:672-684 | crates/perry-codegen/src/expr/ta_param_f64_read.rs:254-266 — before extracting anything, compare `crates/perry-codegen/src/expr/i32_fast_path.rs` and `crates/perry-codegen/src/expr/ta_param_f64_read.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/perry-codegen/src/expr/i32_fast_path.rs:1161— crates/perry-codegen/src/expr/i32_fast_path.rs:1161-1173 | crates/perry-codegen/src/expr/i32_fast_path.rs:1224-1236 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_get.rs:367— crates/perry-codegen/src/expr/index_get.rs:367-379 | crates/perry-codegen/src/expr/index_get.rs:460-472 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/instance_misc1.rs:268— crates/perry-codegen/src/expr/instance_misc1.rs:268-280 | crates/perry-codegen/src/expr/instance_misc1.rs:728-740 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/math_simple.rs:904— crates/perry-codegen/src/expr/math_simple.rs:904-916 | crates/perry-codegen/src/expr/math_simple.rs:972-984 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/write_barrier.rs:214— crates/perry-codegen/src/expr/write_barrier.rs:214-226 | crates/perry-codegen/src/expr/write_barrier.rs:360-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/perry-codegen/src/layout_families.rs:367— crates/perry-codegen/src/layout_families.rs:367-379 | crates/perry-codegen/src/lower_call/new_alloc.rs:315-327 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/perry-codegen/src/lower_call/scalar_method.rs:859— crates/perry-codegen/src/lower_call/scalar_method.rs:859-871 | crates/perry-codegen/src/lower_call/scalar_method.rs:1080-1092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/perry-codegen/src/native_value/materialize.rs:332— crates/perry-codegen/src/native_value/materialize.rs:332-344 | crates/perry-codegen/src/native_value/materialize.rs:546-558 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/loops.rs:8182— crates/perry-codegen/src/stmt/loops.rs:8182-8194 | crates/perry-codegen/src/stmt/loops.rs:8769-8781 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/region_loop/bare.rs:357— crates/perry-codegen/src/stmt/region_loop/bare.rs:357-369 | crates/perry-codegen/src/stmt/region_loop/plan.rs:47-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/perry-container-compose/src/backend/apple.rs:254— crates/perry-container-compose/src/backend/apple.rs:254-266 | crates/perry-container-compose/src/backend/docker.rs:264-276 — before extracting anything, compare `crates/perry-container-compose/src/backend/apple.rs` and `crates/perry-container-compose/src/backend/docker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-ext-better-sqlite3/src/lib.rs:379— crates/perry-ext-better-sqlite3/src/lib.rs:379-391 | crates/perry-ext-better-sqlite3/src/lib.rs:459-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/perry-ext-http/src/server/turnloop_h2/conn.rs:1146— crates/perry-ext-http/src/server/turnloop_h2/conn.rs:1146-1158 | crates/perry-ext-http/src/server/turnloop_h2/conn.rs:1256-1268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/perry-ext-http/src/server/types.rs:297— crates/perry-ext-http/src/server/types.rs:297-309 | crates/perry-ext-net/src/jsvalue.rs:97-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/perry-ext-net/src/payload_abi.rs:1021— crates/perry-ext-net/src/payload_abi.rs:1021-1033 | crates/perry-ext-net/src/payload_abi.rs:1294-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
perry_stdlib::webcrypto::jwk::js_webcrypto_import_key (cyclomatic 134) crates/perry-stdlib/src/webcrypto/jwk.rs:14— perry_stdlib::webcrypto::jwk::js_webcrypto_import_key has cyclomatic complexity 134 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_stdlib::crypto::cipher::cipher_step (cyclomatic 112) crates/perry-stdlib/src/crypto/cipher.rs:793— perry_stdlib::crypto::cipher::cipher_step has cyclomatic complexity 112 (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.
perry_stdlib::webcrypto::keys::js_webcrypto_generate_key (cyclomatic 99) crates/perry-stdlib/src/webcrypto/keys.rs:18— perry_stdlib::webcrypto::keys::js_webcrypto_generate_key has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_stdlib::crypto::random::js_crypto_native_dispatch (cyclomatic 74) crates/perry-stdlib/src/crypto/random.rs:305— perry_stdlib::crypto::random::js_crypto_native_dispatch has cyclomatic complexity 74 (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.
perry_stdlib::webcrypto::hmac::js_webcrypto_verify (cyclomatic 60) crates/perry-stdlib/src/webcrypto/hmac.rs:212— perry_stdlib::webcrypto::hmac::js_webcrypto_verify 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.
perry_stdlib::tls::dispatch::dispatch_tls_handle (cyclomatic 51) crates/perry-stdlib/src/tls/dispatch.rs:149— perry_stdlib::tls::dispatch::dispatch_tls_handle has cyclomatic complexity 51 (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.
perry_stdlib::webcrypto::wrap::js_webcrypto_unwrap_key (cyclomatic 49) crates/perry-stdlib/src/webcrypto/wrap.rs:372— perry_stdlib::webcrypto::wrap::js_webcrypto_unwrap_key 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.
perry_stdlib::webcrypto::hmac::js_webcrypto_sign (cyclomatic 48) crates/perry-stdlib/src/webcrypto/hmac.rs:9— perry_stdlib::webcrypto::hmac::js_webcrypto_sign 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.
perry_stdlib::webcrypto::jwk::js_webcrypto_export_key (cyclomatic 45) crates/perry-stdlib/src/webcrypto/jwk.rs:393— perry_stdlib::webcrypto::jwk::js_webcrypto_export_key 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.
perry_stdlib::fetch::request_copy::js_request_new_from_input (cyclomatic 44) crates/perry-stdlib/src/fetch/request_copy.rs:10— perry_stdlib::fetch::request_copy::js_request_new_from_input 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.
perry_stdlib::webcrypto::wrap::js_webcrypto_wrap_key (cyclomatic 41) crates/perry-stdlib/src/webcrypto/wrap.rs:139— perry_stdlib::webcrypto::wrap::js_webcrypto_wrap_key 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.
perry_stdlib::readline::pump::js_readline_process_pending (cyclomatic 39) crates/perry-stdlib/src/readline/pump.rs:358— perry_stdlib::readline::pump::js_readline_process_pending 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.
perry_stdlib::webcrypto::aes::js_webcrypto_encrypt (cyclomatic 39) crates/perry-stdlib/src/webcrypto/aes.rs:721— perry_stdlib::webcrypto::aes::js_webcrypto_encrypt 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. This shape REPEATS in the file: one other method here (perry_stdlib::webcrypto::aes::js_webcrypto_decrypt) 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.
perry_stdlib::webcrypto::aes::js_webcrypto_decrypt (cyclomatic 39) crates/perry-stdlib/src/webcrypto/aes.rs:958— perry_stdlib::webcrypto::aes::js_webcrypto_decrypt 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. This shape REPEATS in the file: one other method here (perry_stdlib::webcrypto::aes::js_webcrypto_encrypt) 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.
perry_stdlib::worker_threads::channel_pump::js_worker_threads_channels_process_pending (cyclomatic 38) crates/perry-stdlib/src/worker_threads/channel_pump.rs:17— perry_stdlib::worker_threads::channel_pump::js_worker_threads_channels_process_pending 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.
perry_stdlib::streams::subclass::dispatch_stream_method (cyclomatic 34) crates/perry-stdlib/src/streams/subclass.rs:181— perry_stdlib::streams::subclass::dispatch_stream_method 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.
perry_stdlib::turnloop_client::exchange::feed (cyclomatic 33) crates/perry-stdlib/src/turnloop_client/exchange.rs:831— perry_stdlib::turnloop_client::exchange::feed 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.
perry_stdlib::tls::event_pump::js_tls_process_pending (cyclomatic 31) crates/perry-stdlib/src/tls/event_pump.rs:33— perry_stdlib::tls::event_pump::js_tls_process_pending 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.
perry_stdlib::cheerio::dispatch_cheerio (cyclomatic 27) crates/perry-stdlib/src/cheerio.rs:465— perry_stdlib::cheerio::dispatch_cheerio 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.
perry_stdlib::readline::pump::route_pending_stdin_input (cyclomatic 27) crates/perry-stdlib/src/readline/pump.rs:253— perry_stdlib::readline::pump::route_pending_stdin_input 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.
perry_stdlib::streams::release_web_streams_in_freed_ranges (cyclomatic 27) crates/perry-stdlib/src/streams.rs:665— perry_stdlib::streams::release_web_streams_in_freed_ranges 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.
perry_stdlib::crypto::x509::dispatch_x509_property (cyclomatic 26) crates/perry-stdlib/src/crypto/x509.rs:1008— perry_stdlib::crypto::x509::dispatch_x509_property 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.
perry_stdlib::streams::gc::scan_stream_roots_with (cyclomatic 26) crates/perry-stdlib/src/streams/gc.rs:137— perry_stdlib::streams::gc::scan_stream_roots_with 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.
perry_stdlib::string_decoder::dispatch_string_decoder (cyclomatic 23) crates/perry-stdlib/src/string_decoder.rs:790— perry_stdlib::string_decoder::dispatch_string_decoder 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.
perry_stdlib::fetch::dispatch::dispatch_response_property (cyclomatic 21) crates/perry-stdlib/src/fetch/dispatch.rs:481— perry_stdlib::fetch::dispatch::dispatch_response_property has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: perry_stdlib::fetch::dispatch::dispatch_request_property (cyclomatic 27) 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.
+ 21 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×45
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/perry-codegen-arkts/src/mutations.rs:945— crates/perry-codegen-arkts/src/mutations.rs:945-1064 | crates/perry-codegen-arkts/src/widgets/scroll.rs:32-161 | crates/perry-codegen-arkts/src/widgets/scroll.rs:183-313 | crates/perry-codegen-arkts/src/widgets/stack.rs:33-141 — 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/perry-codegen-arkts/src/widgets/scroll.rs:32— crates/perry-codegen-arkts/src/widgets/scroll.rs:32-161 | crates/perry-codegen-arkts/src/widgets/scroll.rs:183-313 | crates/perry-codegen-arkts/src/widgets/stack.rs:33-141 | crates/perry-codegen-arkts/src/widgets/structure.rs:25-124 — 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/perry-codegen-glance/src/emit.rs:111— crates/perry-codegen-glance/src/emit.rs:111-132 | crates/perry-codegen-glance/src/emit.rs:135-276 | crates/perry-codegen-glance/src/emit_glue.rs:9-163 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:10-105 — 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/perry-codegen-glance/src/emit.rs:718— crates/perry-codegen-glance/src/emit.rs:718-727 | crates/perry-codegen-glance/src/emit_glue.rs:165-174 | crates/perry-codegen-wear-tiles/src/emit.rs:478-487 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:107-116 — 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/perry-codegen/src/codegen/closure.rs:235— crates/perry-codegen/src/codegen/closure.rs:235-280 | crates/perry-codegen/src/codegen/closure.rs:288-333 | crates/perry-codegen/src/codegen/closure.rs:341-379 | crates/perry-codegen/src/codegen/closure.rs:387-423 — 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/perry-codegen/src/codegen/method_trampolines.rs:91— crates/perry-codegen/src/codegen/method_trampolines.rs:91-145 | crates/perry-codegen/src/codegen/method_trampolines.rs:152-172 | crates/perry-codegen/src/codegen/method_trampolines.rs:192-389 | crates/perry-codegen/src/codegen/method_trampolines.rs:408-450 — 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/perry-codegen/src/codegen/method_trampolines.rs:192— crates/perry-codegen/src/codegen/method_trampolines.rs:192-389 | crates/perry-codegen/src/expr/arrays_finds.rs:112-215 | crates/perry-codegen/src/expr/class_field_push.rs:14-123 | crates/perry-codegen/src/expr/u8_buffer_read.rs:272-337 — 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/perry-codegen/src/collectors/escape_check.rs:232— crates/perry-codegen/src/collectors/escape_check.rs:232-1203 | crates/perry-codegen/src/collectors/escape_news.rs:235-939 | crates/perry-codegen/src/collectors/escape_objects.rs:411-718 | crates/perry-codegen/src/collectors/ptr_shape.rs:1417-1743 — 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/perry-codegen/src/collectors/hir_facts.rs:1177— crates/perry-codegen/src/collectors/hir_facts.rs:1177-1285 | crates/perry-codegen/src/collectors/shadow_slots.rs:77-157 | crates/perry-codegen/src/expr/closure.rs:28-87 | crates/perry-hir/src/lower/lower_module_fn.rs:25-177 — 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/perry-codegen/src/collectors/hoisted_callback_calls.rs:286— crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:286-415 | crates/perry-codegen/src/collectors/spec_abi_sites.rs:1340-1502 | crates/perry-codegen/src/collectors/straight_line_stores.rs:44-108 | crates/perry-hir/src/enums.rs:47-144 — 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/perry-codegen/src/collectors/i32_locals.rs:55— crates/perry-codegen/src/collectors/i32_locals.rs:55-150 | crates/perry-codegen/src/collectors/i32_locals.rs:771-783 | crates/perry-codegen/src/collectors/integer_locals.rs:741-833 | crates/perry-codegen/src/collectors/integer_locals.rs:1097-1161 — 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/perry-codegen/src/collectors/proven_args.rs:224— crates/perry-codegen/src/collectors/proven_args.rs:224-311 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:907-982 | crates/perry-codegen/src/collectors/scalar_methods.rs:422-496 | crates/perry-codegen/src/expr/slot_rep.rs:721-972 — 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/perry-codegen/src/collectors/segview.rs:707— crates/perry-codegen/src/collectors/segview.rs:707-742 | crates/perry-codegen/src/collectors/segview.rs:1328-1363 | crates/perry-hir/src/analysis.rs:545-625 | crates/perry-hir/src/lower_decl/class_captures.rs:71-146 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/perry-codegen/src/collectors/typed_locals.rs:321— crates/perry-codegen/src/collectors/typed_locals.rs:321-455 | crates/perry-codegen/src/stmt/region_loop/plan.rs:721-765 | crates/perry-codegen/src/type_analysis/numeric.rs:178-602 | crates/perry-codegen/src/type_analysis/numeric.rs:667-839 — 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/perry-codegen/src/expr/array_methods.rs:58— crates/perry-codegen/src/expr/array_methods.rs:58-461 | crates/perry-codegen/src/expr/instance_misc1.rs:266-1682 | crates/perry-codegen/src/expr/logical_collections.rs:548-1710 | crates/perry-codegen/src/expr/url_main.rs:40-669 — 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/perry-codegen/src/expr/array_push.rs:184— crates/perry-codegen/src/expr/array_push.rs:184-234 | crates/perry-codegen/src/expr/array_push.rs:282-336 | crates/perry-codegen/src/expr/write_barrier.rs:492-547 | crates/perry-codegen/src/expr/write_barrier.rs:829-892 — 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/perry-codegen/src/expr/buffer_access.rs:488— crates/perry-codegen/src/expr/buffer_access.rs:488-539 | crates/perry-codegen/src/expr/buffer_access.rs:547-598 | crates/perry-codegen/src/expr/buffer_access.rs:655-727 | crates/perry-codegen/src/expr/buffer_access.rs:773-897 — 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/perry-codegen/src/expr/compare.rs:120— crates/perry-codegen/src/expr/compare.rs:120-158 | crates/perry-codegen/src/expr/compare.rs:468-567 | crates/perry-codegen/src/expr/compare.rs:1083-1169 | crates/perry-codegen/src/expr/suffix_cursor.rs:15-97 — 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/perry-codegen/src/expr/env_clones.rs:15— crates/perry-codegen/src/expr/env_clones.rs:15-443 | crates/perry-codegen/src/expr/math_simple.rs:431-1274 | crates/perry-codegen/src/expr/misc_methods.rs:144-1211 | crates/perry-codegen/src/expr/string_regex_proc.rs:18-687 — 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/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:101— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:101-786 | crates/perry-codegen/src/expr/private_resume_frame.rs:26-46 | crates/perry-codegen/src/expr/private_resume_frame.rs:138-219 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:885-1176 — 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/perry-codegen/src/expr/range_facts.rs:629— crates/perry-codegen/src/expr/range_facts.rs:629-650 | crates/perry-codegen/src/expr/range_facts.rs:972-993 | crates/perry-codegen/src/stmt/loops.rs:8303-8401 | crates/perry-codegen/src/stmt/loops.rs:8408-8489 — 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/perry-codegen/src/expr/static_method.rs:183— crates/perry-codegen/src/expr/static_method.rs:183-810 | crates/perry-codegen/src/lower_array_method.rs:1116-1238 | crates/perry-codegen/src/lower_call/console_promise.rs:778-792 | crates/perry-codegen/src/lower_call/property_get/builtin_kind_guard.rs:287-334 — 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/perry-codegen/src/expr/write_barrier.rs:212— crates/perry-codegen/src/expr/write_barrier.rs:212-241 | crates/perry-codegen/src/expr/write_barrier.rs:297-334 | crates/perry-codegen/src/expr/write_barrier.rs:358-386 | crates/perry-codegen/src/expr/write_barrier.rs:829-892 — 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/perry-codegen/src/linker.rs:1515— crates/perry-codegen/src/linker.rs:1515-1531 | crates/perry-hir/src/lower/const_fold_fn.rs:115-131 | crates/perry-hir/src/lower/fn_ctor_env.rs:244-269 | crates/perry-runtime-manifest/src/realm_json.rs:35-87 — 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/perry-codegen/src/stmt/loops.rs:3706— crates/perry-codegen/src/stmt/loops.rs:3706-4174 | crates/perry-codegen/src/stmt/loops.rs:7185-7793 | crates/perry-codegen/src/stmt/masked_window_region.rs:683-862 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1541-1823 — 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.
Sync-over-async blocking packages/perry-updater/src/index.ts:455— `fs.writeFileSync` in `downloadAndVerify` 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/perry-updater/src/index.ts:456— `fs.renameSync` in `downloadAndVerify` 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 scripts/check/run.mts:26— `spawnSync` in `runChecks` 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 scripts/publish/npm/proof.mts:33— `existsSync` in `packTarball` 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 scripts/publish/npm/proof.mts:44— `existsSync` in `resolvePackageTarball` 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 scripts/publish/npm/proof.mts:45— `readdirSync` in `resolvePackageTarball` 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 scripts/publish/release.mts:150— `existsSync` in `ensureTagAndRelease` 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 scripts/publish/release.mts:162— `mkdtempSync` in `ensureTagAndRelease` 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 scripts/publish/release.mts:164— `writeFileSync` in `ensureTagAndRelease` 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 scripts/publish/release.mts:168— `writeFileSync` in `ensureTagAndRelease` 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 scripts/publish/release.mts:328— `rmSync` in `ensureTagAndRelease` 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 scripts/publish/release.mts:335— `rmSync` in `ensureTagAndRelease` 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 scripts/publish/scan-ci-packages.mts:20— `readFileSync` in `main` 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 scripts/publish/scan-ci-packages.mts:39— `writeFileSync` in `main` 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 scripts/publish/scan.mts:178— `existsSync` in `scanTarball` 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 scripts/soak/external-tools.mts:370— `existsSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:374— `existsSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:381— `mkdirSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:386— `existsSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:390— `existsSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:391— `rmSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:395— `writeFileSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:397— `chmodSync` in `installAssetTool` 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 scripts/soak/external-tools.mts:422— `existsSync` in `installNpmTarball` 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 scripts/soak/external-tools.mts:423— `rmSync` in `installNpmTarball` 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.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file upstream/actions/jdx/mr-boxington-action/src/objects-cache.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 scripts/node_compat_matrix.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 upstream/actions/actions/checkout/src/git-command-manager.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 upstream/actions/jdx/mr-boxington-action/src/index.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 upstream/actions/actions/checkout/src/git-auth-helper.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 upstream/actions/jdx/mr-boxington-action/src/lib.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 example-code/forgejo-deployment/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 upstream/actions/Swatinem/rust-cache/src/config.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 scripts/binding_pins.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 upstream/actions/astral-sh/setup-uv/src/utils/inputs.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 upstream/actions/actions/checkout/src/git-source-provider.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 upstream/actions/actions/setup-node/src/distributions/base-distribution.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 upstream/actions/astral-sh/setup-uv/src/download/manifest.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 scripts/fp_fuzz.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 upstream/actions/actions/setup-node/src/cache-utils.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 REDACTED: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 REDACTED: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 upstream/actions/actions/setup-node/src/distributions/official_builds/official_builds.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 upstream/actions/astral-sh/setup-uv/src/setup-uv.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 upstream/actions/jdx/mr-boxington-action/src/target-cache.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 upstream/actions/actions/download-artifact/src/download-artifact.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 upstream/actions/oven-sh/setup-bun/src/action.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 scripts/regex_9217_9218_differential.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 upstream/actions/astral-sh/setup-uv/src/version/resolve.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 scripts/update-actions.mts: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.
Repeated repair: crates/perry-hir/src/lower/context_new.rs crates/perry-hir/src/lower/context_new.rs:17— crates/perry-hir/src/lower/context_new.rs changed 24 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is LoweringContext::new at line 17), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir): bind forward reads of a repeated class and fill forward cells in async scopes”; “fix(hir): construct the global when a program class shares a name with a globalThis alias”; “fix(hir): construct undici agents through a require()d namespace local”; “fix(compile): take module shape-id slices at job start; share the deferred set”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-hir/src/lower/context_new.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/perry-codegen/src/lower_call/property_get/own_override_guard.rs crates/perry-codegen/src/lower_call/property_get/own_override_guard.rs:263— crates/perry-codegen/src/lower_call/property_get/own_override_guard.rs changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is perry_codegen::lower_call::property_get::own_override_guard::proven_kind_family at line 263), 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(array): preserve Proxy receivers through builtin dispatch”; “fix(runtime,codegen): builtin method calls honour patched prototypes via one pristine-prototype proof checked in the callee (#11915)”; “fix(codegen): own method beats a Date/Array builtin on unproven receivers (#11493)”; “fix: an own `push` beats Array.prototype.push on a proven array (#11021)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/lower_call/property_get/own_override_guard.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/perry-runtime/src/fs/validate.rs crates/perry-runtime/src/fs/validate.rs:46— crates/perry-runtime/src/fs/validate.rs changed 15 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 perry_runtime::fs::validate::encoded_path_separator at line 46), 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 strict Rust warning gates and portable test helpers”; “fix: native handles are JS references everywhere — one is_reference predicate, sign-closed number guards, reference-test audit gate (#12540)”; “fix(runtime): classify diagnostic prototype chains without extra gets”; “fix(runtime): respect diagnostic GetV and native prototype authority”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/fs/validate.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/perry-stdlib/src/fetch/headers.rs crates/perry-stdlib/src/fetch/headers.rs:60— crates/perry-stdlib/src/fetch/headers.rs changed 14 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is perry_stdlib::fetch::headers::js_headers_method_value at line 60), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fetch): reclaim unreachable handles and recycle registry IDs”; “fix(fetch): keep the Headers method cache in a registry-only record”; “fix(fetch): tie bound-method caches to handle records”; “Fix proxy array materialization and dynamic Request headers”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-stdlib/src/fetch/headers.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/perry-stdlib/src/fetch/request_ctor.rs crates/perry-stdlib/src/fetch/request_ctor.rs:16— crates/perry-stdlib/src/fetch/request_ctor.rs changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is perry_stdlib::fetch::request_ctor::js_request_new at line 16), 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 fetch options passed through variables and helpers”; “fix(fetch): new Request(url, { headers: null }) throws a TypeError again”; “fix(fetch): read Request, Response and fetch bodies from async iterables”; “fix(fetch): preserve enclosing body conversion metadata”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-stdlib/src/fetch/request_ctor.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/perry-ui-macos/src/widgets/padding.rs crates/perry-ui-macos/src/widgets/padding.rs:230— crates/perry-ui-macos/src/widgets/padding.rs changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is perry_ui_macos::widgets::padding::set_edge_insets at line 230), 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(ui-macos): keep text fields and Text inside the width they fill (#11739) (#11740)”; “fix(ui-macos): keep TextField and SecureField to one line, as a web input does (#11661)”; “fix(ui-macos): pad text fields as CSS padding does (#11661)”; “fix(ui-macos): build the inset cell through cellClass (#11661)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-ui-macos/src/widgets/padding.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/perry-runtime/src/url/mod.rs crates/perry-runtime/src/url/mod.rs:74— crates/perry-runtime/src/url/mod.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is perry_runtime::url::js_url_coerce_string at line 74), 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 strict Rust warning gates and portable test helpers”; “fix(url): remove dot segments and fold special-scheme separators”; “fix file URL Windows drive parsing”; “fix(runtime,stdlib,codegen,ext): short (SSO) strings at native string entry points (#11519)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/url/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/perry-runtime/src/object/class_super_chain.rs crates/perry-runtime/src/object/class_super_chain.rs:52— crates/perry-runtime/src/object/class_super_chain.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is perry_runtime::object::class_super_chain::super_call_with_lookup at line 52), 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: follow live constructor and home-object heritage”; “fix: native handles are JS references everywhere — one is_reference predicate, sign-closed number guards, reference-test audit gate (#12540)”; “fix(classes): lexical class homes for super, live-home super writes, lone-surrogate method names, WeakMap/WeakSet subclass new.target (#12210 #12211 #12202 #12396)”; “fix(runtime): preserve evaluated super prototypes and reuse interned keys”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/class_super_chain.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/perry-ext-http/src/server/http2_settings.rs crates/perry-ext-http/src/server/http2_settings.rs:155— crates/perry-ext-http/src/server/http2_settings.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is perry_ext_http::server::http2_settings::js_node_http2_get_unpacked_settings at line 155), 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(http,ws): honor canonical native handle values”; “fix(http2): pack NaN settings as zero and reject infinite ones like Node”; “fix(http2): pack in-range fractional settings as truncated uint32”; “fix(http2): enforce packed initial window size bound”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-ext-http/src/server/http2_settings.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: test-files/test_gap_received_value_diagnostics.ts test-files/test_gap_received_value_diagnostics.ts:356— test-files/test_gap_received_value_diagnostics.ts changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is test_gap_received_value_diagnostics.chainValueGetter at line 356), 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(runtime): classify diagnostic prototype chains without extra gets”; “fix(runtime): respect diagnostic GetV and native prototype authority”; “fix(runtime): guard primitive diagnostic constructor operands”; “fix(runtime): honor inherited intrinsic view diagnostic constructors”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- test-files/test_gap_received_value_diagnostics.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: crates/perry-ext-ws/src/server.rs crates/perry-ext-ws/src/server.rs:150— crates/perry-ext-ws/src/server.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is perry_ext_ws::server::js_ws_server_new at line 150), 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(ext-ws): drop an exiting agent's ws state and root only the current agent's slots”; “fix(ext-ws): run the ws pump and keepalive on every agent's own loop”; “fix(http,ws): honor canonical native handle values”; “Declare fixed runtime record layouts”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-ext-ws/src/server.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/perry-ext-http/src/server/turnloop_serve/mod.rs crates/perry-ext-http/src/server/turnloop_serve/mod.rs:190— crates/perry-ext-http/src/server/turnloop_serve/mod.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is perry_ext_http::server::turnloop_serve::post_with at line 190), 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(http): keep response lifetime separate from request receipt”; “fix(http): destroy accepted socket transport across protocols”; “fix(http2): close server connection socket with transport”; “fix(http): preserve response framing after writeHead”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-ext-http/src/server/turnloop_serve/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/perry-stdlib/src/fetch/response_ctor.rs crates/perry-stdlib/src/fetch/response_ctor.rs:87— crates/perry-stdlib/src/fetch/response_ctor.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is perry_stdlib::fetch::response_ctor::js_response_new at line 87), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fetch): read Request, Response and fetch bodies from async iterables”; “fix(fetch): make handle reclamation deadlock-free, root object URLs and young ids”; “fix(fetch): reclaim unreachable handles and recycle registry IDs”; “fix(fetch): keep the Headers method cache in a registry-only record”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-stdlib/src/fetch/response_ctor.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/perry-runtime/src/object/class_registry/evaluation_heritage.rs crates/perry-runtime/src/object/class_registry/evaluation_heritage.rs:209— crates/perry-runtime/src/object/class_registry/evaluation_heritage.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is perry_runtime::object::class_registry::evaluation_heritage::pin_instance_constructing_class at line 209), 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(layout): a class evaluation's instance carries its own copy of the family layout”; “fix: follow live constructor and home-object heritage”; “fix(runtime): a class used as a value is its function object; statics are its own properties (#11414) (#11609)”; “fix: preserve tagged error names across class evaluations”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/class_registry/evaluation_heritage.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/perry-runtime/src/object/native_module/name_tables.rs crates/perry-runtime/src/object/native_module/name_tables.rs:6— crates/perry-runtime/src/object/native_module/name_tables.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is perry_runtime::object::native_module::name_tables::canonical_native_callable_property at line 6), 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(runtime): route native-module namespaces without a dispatch bucket to their implementations”; “fix(zlib): preserve constant descriptors and readonly writes”; “fix(domain): preserve factory alias identity and canonical name”; “fix(runtime): preserve builtin CommonJS default identities”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/object/native_module/name_tables.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/perry-stdlib/src/fetch/body_clone.rs crates/perry-stdlib/src/fetch/body_clone.rs:50— crates/perry-stdlib/src/fetch/body_clone.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is perry_stdlib::fetch::body_clone::response_body_stream at line 50), 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(runtime): a number is always a Number; Web Streams handles are POINTER_TAG handles”; “fix(fetch): reclaim unreachable handles and recycle registry IDs”; “fix(fetch): keep the Headers method cache in a registry-only record”; “fix(fetch): Response.json shares ctor init validation; Bun platform skips null-body-status check (#10360)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-stdlib/src/fetch/body_clone.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/perry-stdlib/src/fetch/turnloop_bridge.rs crates/perry-stdlib/src/fetch/turnloop_bridge.rs:299— crates/perry-stdlib/src/fetch/turnloop_bridge.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is perry_stdlib::fetch::turnloop_bridge::response_done at line 299), 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(runtime): a number is always a Number; Web Streams handles are POINTER_TAG handles”; “fix(fetch): reject blocked destination ports before connecting”; “fix(stdlib): match Node's rejection shape and Response.type for redirects, add gap test”; “fix(fetch): honor redirect modes and response metadata”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-stdlib/src/fetch/turnloop_bridge.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/perry-ext-better-sqlite3/src/lib.rs crates/perry-ext-better-sqlite3/src/lib.rs:101— crates/perry-ext-better-sqlite3/src/lib.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is perry_ext_better_sqlite3::params_from_array at line 101), 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(better-sqlite3): stmt.run() works on a statement that returns rows”; “fix(ext): dynamic method calls on better-sqlite3 and Bun.Transpiler handles”; “Declare fixed runtime record layouts”; “fix(sqlite): better-sqlite3 close() closes the connection (Refs #11919)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-ext-better-sqlite3/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.
Repeated repair: crates/perry-codegen/src/expr/worker_new.rs crates/perry-codegen/src/expr/worker_new.rs:11— crates/perry-codegen/src/expr/worker_new.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is perry_codegen::expr::worker_new::lower_candidates at line 11), 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(codegen): make worker ownership a per-compile input”; “fix(worker): retain static candidates beside opaque returns”; “fix(codegen): the OTHER worker-entry emitter also needs the guarded wrapper (#10399)”; “fix(codegen): keep every alloca in the function entry block”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/expr/worker_new.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/perry-codegen/src/expr/v8_interop.rs crates/perry-codegen/src/expr/v8_interop.rs:285— crates/perry-codegen/src/expr/v8_interop.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is perry_codegen::expr::v8_interop::try_static_class_name at line 285), 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: honor live Map constructor binding”; “fix(codegen): keep every alloca in the function entry block”; “fix(codegen): build the intrinsic, not a runtime read, for a shadowed `new globalThis.X()` (#10359)”; “fix(hir,codegen): construct the global in `new globalThis.X()` when a binding shadows X (#10359)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/expr/v8_interop.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/perry-hir/src/lower_decl/class_decl/class_heritage.rs crates/perry-hir/src/lower_decl/class_decl/class_heritage.rs:34— crates/perry-hir/src/lower_decl/class_decl/class_heritage.rs changed 4 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 8 (its worst body is perry_hir::lower_decl::class_decl::class_heritage::dynamic_function_forwarding_mode at line 34), 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(hir): retain same-named global member parents without self-links”; “fix(hir): a member heritage named like an Error or fetch built-in is not that built-in”; “fix: follow live constructor and home-object heritage”; “fix(hir): a member heritage named like a JS built-in is not that built-in (#11139)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-hir/src/lower_decl/class_decl/class_heritage.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/perry-codegen/src/expr/class_field_push.rs crates/perry-codegen/src/expr/class_field_push.rs:14— crates/perry-codegen/src/expr/class_field_push.rs 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 3 (its worst body is perry_codegen::expr::class_field_push::lower at line 14), 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(runtime,codegen): builtin method calls honour patched prototypes via one pristine-prototype proof checked in the callee (#11915)”; “fix(runtime): a number is always a Number; Web Streams handles are POINTER_TAG handles”; “fix(gc): root call arguments across collecting argument evaluation in all call lowerings”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/expr/class_field_push.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/perry-runtime/src/timer/store.rs crates/perry-runtime/src/timer/store.rs:341— crates/perry-runtime/src/timer/store.rs 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 9 (its worst body is AgentTimers::sift_down at line 341), 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(timer): limit freed-range cleanup to primary partition”; “fix(timer): install the real Timeout/Immediate handle as callback `this`”; “fix(timer): stop check/poll queue placeholders from stealing a reused slab slot”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/timer/store.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/perry-codegen/src/codegen/ctor_arity.rs crates/perry-codegen/src/codegen/ctor_arity.rs:97— crates/perry-codegen/src/codegen/ctor_arity.rs 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 12 (its worst body is perry_codegen::codegen::ctor_arity::synthesized_ctor_param_count at line 97), 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(hir,codegen,runtime): make `arguments` in class constructors reflect the call site”; “fix(compile): share constructor arity across all heritage forms”; “fix(compile): imported default ctor arity matches the synthesized forwarding ctor (#10258)”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-codegen/src/codegen/ctor_arity.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/perry-runtime/src/net_validate.rs crates/perry-runtime/src/net_validate.rs:336— crates/perry-runtime/src/net_validate.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 13 (its worst body is perry_runtime::net_validate::js_net_normalize_args at line 336), 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(net): validate SocketAddress fields before coercion”; “fix(net): validate SocketAddress constructor options”; “fix(runtime): own statics on built-in constructors match Node”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 12:14:48 +01:00' --until='2026-10-28 12:14:48 +01:00' --full-history --no-merges -- crates/perry-runtime/src/net_validate.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.
Model::apply_inner (cognitive 527) crates/perry-wpfacts/src/solve/apply.rs:4— Model::apply_inner has cognitive complexity 527 (threshold 15). Drivers by points: if/else 104 (282 pts), loops 65 (145 pts), match/switch 23 (64 pts), boolean chains 36 (nesting depth added 299). 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.
Model::store_into (cognitive 140) crates/perry-wpfacts/src/solve/store.rs:276— Model::store_into has cognitive complexity 140 (threshold 15). Drivers by points: if/else 45 (80 pts), match/switch 16 (30 pts), boolean chains 20, loops 3 (10 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model::solve (cognitive 79) crates/perry-wpfacts/src/solve.rs:396— Model::solve has cognitive complexity 79 (threshold 15). Drivers by points: if/else 25 (64 pts), boolean chains 10, loops 3 (5 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.
Model::escape (cognitive 67) crates/perry-wpfacts/src/solve/call_and_construct.rs:776— Model::escape has cognitive complexity 67 (threshold 15). Drivers by points: if/else 27 (55 pts), boolean chains 11, loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Model::build (cognitive 60) crates/perry-codegen/src/collectors/definite_init.rs:481— Model::build has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 13 (21 pts), boolean chains 3 (nesting depth added 30). Of this number, 58 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.
Model::publish_class (cognitive 56) crates/perry-wpfacts/src/solve/call_and_construct.rs:1114— Model::publish_class has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 7 (10 pts), boolean chains 5, match/switch 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.
Model::settle_keyed_uses (cognitive 54) crates/perry-wpfacts/src/model/operations.rs:753— Model::settle_keyed_uses has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 11 (21 pts), match/switch 1 (4 pts), boolean chains 2 (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.
Model::escape_summarized (cognitive 53) crates/perry-wpfacts/src/summary.rs:1734— Model::escape_summarized has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 3 (6 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Model::add_tokens (cognitive 41) crates/perry-wpfacts/src/solve.rs:34— Model::add_tokens has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 9, loops 3 (6 pts), match/switch 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.
Model::store_out_arg_reach (cognitive 39) crates/perry-wpfacts/src/solve.rs:1459— Model::store_out_arg_reach has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 8 (20 pts), if/else 5 (11 pts), boolean chains 4, loops 4 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Model::escape_fn_params (cognitive 35) crates/perry-wpfacts/src/solve/call_and_construct.rs:1001— Model::escape_fn_params has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Model::virt_revoke (cognitive 32) crates/perry-wpfacts/src/solve.rs:1159— Model::virt_revoke has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (8 pts), match/switch 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model::wire_args (cognitive 32) crates/perry-wpfacts/src/summary.rs:1445— Model::wire_args has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (6 pts), match/switch 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.
Model::settle_members_from (cognitive 31) crates/perry-wpfacts/src/model/operations.rs:1014— Model::settle_members_from has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (10 pts), match/switch 1 (3 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.
Model::load_from (cognitive 31) crates/perry-wpfacts/src/solve/lookup.rs:8— Model::load_from has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 4 (6 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.
Model::mark_use (cognitive 29) crates/perry-wpfacts/src/model/operations.rs:467— Model::mark_use has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (7 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.
Model::arg_readers_add (cognitive 29) crates/perry-wpfacts/src/solve/store.rs:163— Model::arg_readers_add has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (14 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.
Model::admit_this (cognitive 29) crates/perry-wpfacts/src/solve.rs:1243— Model::admit_this has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 2 (5 pts), match/switch 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.
Model::bind_args (cognitive 26) crates/perry-wpfacts/src/solve/call_and_construct.rs:175— Model::bind_args has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 4 (5 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.
Model::method_on (cognitive 25) crates/perry-wpfacts/src/solve/call_and_construct.rs:661— Model::method_on has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 3 (4 pts), loops 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.
Model::escape_this (cognitive 25) crates/perry-wpfacts/src/summary.rs:1071— Model::escape_this has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (7 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Model::summarize_and_replay (cognitive 25) crates/perry-wpfacts/src/summary.rs:1836— Model::summarize_and_replay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (5 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Model::fill_instance (cognitive 23) crates/perry-wpfacts/src/summary.rs:1329— Model::fill_instance has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 8, match/switch 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.
Model::publish_fn_inst (cognitive 21) crates/perry-wpfacts/src/solve/call_and_construct.rs:1448— Model::publish_fn_inst has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (9 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.
Model::field (cognitive 21) crates/perry-wpfacts/src/solve.rs:541— Model::field has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (5 pts), boolean chains 4, match/switch 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.
perry_wpfacts::units::driver::run (cognitive 339) crates/perry-wpfacts/src/units/driver.rs:239— perry_wpfacts::units::driver::run has cognitive complexity 339 (threshold 15). Drivers by points: loops 61 (166 pts), if/else 39 (127 pts), match/switch 6 (28 pts), boolean chains 18 (nesting depth added 215). 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.
perry_wpfacts::compute_in (cognitive 243) crates/perry-wpfacts/src/lib.rs:266— perry_wpfacts::compute_in has cognitive complexity 243 (threshold 15). Drivers by points: if/else 81 (126 pts), loops 26 (47 pts), boolean chains 46, match/switch 14 (24 pts) (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::lib::contracts::describe_nodes (cognitive 150) crates/perry-wpfacts/src/lib/contracts.rs:794— perry_wpfacts::lib::contracts::describe_nodes has cognitive complexity 150 (threshold 15). Drivers by points: if/else 30 (120 pts), match/switch 4 (17 pts), loops 4 (9 pts), boolean chains 4 (nesting depth added 108). 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.
perry_wpfacts::decl_units::views (cognitive 141) crates/perry-wpfacts/src/decl_units.rs:1392— perry_wpfacts::decl_units::views has cognitive complexity 141 (threshold 15). Drivers by points: if/else 20 (69 pts), loops 23 (47 pts), match/switch 8 (23 pts), boolean chains 2 (nesting depth added 88). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::summary::compose::compress (cognitive 117) crates/perry-wpfacts/src/summary/compose.rs:290— perry_wpfacts::summary::compose::compress has cognitive complexity 117 (threshold 15). Drivers by points: if/else 21 (57 pts), loops 28 (54 pts), boolean chains 4, match/switch 2 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::lib::contracts::arg_contract_of (cognitive 114) crates/perry-wpfacts/src/lib/contracts.rs:1592— perry_wpfacts::lib::contracts::arg_contract_of has cognitive complexity 114 (threshold 15). Drivers by points: if/else 25 (86 pts), match/switch 3 (14 pts), boolean chains 7, loops 4 (7 pts) (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.
perry_wpfacts::builtins::tok_load (cognitive 103) crates/perry-wpfacts/src/builtins.rs:559— perry_wpfacts::builtins::tok_load has cognitive complexity 103 (threshold 15). Drivers by points: if/else 27 (69 pts), match/switch 12 (25 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 56). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_wpfacts::decl_units::decl_units (cognitive 99) crates/perry-wpfacts/src/decl_units.rs:1139— perry_wpfacts::decl_units::decl_units has cognitive complexity 99 (threshold 15). Drivers by points: if/else 17 (48 pts), loops 19 (42 pts), match/switch 3 (8 pts), boolean chains 1 (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.
perry_wpfacts::decl_units::closed (cognitive 76) crates/perry-wpfacts/src/decl_units.rs:809— perry_wpfacts::decl_units::closed has cognitive complexity 76 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 19 (22 pts), boolean chains 10, match/switch 4 (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.
perry_wpfacts::units::driver::solves (cognitive 72) crates/perry-wpfacts/src/units/driver.rs:44— perry_wpfacts::units::driver::solves has cognitive complexity 72 (threshold 15). Drivers by points: if/else 10 (38 pts), loops 7 (17 pts), match/switch 4 (15 pts), boolean chains 2 (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.
perry_wpfacts::units::published_surface (cognitive 69) crates/perry-wpfacts/src/units.rs:954— perry_wpfacts::units::published_surface has cognitive complexity 69 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 9 (15 pts), match/switch 4 (13 pts), boolean chains 5 (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.
perry_wpfacts::derive::judge (cognitive 66) crates/perry-wpfacts/src/derive.rs:792— perry_wpfacts::derive::judge has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (40 pts), match/switch 7 (17 pts), boolean chains 8, loops 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.
perry_wpfacts::derive::template_facts (cognitive 61) crates/perry-wpfacts/src/derive.rs:359— perry_wpfacts::derive::template_facts has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (40 pts), boolean chains 12, loops 6 (8 pts), 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.
perry_wpfacts::lib::contracts::describe_toks (cognitive 59) crates/perry-wpfacts/src/lib/contracts.rs:1223— perry_wpfacts::lib::contracts::describe_toks has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (47 pts), match/switch 3 (7 pts), boolean chains 4, loops 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.
perry_wpfacts::builtins::ns_method (cognitive 55) crates/perry-wpfacts/src/builtins.rs:1331— perry_wpfacts::builtins::ns_method has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (42 pts), loops 4 (10 pts), boolean chains 2, 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.
perry_wpfacts::units::driver::unit_io (cognitive 53) crates/perry-wpfacts/src/units/driver.rs:1188— perry_wpfacts::units::driver::unit_io has cognitive complexity 53 (threshold 15). Drivers by points: loops 26 (51 pts), if/else 1 (2 pts) (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.
perry_wpfacts::summary::compose::compose (cognitive 49) crates/perry-wpfacts/src/summary/compose.rs:41— perry_wpfacts::summary::compose::compose has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 9 (20 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.
perry_wpfacts::summary::compose::expand (cognitive 44) crates/perry-wpfacts/src/summary/compose.rs:158— perry_wpfacts::summary::compose::expand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 13 (18 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::builtins::collections::array_method (cognitive 35) crates/perry-wpfacts/src/builtins/collections.rs:306— perry_wpfacts::builtins::collections::array_method has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (8 pts), match/switch 5 (8 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_wpfacts::decl_units::sccs (cognitive 33) crates/perry-wpfacts/src/decl_units.rs:1333— perry_wpfacts::decl_units::sccs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 3 (8 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::lib::contracts::fn_contract_of (cognitive 33) crates/perry-wpfacts/src/lib/contracts.rs:357— perry_wpfacts::lib::contracts::fn_contract_of has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, loops 5 (7 pts), match/switch 5 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::builtins::collections::bobj_method (cognitive 32) crates/perry-wpfacts/src/builtins/collections.rs:518— perry_wpfacts::builtins::collections::bobj_method has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_wpfacts::derive::site_facts (cognitive 31) crates/perry-wpfacts/src/derive.rs:674— perry_wpfacts::derive::site_facts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 3 (8 pts), loops 3, boolean chains 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.
perry_wpfacts::units::module_exports (cognitive 30) crates/perry-wpfacts/src/units.rs:1258— perry_wpfacts::units::module_exports has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (13 pts), match/switch 3 (11 pts), if/else 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wpfacts::lib::contracts::literal_field_fns (cognitive 29) crates/perry-wpfacts/src/lib/contracts.rs:63— perry_wpfacts::lib::contracts::literal_field_fns has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), match/switch 2 (6 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.
Gen::nested_fields (cognitive 157) crates/perry-wpfacts/src/gen/export.rs:1635— Gen::nested_fields has cognitive complexity 157 (threshold 15). Drivers by points: if/else 18 (75 pts), loops 13 (53 pts), match/switch 3 (21 pts), boolean chains 8 (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gen::expr_inner (cognitive 128) crates/perry-wpfacts/src/gen_expr.rs:425— Gen::expr_inner has cognitive complexity 128 (threshold 15). Drivers by points: if/else 32 (61 pts), loops 19 (39 pts), match/switch 12 (26 pts), boolean chains 2 (nesting depth added 63). 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.
Gen::expr_rest (cognitive 106) crates/perry-wpfacts/src/gen_rest.rs:136— Gen::expr_rest has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (49 pts), loops 13 (30 pts), match/switch 13 (25 pts), boolean chains 2 (nesting depth added 55). 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.
Gen::stand_in_fn_of (cognitive 90) crates/perry-wpfacts/src/gen/import_values.rs:596— Gen::stand_in_fn_of has cognitive complexity 90 (threshold 15). Drivers by points: match/switch 17 (39 pts), if/else 15 (25 pts), loops 14 (24 pts), boolean chains 2 (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.
Gen::stand_in_class (cognitive 82) crates/perry-wpfacts/src/gen/class_values.rs:636— Gen::stand_in_class has cognitive complexity 82 (threshold 15). Drivers by points: if/else 32 (54 pts), loops 12 (15 pts), boolean chains 7, match/switch 3 (6 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.
Gen::unit_boundary (cognitive 76) crates/perry-wpfacts/src/gen/export.rs:219— Gen::unit_boundary has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (47 pts), loops 11 (17 pts), match/switch 4 (9 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.
Gen::runtime_extern (cognitive 74) crates/perry-wpfacts/src/gen_call.rs:466— Gen::runtime_extern has cognitive complexity 74 (threshold 15). Drivers by points: if/else 28 (56 pts), loops 6 (12 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 36). 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.
Gen::link_exports (cognitive 68) crates/perry-wpfacts/src/gen/export.rs:27— Gen::link_exports has cognitive complexity 68 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 12 (21 pts), match/switch 5 (12 pts), boolean chains 1 (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.
Gen::contract_check (cognitive 67) crates/perry-wpfacts/src/gen/export.rs:803— Gen::contract_check has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (45 pts), loops 13 (15 pts), match/switch 3 (7 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.
Gen::runtime_glue (cognitive 58) crates/perry-wpfacts/src/gen/glue.rs:195— Gen::runtime_glue has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (40 pts), match/switch 6 (12 pts), loops 3 (6 pts) (nesting depth added 30). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Gen::note_for_in_define_keys (cognitive 52) crates/perry-wpfacts/src/gen/for_in.rs:317— Gen::note_for_in_define_keys has cognitive complexity 52 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 6 (18 pts), match/switch 4 (12 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gen::reports (cognitive 46) crates/perry-wpfacts/src/gen.rs:630— Gen::reports has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 6 (11 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gen::stand_in_value (cognitive 41) crates/perry-wpfacts/src/gen/class_values.rs:278— Gen::stand_in_value has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 9 (10 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.
Gen::publish_result (cognitive 39) crates/perry-wpfacts/src/gen/export.rs:657— Gen::publish_result has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 2 (8 pts), boolean chains 6, loops 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.
Gen::walk_class (cognitive 37) crates/perry-wpfacts/src/gen/walk.rs:294— Gen::walk_class has cognitive complexity 37 (threshold 15). Drivers by points: loops 11 (15 pts), if/else 6 (11 pts), match/switch 4 (8 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.
Gen::stmt_inner (cognitive 37) crates/perry-wpfacts/src/gen/walk.rs:532— Gen::stmt_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 3 (5 pts), loops 2 (4 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.
Gen::override_reports (cognitive 37) crates/perry-wpfacts/src/gen.rs:746— Gen::override_reports has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gen::check_toks (cognitive 36) crates/perry-wpfacts/src/gen/export.rs:1129— Gen::check_toks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 1 (4 pts), loops 3, boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gen::register_all (cognitive 36) crates/perry-wpfacts/src/gen.rs:467— Gen::register_all has cognitive complexity 36 (threshold 15). Drivers by points: loops 14 (26 pts), if/else 2 (6 pts), match/switch 1 (4 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.
Gen::note_field_fns (cognitive 34) crates/perry-wpfacts/src/gen/export.rs:1250— Gen::note_field_fns has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 2 (7 pts), loops 2 (4 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.
Gen::register_class (cognitive 30) crates/perry-wpfacts/src/gen.rs:1041— Gen::register_class has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 11 (13 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.
Gen::widen_stand_in (cognitive 29) crates/perry-wpfacts/src/gen/class_values.rs:513— Gen::widen_stand_in has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (8 pts), boolean chains 7 (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.
Gen::walk_all (cognitive 29) crates/perry-wpfacts/src/gen/walk.rs:9— Gen::walk_all has cognitive complexity 29 (threshold 15). Drivers by points: loops 10 (16 pts), if/else 5 (13 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.
Gen::closed_params (cognitive 27) crates/perry-wpfacts/src/gen/export.rs:489— Gen::closed_params has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (7 pts), loops 4 (5 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.
Gen::fill_described (cognitive 27) crates/perry-wpfacts/src/gen/import_values.rs:412— Gen::fill_described has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (7 pts), match/switch 3 (5 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.
Swallowed exception (empty catch) upstream/actions/jdx/mr-boxington-action/src/index.ts:210— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:69— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:367— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:737— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:131— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:32— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:50— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:54— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:105— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:217— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:238— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:303— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) upstream/actions/Swatinem/rust-cache/src/config.ts:385— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) upstream/actions/Swatinem/rust-cache/src/restore.ts:55— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) upstream/actions/Swatinem/rust-cache/src/save.ts:98— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/node_suite_run.py:141— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/package_bench.py:226— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/update-actions.mts:214— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/wasi_acceptance/wasm_eh_managed.ts:14— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/wasi_acceptance/wasm_eh_managed.ts:21— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/wasi_acceptance/wasm_eh_managed.ts:25— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/wasi_acceptance/wasm_eh_managed.ts:29— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/wasi_acceptance/wasm_eh_managed.ts:34— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/wasi_acceptance/wasm_eh_roots.ts:21— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) scripts/turnloop/server_ab.py:544— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
No assertions: injects path properly for case #${index} upstream/actions/actions/configure-pages/src/config-parser.test.js:279— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: injects path properly for ${staticSiteGenerator} in ${configurationFile} to default configuration file upstream/actions/actions/configure-pages/src/set-pages-config.test.js:49— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: injects path properly for ${staticSiteGenerator} in ${configurationFile} to specified *${fileExtension} configuration file upstream/actions/actions/configure-pages/src/set-pages-config.test.js:82— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: context helpers test-parity/node-suite/test/runner/context.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: async callback test-parity/node-suite/test/runner/registration/async-callback.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: (unnamed test) test-parity/node-suite/test/runner/registration/callback-overloads.ts:11— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: name-options-callback test-parity/node-suite/test/runner/registration/callback-overloads.ts:15— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: callback completion test-parity/node-suite/test/runner/registration/done-callback.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: parent test-parity/node-suite/test/runner/registration/nested-subtests.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: parent completion test-parity/node-suite/test/runner/registration/parent-child-completion.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: nested test test-parity/node-suite/test/runner/registration/suite-nesting.ts:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: top level test-parity/node-suite/test/runner/registration/top-level-order.ts:4— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: body throws test-parity/node-suite/test/runner/hooks/after-each-after-throw.ts:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: blocked body test-parity/node-suite/test/runner/hooks/before-throw-cleanup.ts:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: throws test-parity/node-suite/test/runner/hooks/cleanup-after-throw.ts:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: hook context body test-parity/node-suite/test/runner/hooks/context-name.ts:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: ordered hooks test-parity/node-suite/test/runner/hooks/multiple-order.ts:8— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: blocked child test-parity/node-suite/test/runner/hooks/nested-before-each-throw.ts:15— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: child test-parity/node-suite/test/runner/hooks/nested-suites.ts:14— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: first test-parity/node-suite/test/runner/hooks/top-level-order.ts:8— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: second test-parity/node-suite/test/runner/hooks/top-level-order.ts:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: assertion surface test-parity/node-suite/test/runner/context/assertion-surface.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: multiple diagnostics test-parity/node-suite/test/runner/context/diagnostics-multiple.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: parent observes child failure test-parity/node-suite/test/runner/context/failure-propagation.ts:3— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: installs local mock test-parity/node-suite/test/runner/context/local-mock-restoration.ts:10— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Duplicated block (14 lines × 2) crates/perry-codegen-glance/src/emit.rs:464— crates/perry-codegen-glance/src/emit.rs:464-477 | crates/perry-codegen-swiftui/src/emit.rs:904-917 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-swiftui/src/emit.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen-glance/src/emit.rs:582— crates/perry-codegen-glance/src/emit.rs:582-595 | crates/perry-codegen-wear-tiles/src/emit.rs:402-415 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen-js/src/minify.rs:217— crates/perry-codegen-js/src/minify.rs:217-230 | crates/perry-codegen-wasm/src/minify.rs:213-226 — before extracting anything, compare `crates/perry-codegen-js/src/minify.rs` and `crates/perry-codegen-wasm/src/minify.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/codegen/class_artifacts.rs:356— crates/perry-codegen/src/codegen/class_artifacts.rs:356-370 | crates/perry-codegen/src/codegen/class_artifacts.rs:579-592 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/closure.rs:1343— crates/perry-codegen/src/codegen/closure.rs:1343-1356 | crates/perry-codegen/src/codegen/method.rs:734-747 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/perry-codegen/src/codegen/function.rs:261— crates/perry-codegen/src/codegen/function.rs:261-274 | crates/perry-codegen/src/codegen/method_trampolines.rs:60-73 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_trampolines.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/perry-codegen/src/codegen/method.rs:639— crates/perry-codegen/src/codegen/method.rs:639-652 | crates/perry-codegen/src/codegen/method_static.rs:314-327 — before extracting anything, compare `crates/perry-codegen/src/codegen/method.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/perry-codegen/src/codegen/split_regions_facts.rs:12— crates/perry-codegen/src/codegen/split_regions_facts.rs:12-25 | crates/perry-hir/src/lower/shared_mutable_capture.rs:780-793 — before extracting anything, compare `crates/perry-codegen/src/codegen/split_regions_facts.rs` and `crates/perry-hir/src/lower/shared_mutable_capture.rs` as WHOLE FILES: this scan already matched 3 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 (14 lines × 2) crates/perry-codegen/src/codegen/string_pool.rs:902— crates/perry-codegen/src/codegen/string_pool.rs:902-915 | crates/perry-codegen/src/codegen/string_pool.rs:936-949 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/escape_check.rs:662— crates/perry-codegen/src/collectors/escape_check.rs:662-675 | crates/perry-codegen/src/collectors/escape_news.rs:525-538 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/escape_news.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/perry-codegen/src/expr/arrays_finds.rs:1181— crates/perry-codegen/src/expr/arrays_finds.rs:1181-1194 | crates/perry-codegen/src/expr/arrays_finds.rs:1276-1289 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/member_update.rs:167— crates/perry-codegen/src/expr/member_update.rs:167-180 | crates/perry-codegen/src/expr/member_update.rs:186-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/perry-codegen/src/expr/property_get/helpers.rs:217— crates/perry-codegen/src/expr/property_get/helpers.rs:217-230 | crates/perry-codegen/src/expr/property_get/helpers.rs:293-306 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/proven_view_access.rs:350— crates/perry-codegen/src/expr/proven_view_access.rs:350-363 | crates/perry-codegen/src/expr/proven_view_access.rs:649-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/perry-codegen/src/expr/u8_buffer_read.rs:149— crates/perry-codegen/src/expr/u8_buffer_read.rs:149-162 | crates/perry-codegen/src/expr/u8_buffer_read.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/perry-codegen/src/native_value/verify/abi.rs:328— crates/perry-codegen/src/native_value/verify/abi.rs:328-341 | crates/perry-codegen/src/native_value/verify/abi.rs:392-405 — both copies are in the same file, so extract the block into 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/perry-codegen/src/type_analysis/predicates.rs:562— crates/perry-codegen/src/type_analysis/predicates.rs:562-575 | crates/perry-codegen/src/type_analysis/refine.rs:602-615 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/perry-component-host/src/async_values/compose.rs:153— crates/perry-component-host/src/async_values/compose.rs:153-166 | crates/perry-component-host/src/async_values/compose.rs:193-206 — both copies are in the same file, so extract the block into 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/perry-ext-ws/src/lib.rs:1630— crates/perry-ext-ws/src/lib.rs:1630-1643 | crates/perry-ext-ws/src/lib.rs:1722-1735 — both copies are in the same file, so extract the block into 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/perry-hir/src/destructuring/assignment_stmt.rs:272— crates/perry-hir/src/destructuring/assignment_stmt.rs:272-285 | crates/perry-hir/src/destructuring/pattern_binding.rs:160-173 — before extracting anything, compare `crates/perry-hir/src/destructuring/assignment_stmt.rs` and `crates/perry-hir/src/destructuring/pattern_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/perry-hir/src/lower/expr_call/globals.rs:290— crates/perry-hir/src/lower/expr_call/globals.rs:290-303 | crates/perry-hir/src/lower/expr_call/globals.rs:393-406 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_function.rs:1324— crates/perry-hir/src/lower/expr_function.rs:1324-1337 | crates/perry-hir/src/lower_decl/block.rs:841-854 — 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/perry-hir/src/lower/expr_member.rs:553— crates/perry-hir/src/lower/expr_member.rs:553-566 | crates/perry-hir/src/lower/expr_member.rs:679-692 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/stmt_loops/for_await_targets.rs:26— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:26-39 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:26-39 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/monomorph/constraints.rs:192— crates/perry-hir/src/monomorph/constraints.rs:192-205 | crates/perry-hir/src/monomorph/constraints.rs:219-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.
Duplicated block (6 lines × 3) crates/perry-codegen/src/builtin_proto.rs:212— crates/perry-codegen/src/builtin_proto.rs:212-217 | crates/perry-codegen/src/expr/literals_vars.rs:857-862 | crates/perry-codegen/src/expr/literals_vars.rs:1111-1116 — before extracting anything, compare `crates/perry-codegen/src/builtin_proto.rs` and `crates/perry-codegen/src/expr/literals_vars.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen/src/codegen/method_trampolines.rs:160— crates/perry-codegen/src/codegen/method_trampolines.rs:160-165 | crates/perry-codegen/src/codegen/method_trampolines.rs:268-273 | crates/perry-codegen/src/codegen/method_trampolines.rs:431-436 — 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/perry-codegen/src/collectors/i32_locals.rs:128— crates/perry-codegen/src/collectors/i32_locals.rs:128-139 | crates/perry-codegen/src/collectors/integer_locals.rs:820-825 | crates/perry-codegen/src/collectors/integer_locals.rs:1147-1153 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/integer_locals.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:187— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:187-192 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:462-467 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:509-514 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_kdf.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-codegen/src/expr/child_proc.rs:277— crates/perry-codegen/src/expr/child_proc.rs:277-282 | crates/perry-codegen/src/expr/child_proc.rs:337-342 | crates/perry-codegen/src/expr/child_proc.rs:360-368 — 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/perry-codegen/src/expr/family_slot.rs:279— crates/perry-codegen/src/expr/family_slot.rs:279-284 | crates/perry-codegen/src/expr/folded_builtin_override.rs:851-856 | crates/perry-codegen/src/lower_call/early_branches.rs:534-539 — before extracting anything, compare `crates/perry-codegen/src/expr/family_slot.rs` and `crates/perry-codegen/src/expr/folded_builtin_override.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 (6 lines × 3) crates/perry-codegen/src/expr/i32_fast_path.rs:618— crates/perry-codegen/src/expr/i32_fast_path.rs:618-623 | crates/perry-codegen/src/expr/ta_param_f64_read.rs:123-128 | crates/perry-codegen/src/expr/u8_buffer_read.rs:47-52 — before extracting anything, compare `crates/perry-codegen/src/expr/i32_fast_path.rs` and `crates/perry-codegen/src/expr/ta_param_f64_read.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-codegen/src/expr/index_get.rs:334— crates/perry-codegen/src/expr/index_get.rs:334-339 | crates/perry-codegen/src/expr/property_get.rs:1415-1420 | crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:479-484 — 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/perry-codegen/src/expr/layout_read.rs:801— crates/perry-codegen/src/expr/layout_read.rs:801-807 | crates/perry-codegen/src/expr/property_get.rs:536-541 | crates/perry-codegen/src/expr/typed_array_rmw.rs:296-301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/perry-codegen/src/expr/static_field_meta.rs:35— crates/perry-codegen/src/expr/static_field_meta.rs:35-40 | crates/perry-codegen/src/expr/static_field_meta.rs:470-475 | crates/perry-codegen/src/lower_call/scalar_method.rs:670-675 — 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/perry-codegen/src/expr/static_method.rs:507— crates/perry-codegen/src/expr/static_method.rs:507-512 | crates/perry-codegen/src/lower_array_method.rs:1212-1217 | crates/perry-codegen/src/lower_call/property_get/builtin_kind_guard.rs:309-314 — 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/perry-codegen/src/lower_call/builtin.rs:223— crates/perry-codegen/src/lower_call/builtin.rs:223-228 | crates/perry-codegen/src/lower_call/builtin.rs:259-264 | crates/perry-codegen/src/lower_call/builtin.rs:277-282 — 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/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:302— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:302-307 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:669-676 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:707-715 — 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/perry-ext-http/src/client_events.rs:190— crates/perry-ext-http/src/client_events.rs:190-195 | crates/perry-ext-http/src/client_events.rs:614-619 | crates/perry-ext-http/src/client_events.rs:680-685 — 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/perry-ext-http/src/client_events.rs:347— crates/perry-ext-http/src/client_events.rs:347-352 | crates/perry-ext-http/src/client_events.rs:596-601 | crates/perry-ext-http/src/client_events.rs:664-669 — 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/perry-hir/src/destructuring/pattern_binding.rs:586— crates/perry-hir/src/destructuring/pattern_binding.rs:586-591 | crates/perry-hir/src/lower/stmt.rs:296-301 | crates/perry-hir/src/lower/stmt.rs:360-365 — before extracting anything, compare `crates/perry-hir/src/destructuring/pattern_binding.rs` and `crates/perry-hir/src/lower/stmt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-hir/src/lower/expr_call/globals.rs:745— crates/perry-hir/src/lower/expr_call/globals.rs:745-751 | crates/perry-hir/src/lower/expr_call/module_static.rs:322-328 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:709-714 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:202— crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:202-207 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:131-136 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:513-518 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:224— crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:224-229 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:153-158 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:733-738 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:242— crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:242-247 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:171-176 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:763-768 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:53— crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:53-59 | crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:378-384 | crates/perry-hir/src/lower/expr_call/intrinsics/native_arena.rs:300-305 — 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/perry-hir/src/lower/expr_call/native_module/object_statics.rs:19— crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:19-24 | crates/perry-hir/src/lower/expr_member/member_tail.rs:537-542 | crates/perry-hir/src/lower/expr_member/member_tail.rs:572-577 — 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/perry-hir/src/lower/expr_member/member_tail.rs:717— crates/perry-hir/src/lower/expr_member/member_tail.rs:717-722 | crates/perry-hir/src/lower/expr_member/member_tail.rs:724-729 | crates/perry-hir/src/lower/expr_member/member_tail.rs:731-736 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/perry-hir/src/lower/expr_new.rs:1160— crates/perry-hir/src/lower/expr_new.rs:1160-1165 | crates/perry-hir/src/lower/expr_new.rs:1258-1263 | crates/perry-hir/src/lower/expr_new/helpers.rs:304-309 — 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/perry-codegen/src/expr/dispatch.rs:794— crates/perry-codegen/src/expr/dispatch.rs:794-799 | crates/perry-codegen/src/expr/ic_fast_split.rs:93-99 | crates/perry-codegen/src/expr/unary.rs:72-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 all 3 call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/perry-codegen/src/collectors/definite_init.rs:271— crates/perry-codegen/src/collectors/definite_init.rs:271-285 | crates/perry-hir/src/analysis/fn_infer.rs:694-708 — 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 (15 lines × 2) crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:1360— crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:1360-1374 | crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:1600-1614 — both copies are in the same file, so extract the block into 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/perry-codegen/src/dialect/mod.rs:1735— crates/perry-codegen/src/dialect/mod.rs:1735-1749 | crates/perry-codegen/src/dialect/mod.rs:1800-1814 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/array_literal.rs:457— crates/perry-codegen/src/expr/array_literal.rs:457-471 | crates/perry-codegen/src/expr/array_literal.rs:515-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/perry-codegen/src/expr/bigint_set.rs:128— crates/perry-codegen/src/expr/bigint_set.rs:128-142 | crates/perry-codegen/src/expr/math_simple.rs:253-267 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/perry-codegen/src/expr/byte_cell.rs:245— crates/perry-codegen/src/expr/byte_cell.rs:245-259 | crates/perry-codegen/src/expr/byte_cell.rs:471-485 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/url_main.rs:443— crates/perry-codegen/src/expr/url_main.rs:443-457 | crates/perry-codegen/src/expr/url_main.rs:472-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.
Duplicated block (15 lines × 2) crates/perry-codegen/src/native_value/verify/abi.rs:304— crates/perry-codegen/src/native_value/verify/abi.rs:304-318 | crates/perry-codegen/src/native_value/verify/abi.rs:368-382 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/region_loop/bare.rs:130— crates/perry-codegen/src/stmt/region_loop/bare.rs:130-144 | crates/perry-codegen/src/stmt/region_loop/verify.rs:62-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 (15 lines × 2) crates/perry-ext-http/src/client_events.rs:738— crates/perry-ext-http/src/client_events.rs:738-752 | crates/perry-ext-http/src/client_events.rs:770-784 — both copies are in the same file, so extract the block into 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/perry-ext-http/src/client_turnloop/native_client.rs:577— crates/perry-ext-http/src/client_turnloop/native_client.rs:577-591 | crates/perry-ext-http/src/server/turnloop_serve/conn.rs:273-287 — 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 (15 lines × 2) crates/perry-ext-http/src/server/http2_server/dispatch.rs:376— crates/perry-ext-http/src/server/http2_server/dispatch.rs:376-390 | crates/perry-ext-http/src/server/https_server.rs:523-537 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/perry-ext-http/src/server/turnloop_serve/wire.rs:206— crates/perry-ext-http/src/server/turnloop_serve/wire.rs:206-220 | crates/perry-http-server/src/wire.rs:206-220 — before extracting anything, compare `crates/perry-ext-http/src/server/turnloop_serve/wire.rs` and `crates/perry-http-server/src/wire.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/analysis.rs:550— crates/perry-hir/src/analysis.rs:550-564 | crates/perry-hir/src/lower_decl/class_captures.rs:75-89 — 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 (15 lines × 2) crates/perry-hir/src/destructuring/pattern_binding.rs:237— crates/perry-hir/src/destructuring/pattern_binding.rs:237-251 | crates/perry-hir/src/destructuring/pattern_binding.rs:292-306 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_call/globals.rs:831— crates/perry-hir/src/lower/expr_call/globals.rs:831-845 | crates/perry-hir/src/lower/expr_call/module_static.rs:224-238 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:20— crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:20-35 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:172-186 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/local_array_methods.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/perry-hir/src/lower/expr_call/module_class_static.rs:70— crates/perry-hir/src/lower/expr_call/module_class_static.rs:70-84 | crates/perry-hir/src/lower/expr_call/native_module/imported_module_dispatch.rs:209-223 — 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 (15 lines × 2) crates/perry-hir/src/lower/expr_object.rs:1454— crates/perry-hir/src/lower/expr_object.rs:1454-1468 | crates/perry-hir/src/lower/expr_object.rs:1684-1698 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/module_decl.rs:1434— crates/perry-hir/src/lower/module_decl.rs:1434-1448 | crates/perry-hir/src/lower/module_decl.rs:1556-1570 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/stmt.rs:888— crates/perry-hir/src/lower/stmt.rs:888-902 | crates/perry-hir/src/lower/stmt.rs:905-919 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/stmt_loops.rs:690— crates/perry-hir/src/lower/stmt_loops.rs:690-704 | crates/perry-hir/src/lower_decl/body_stmt.rs:1433-1447 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower/stmt_loops.rs:1819— crates/perry-hir/src/lower/stmt_loops.rs:1819-1833 | crates/perry-hir/src/lower_decl/body_stmt.rs:2299-2313 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/expr/this_super_call.rs:854— crates/perry-codegen/src/expr/this_super_call.rs:854-875 | crates/perry-codegen/src/expr/this_super_call.rs:1373-1387 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/mod.rs:4520— crates/perry-codegen/src/expr/mod.rs:4520-4534 | crates/perry-codegen/src/expr/mod.rs:4542-4557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Model::apply_inner (cyclomatic 303) crates/perry-wpfacts/src/solve/apply.rs:4— Model::apply_inner has cyclomatic complexity 303 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Model::store_into (cyclomatic 88) crates/perry-wpfacts/src/solve/store.rs:276— Model::store_into has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Model::escape (cyclomatic 40) crates/perry-wpfacts/src/solve/call_and_construct.rs:776— Model::escape 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.
Model::solve (cyclomatic 36) crates/perry-wpfacts/src/solve.rs:396— Model::solve 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. This is NOT this file's highest cyclomatic complexity: Model::cons_line (cyclomatic 67) 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.
Model::build (cyclomatic 31) crates/perry-codegen/src/collectors/definite_init.rs:481— Model::build has cyclomatic complexity 31 (threshold 15). Of this number, 30 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.
Model::dump_meta (cyclomatic 31) crates/perry-wpfacts/src/model/operations.rs:252— Model::dump_meta 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.
Model::publish_class (cyclomatic 31) crates/perry-wpfacts/src/solve/call_and_construct.rs:1114— Model::publish_class 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.
Model::add_tokens (cyclomatic 27) crates/perry-wpfacts/src/solve.rs:34— Model::add_tokens has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Model::cons_line (cyclomatic 67) 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.
Model::settle_keyed_uses (cyclomatic 26) crates/perry-wpfacts/src/model/operations.rs:753— Model::settle_keyed_uses 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.
Model::store_out_arg_reach (cyclomatic 26) crates/perry-wpfacts/src/solve.rs:1459— Model::store_out_arg_reach 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. This is NOT this file's highest cyclomatic complexity: Model::cons_line (cyclomatic 67) 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.
Model::load_from (cyclomatic 25) crates/perry-wpfacts/src/solve/lookup.rs:8— Model::load_from 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.
Model::summarize_and_replay (cyclomatic 24) crates/perry-wpfacts/src/summary.rs:1836— Model::summarize_and_replay 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. This is NOT this file's highest cyclomatic complexity: perry_wpfacts::summary::map_cons (cyclomatic 67) 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.
Model::admit_this (cyclomatic 22) crates/perry-wpfacts/src/solve.rs:1243— Model::admit_this has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Model::cons_line (cyclomatic 67) 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.
Model::expr (cyclomatic 21) crates/perry-codegen/src/collectors/repsel_benefit.rs:248— Model::expr has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Model::instance (cyclomatic 21) crates/perry-wpfacts/src/summary.rs:818— Model::instance has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: perry_wpfacts::summary::map_cons (cyclomatic 67) 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.
Model::escape_summarized (cyclomatic 20) crates/perry-wpfacts/src/summary.rs:1734— Model::escape_summarized has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: perry_wpfacts::summary::map_cons (cyclomatic 67) 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.
Model::stmt (cyclomatic 19) crates/perry-codegen/src/collectors/repsel_benefit.rs:379— Model::stmt has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Model::bind_args (cyclomatic 19) crates/perry-wpfacts/src/solve/call_and_construct.rs:175— Model::bind_args has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Model::method_on (cyclomatic 19) crates/perry-wpfacts/src/solve/call_and_construct.rs:661— Model::method_on has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Model::wire_args (cyclomatic 19) crates/perry-wpfacts/src/summary.rs:1445— Model::wire_args has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: perry_wpfacts::summary::map_cons (cyclomatic 67) 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.
Model::escape_fn_params (cyclomatic 18) crates/perry-wpfacts/src/solve/call_and_construct.rs:1001— Model::escape_fn_params 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.
Model::fill_instance (cyclomatic 18) crates/perry-wpfacts/src/summary.rs:1329— Model::fill_instance has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: perry_wpfacts::summary::map_cons (cyclomatic 67) 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.
Model::call_tok (cyclomatic 17) crates/perry-wpfacts/src/solve/call_and_construct.rs:6— Model::call_tok 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.
Model::escape_inner (cyclomatic 17) crates/perry-wpfacts/src/solve/call_and_construct.rs:1529— Model::escape_inner 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.
Model::proto_node (cyclomatic 17) crates/perry-wpfacts/src/solve.rs:812— Model::proto_node has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Model::cons_line (cyclomatic 67) 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.
perry_ui_windows::widgets::canvas::paint_canvas (cognitive 99) crates/perry-ui-windows/src/widgets/canvas.rs:145— perry_ui_windows::widgets::canvas::paint_canvas has cognitive complexity 99 (threshold 15). Drivers by points: if/else 24 (84 pts), loops 3 (10 pts), match/switch 1 (3 pts), boolean chains 2 (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.
perry_ui_windows::layout::layout_stack (cognitive 83) crates/perry-ui-windows/src/layout.rs:41— perry_ui_windows::layout::layout_stack has cognitive complexity 83 (threshold 15). Drivers by points: if/else 36 (68 pts), boolean chains 6, loops 5 (6 pts), match/switch 2 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_windows::layout::measure_intrinsic (cognitive 79) crates/perry-ui-windows/src/layout.rs:363— perry_ui_windows::layout::measure_intrinsic has cognitive complexity 79 (threshold 15). Drivers by points: if/else 49 (78 pts), 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.
perry_ui_windows::app::wnd_proc (cognitive 67) crates/perry-ui-windows/src/app.rs:1509— perry_ui_windows::app::wnd_proc has cognitive complexity 67 (threshold 15). Drivers by points: if/else 26 (61 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 36). 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.
perry_ui_windows::app::app_run (cognitive 63) crates/perry-ui-windows/src/app.rs:618— perry_ui_windows::app::app_run has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (46 pts), match/switch 3 (9 pts), loops 3 (6 pts), boolean chains 2 (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.
perry_ui_windows::audio::start (cognitive 60) crates/perry-ui-windows/src/audio.rs:108— perry_ui_windows::audio::start has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (43 pts), match/switch 6 (8 pts), loops 3 (7 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.
perry_ui_windows::window::window_default_wnd_proc (cognitive 50) crates/perry-ui-windows/src/window.rs:47— perry_ui_windows::window::window_default_wnd_proc has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (47 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_ui_windows::widgets::handle_command (cognitive 47) crates/perry-ui-windows/src/widgets/mod.rs:849— perry_ui_windows::widgets::handle_command has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (35 pts), match/switch 6 (12 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_windows::widgets::image::image_wnd_proc (cognitive 41) crates/perry-ui-windows/src/widgets/image.rs:82— perry_ui_windows::widgets::image::image_wnd_proc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_ui_windows::state::state_set (cognitive 39) crates/perry-ui-windows/src/state.rs:155— perry_ui_windows::state::state_set has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 8 (14 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.
perry_ui_windows::widgets::paint_shadow_for_child (cognitive 38) crates/perry-ui-windows/src/widgets/mod.rs:1360— perry_ui_windows::widgets::paint_shadow_for_child has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 3, loops 2 (3 pts), 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.
perry_ui_windows::media_playback::poll_tick (cognitive 37) crates/perry-ui-windows/src/media_playback.rs:507— perry_ui_windows::media_playback::poll_tick has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (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.
perry_ui_windows::widgets::hstack::container_wnd_proc (cognitive 37) crates/perry-ui-windows/src/widgets/hstack.rs:46— perry_ui_windows::widgets::hstack::container_wnd_proc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 1, match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_ui_windows::widgets::vstack::container_wnd_proc (cognitive 37) crates/perry-ui-windows/src/widgets/vstack.rs:51— perry_ui_windows::widgets::vstack::container_wnd_proc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 1, match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_ui_windows::media_playback::set_now_playing (cognitive 32) crates/perry-ui-windows/src/media_playback.rs:264— perry_ui_windows::media_playback::set_now_playing has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_windows::widgets::scrollview::scroll_wnd_proc (cognitive 29) crates/perry-ui-windows/src/widgets/scrollview.rs:131— perry_ui_windows::widgets::scrollview::scroll_wnd_proc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 2, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_ui_windows::widgets::webview::install_navigation_handlers (cognitive 27) crates/perry-ui-windows/src/widgets/webview.rs:446— perry_ui_windows::widgets::webview::install_navigation_handlers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 3, 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.
perry_ui_windows::widgets::pdf_view::paint_pdf (cognitive 25) crates/perry-ui-windows/src/widgets/pdf_view.rs:620— perry_ui_windows::widgets::pdf_view::paint_pdf has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 2 (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.
perry_ui_windows::layout::measure_stack_intrinsic (cognitive 23) crates/perry-ui-windows/src/layout.rs:548— perry_ui_windows::layout::measure_stack_intrinsic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 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.
perry_ui_windows::pointer::dispatch_message (cognitive 21) crates/perry-ui-windows/src/pointer.rs:186— perry_ui_windows::pointer::dispatch_message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 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.
perry_ui_windows::widgets::image::fetch_url_blocking (cognitive 21) crates/perry-ui-windows/src/widgets/image.rs:476— perry_ui_windows::widgets::image::fetch_url_blocking has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 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, 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.
perry_ui_windows::theme::handle_container_message (cognitive 20) crates/perry-ui-windows/src/theme.rs:119— perry_ui_windows::theme::handle_container_message has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_windows::widgets::button::handle_draw_item (cognitive 19) crates/perry-ui-windows/src/widgets/button.rs:426— perry_ui_windows::widgets::button::handle_draw_item has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), 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.
perry_ui_windows::widgets::command_palette::refresh_filter (cognitive 19) crates/perry-ui-windows/src/widgets/command_palette.rs:104— perry_ui_windows::widgets::command_palette::refresh_filter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 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.
perry_ui_windows::app::dispatch_ui_message (cognitive 16) crates/perry-ui-windows/src/app.rs:289— perry_ui_windows::app::dispatch_ui_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (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.
Duplicated block (7 lines × 3) crates/perry-codegen-glance/src/lib.rs:71— crates/perry-codegen-glance/src/lib.rs:71-77 | crates/perry-codegen-swiftui/src/lib.rs:147-153 | crates/perry-codegen-wear-tiles/src/lib.rs:55-61 — 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/perry-codegen-wasm/src/emit/stmt.rs:95— crates/perry-codegen-wasm/src/emit/stmt.rs:95-101 | crates/perry-codegen-wasm/src/emit/stmt.rs:143-149 | crates/perry-codegen-wasm/src/emit/stmt.rs:214-220 — 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/perry-codegen/src/codegen/closure.rs:262— crates/perry-codegen/src/codegen/closure.rs:262-268 | crates/perry-codegen/src/codegen/function.rs:206-212 | crates/perry-codegen/src/codegen/method_typed.rs:221-227 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/codegen/closure.rs:314— crates/perry-codegen/src/codegen/closure.rs:314-320 | crates/perry-codegen/src/codegen/function.rs:99-105 | crates/perry-codegen/src/codegen/method_typed.rs:42-48 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/codegen/closure.rs:360— crates/perry-codegen/src/codegen/closure.rs:360-366 | crates/perry-codegen/src/codegen/function.rs:168-174 | crates/perry-codegen/src/codegen/method_typed.rs:129-135 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/codegen/closure.rs:406— crates/perry-codegen/src/codegen/closure.rs:406-412 | crates/perry-codegen/src/codegen/function.rs:133-139 | crates/perry-codegen/src/codegen/method_typed.rs:175-181 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/codegen/mod.rs:1950— crates/perry-codegen/src/codegen/mod.rs:1950-1956 | crates/perry-codegen/src/codegen/mod.rs:1963-1970 | crates/perry-codegen/src/codegen/mod.rs:1994-2000 — 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/perry-codegen/src/codegen/opts/computed_names.rs:234— crates/perry-codegen/src/codegen/opts/computed_names.rs:234-240 | crates/perry-codegen/src/collectors/anon_key_adds.rs:275-281 | crates/perry-codegen/src/collectors/param_ranges.rs:248-254 — 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/perry-codegen/src/collectors/escape_check.rs:600— crates/perry-codegen/src/collectors/escape_check.rs:600-606 | crates/perry-codegen/src/collectors/escape_objects.rs:579-585 | crates/perry-codegen/src/collectors/escape_objects.rs:595-601 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/escape_objects.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:45— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:45-51 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:132-138 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:659-665 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_kdf.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/expr/compare.rs:124— crates/perry-codegen/src/expr/compare.rs:124-130 | crates/perry-codegen/src/expr/compare.rs:503-509 | crates/perry-codegen/src/expr/compare.rs:1107-1113 — 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/perry-codegen/src/expr/element_shape_reads.rs:186— crates/perry-codegen/src/expr/element_shape_reads.rs:186-194 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:182-189 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:719-725 — before extracting anything, compare `crates/perry-codegen/src/expr/property_get/generic_dispatch.rs` and `crates/perry-codegen/src/stmt/stable_packed_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/expr/index_get/guarded_array.rs:669— crates/perry-codegen/src/expr/index_get/guarded_array.rs:669-675 | crates/perry-codegen/src/expr/private_field_site.rs:326-332 | crates/perry-codegen/src/lower_string_method.rs:333-339 — 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/perry-codegen/src/expr/instance_misc1.rs:1010— crates/perry-codegen/src/expr/instance_misc1.rs:1010-1016 | crates/perry-codegen/src/expr/logical_collections.rs:1333-1339 | crates/perry-codegen/src/expr/logical_collections.rs:1556-1562 — before extracting anything, compare `crates/perry-codegen/src/expr/instance_misc1.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/expr/misc_methods.rs:871— crates/perry-codegen/src/expr/misc_methods.rs:871-877 | crates/perry-codegen/src/expr/misc_methods.rs:889-895 | crates/perry-codegen/src/expr/misc_methods.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.
Duplicated block (7 lines × 3) crates/perry-codegen/src/expr/static_field_meta.rs:339— crates/perry-codegen/src/expr/static_field_meta.rs:339-345 | crates/perry-codegen/src/lower_call/new_helpers.rs:266-272 | crates/perry-codegen/src/lower_call/scalar_method.rs:830-836 — 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/perry-codegen/src/lower_call/builtin.rs:338— crates/perry-codegen/src/lower_call/builtin.rs:338-344 | crates/perry-codegen/src/lower_call/builtin.rs:383-389 | crates/perry-codegen/src/lower_call/builtin.rs:417-423 — 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/perry-codegen/src/lower_call/property_get/map_set.rs:346— crates/perry-codegen/src/lower_call/property_get/map_set.rs:346-352 | crates/perry-codegen/src/lower_call/property_get/map_set.rs:373-379 | crates/perry-codegen/src/lower_call/property_get/map_set.rs:407-413 — 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/perry-ext-net/src/payload_closed.rs:113— crates/perry-ext-net/src/payload_closed.rs:113-119 | crates/perry-ext-net/src/payload_server.rs:638-646 | crates/perry-ext-net/src/payload_server.rs:691-699 — before extracting anything, compare `crates/perry-ext-net/src/payload_closed.rs` and `crates/perry-ext-net/src/payload_server.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.
Duplicated block (7 lines × 3) crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:190— crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:190-196 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:119-125 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:501-507 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-hir/src/lower/expr_call/mod.rs:199— crates/perry-hir/src/lower/expr_call/mod.rs:199-205 | crates/perry-hir/src/lower/expr_call/native_module.rs:64-70 | crates/perry-hir/src/lower/expr_member.rs:76-82 — 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/perry-codegen/src/expr/bigint_set.rs:404— crates/perry-codegen/src/expr/bigint_set.rs:404-410 | crates/perry-codegen/src/expr/math_simple.rs:141-147 | crates/perry-codegen/src/native_value/pod.rs:306-312 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/perry-codegen/src/module.rs:1003— crates/perry-codegen/src/module.rs:1003-1009 | crates/perry-codegen/src/module.rs:1045-1056 | crates/perry-codegen/src/module.rs:1564-1570 — 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/perry-hir/src/lower/expr_member.rs:1247— crates/perry-hir/src/lower/expr_member.rs:1247-1253 | crates/perry-hir/src/lower/expr_member.rs:1305-1311 | crates/perry-hir/src/lower/expr_member.rs:1333-1341 — 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/perry-codegen/src/expr/compare.rs:989— crates/perry-codegen/src/expr/compare.rs:989-995 | crates/perry-codegen/src/expr/compare.rs:1004-1010 | crates/perry-codegen/src/expr/compare.rs:1022-1028 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Outbound HTTP without resilience crates/perry-codegen-js/src/web_runtime.js:3269— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/perry-codegen-wasm/src/wasm_runtime.js:1329— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/perry-codegen-wasm/src/wasm_runtime.js:1342— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/perry-codegen-wasm/src/wasm_runtime.js:2237— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/perry-codegen-wasm/src/wasm_runtime.js:2244— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/perry-codegen-wasm/src/wasm_runtime.js:4346— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:116— `http.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:163— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:166— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/check_gate_freshness.py:186— `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/_helpers/p9_rss_worker.ts:43— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:26— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/_helpers/p9_worker_gc_stress_worker.ts:31— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/_helpers/tokio_worker_agent_census_worker.ts:28— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/p6_abort_midbody.ts:82— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/p6_abort_midbody.ts:87— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:19— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:33— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:42— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:51— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/p9_thread_agent.ts:24— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/p9_thread_agent_async_refused.ts:24— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/p9_worker_agent_acceptance.ts:42— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/p9_worker_gc_stress.ts:45— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience scripts/turnloop/apps/tokio_worker_agent_census.ts:53— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
perry_wpfacts::compute_in (cyclomatic 155) crates/perry-wpfacts/src/lib.rs:266— perry_wpfacts::compute_in has cyclomatic complexity 155 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_wpfacts::units::driver::run (cyclomatic 124) crates/perry-wpfacts/src/units/driver.rs:239— perry_wpfacts::units::driver::run has cyclomatic complexity 124 (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.
perry_wpfacts::builtins::tok_load (cyclomatic 78) crates/perry-wpfacts/src/builtins.rs:559— perry_wpfacts::builtins::tok_load has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_wpfacts::decl_units::views (cyclomatic 63) crates/perry-wpfacts/src/decl_units.rs:1392— perry_wpfacts::decl_units::views 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.
perry_wpfacts::decl_units::closed (cyclomatic 60) crates/perry-wpfacts/src/decl_units.rs:809— perry_wpfacts::decl_units::closed 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.
perry_wpfacts::summary::compose::compress (cyclomatic 56) crates/perry-wpfacts/src/summary/compose.rs:290— perry_wpfacts::summary::compose::compress 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.
perry_wpfacts::builtins::ns_method (cyclomatic 54) crates/perry-wpfacts/src/builtins.rs:1331— perry_wpfacts::builtins::ns_method 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.
perry_wpfacts::lib::contracts::describe_nodes (cyclomatic 46) crates/perry-wpfacts/src/lib/contracts.rs:794— perry_wpfacts::lib::contracts::describe_nodes 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.
perry_wpfacts::decl_units::decl_units (cyclomatic 44) crates/perry-wpfacts/src/decl_units.rs:1139— perry_wpfacts::decl_units::decl_units 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.
perry_wpfacts::derive::judge (cyclomatic 42) crates/perry-wpfacts/src/derive.rs:792— perry_wpfacts::derive::judge has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_wpfacts::builtins::collections::array_method (cyclomatic 41) crates/perry-wpfacts/src/builtins/collections.rs:306— perry_wpfacts::builtins::collections::array_method has cyclomatic complexity 41 (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.
perry_wpfacts::derive::template_facts (cyclomatic 41) crates/perry-wpfacts/src/derive.rs:359— perry_wpfacts::derive::template_facts 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.
perry_wpfacts::lib::contracts::arg_contract_of (cyclomatic 41) crates/perry-wpfacts/src/lib/contracts.rs:1592— perry_wpfacts::lib::contracts::arg_contract_of 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.
perry_wpfacts::units::published_surface (cyclomatic 35) crates/perry-wpfacts/src/units.rs:954— perry_wpfacts::units::published_surface 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.
perry_wpfacts::builtins::collections::bobj_method (cyclomatic 34) crates/perry-wpfacts/src/builtins/collections.rs:518— perry_wpfacts::builtins::collections::bobj_method 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.
perry_wpfacts::lib::contracts::describe_toks (cyclomatic 34) crates/perry-wpfacts/src/lib/contracts.rs:1223— perry_wpfacts::lib::contracts::describe_toks 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.
perry_wpfacts::units::driver::unit_io (cyclomatic 28) crates/perry-wpfacts/src/units/driver.rs:1188— perry_wpfacts::units::driver::unit_io has cyclomatic complexity 28 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_wpfacts::summary::compose::expand (cyclomatic 27) crates/perry-wpfacts/src/summary/compose.rs:158— perry_wpfacts::summary::compose::expand 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.
perry_wpfacts::lib::contracts::fn_contract_of (cyclomatic 26) crates/perry-wpfacts/src/lib/contracts.rs:357— perry_wpfacts::lib::contracts::fn_contract_of 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.
perry_wpfacts::units::driver::solves (cyclomatic 26) crates/perry-wpfacts/src/units/driver.rs:44— perry_wpfacts::units::driver::solves 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.
perry_wpfacts::builtins::own_method_inner (cyclomatic 24) crates/perry-wpfacts/src/builtins.rs:1118— perry_wpfacts::builtins::own_method_inner 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.
perry_wpfacts::bindings::collect (cyclomatic 20) crates/perry-wpfacts/src/bindings.rs:273— perry_wpfacts::bindings::collect has cyclomatic complexity 20 (threshold 15). Of this number, 14 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.
perry_wpfacts::builtins::collections::function_method (cyclomatic 19) crates/perry-wpfacts/src/builtins/collections.rs:8— perry_wpfacts::builtins::collections::function_method has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
perry_wpfacts::dump::dump_text (cyclomatic 19) crates/perry-wpfacts/src/dump.rs:99— perry_wpfacts::dump::dump_text 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.
perry_wpfacts::dump::apply_sabotage (cyclomatic 19) crates/perry-wpfacts/src/dump.rs:352— perry_wpfacts::dump::apply_sabotage has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Duplicated block (8 lines × 3) crates/perry-codegen/src/codegen/closure.rs:56— crates/perry-codegen/src/codegen/closure.rs:56-63 | crates/perry-codegen/src/codegen/function.rs:238-245 | crates/perry-codegen/src/codegen/method_trampolines.rs:37-44 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-codegen/src/codegen/closure_collect.rs:247— crates/perry-codegen/src/codegen/closure_collect.rs:247-254 | crates/perry-codegen/src/codegen/closure_collect.rs:355-362 | crates/perry-codegen/src/codegen/closure_collect.rs:515-522 — 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/perry-codegen/src/collectors/class_accessors.rs:16— crates/perry-codegen/src/collectors/class_accessors.rs:16-23 | crates/perry-codegen/src/collectors/class_accessors.rs:50-57 | crates/perry-codegen/src/collectors/class_accessors.rs:82-89 — 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/perry-codegen/src/collectors/int_valued_ta_locals.rs:280— crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:280-287 | crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:357-364 | crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:414-421 — 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/perry-codegen/src/collectors/scalar_method_dispatch.rs:196— crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:196-203 | crates/perry-codegen/src/collectors/scalar_methods.rs:309-316 | crates/perry-codegen/src/collectors/scalar_methods.rs:343-350 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) crates/perry-codegen/src/expr/calls/crypto_keys.rs:17— crates/perry-codegen/src/expr/calls/crypto_keys.rs:17-24 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:105-112 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:296-303 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_keys.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 8 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-codegen/src/expr/calls/crypto_misc.rs:464— crates/perry-codegen/src/expr/calls/crypto_misc.rs:464-471 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:511-518 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:600-607 — 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/perry-codegen/src/expr/literals_vars.rs:1056— crates/perry-codegen/src/expr/literals_vars.rs:1056-1063 | crates/perry-codegen/src/expr/literals_vars.rs:1077-1084 | crates/perry-codegen/src/expr/literals_vars.rs:1166-1173 — 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/perry-codegen/src/expr/static_field_meta.rs:336— crates/perry-codegen/src/expr/static_field_meta.rs:336-343 | crates/perry-codegen/src/expr/write_barrier.rs:1178-1185 | crates/perry-codegen/src/lower_call/new_helpers.rs:263-270 — 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 (8 lines × 3) crates/perry-codegen/src/linker.rs:1516— crates/perry-codegen/src/linker.rs:1516-1523 | crates/perry-hir/src/lower/const_fold_fn.rs:116-123 | crates/perry-hir/src/lower/fn_ctor_env.rs:247-254 — before extracting anything, compare `crates/perry-hir/src/lower/const_fold_fn.rs` and `crates/perry-hir/src/lower/fn_ctor_env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:599— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:599-606 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:652-659 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:841-848 — 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/perry-ext-http/src/client_turnloop/native_client.rs:577— crates/perry-ext-http/src/client_turnloop/native_client.rs:577-584 | crates/perry-ext-http/src/server/turnloop_serve/conn.rs:273-280 | crates/perry-ext-ws/src/native_socket.rs:221-228 — 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 (8 lines × 3) crates/perry-ext-ws/src/lib.rs:1583— crates/perry-ext-ws/src/lib.rs:1583-1590 | crates/perry-ext-ws/src/lib.rs:1637-1644 | crates/perry-ext-ws/src/lib.rs:1729-1736 — 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/perry-ext-ws/src/lib.rs:1780— crates/perry-ext-ws/src/lib.rs:1780-1787 | crates/perry-ext-ws/src/lib.rs:1792-1799 | crates/perry-ext-ws/src/lib.rs:1806-1813 — 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/perry-hir/src/js_transform/imports.rs:569— crates/perry-hir/src/js_transform/imports.rs:569-576 | crates/perry-hir/src/js_transform/imports.rs:608-615 | crates/perry-hir/src/js_transform/imports.rs:649-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.
Duplicated block (8 lines × 3) crates/perry-hir/src/lower_decl/class_decl.rs:685— crates/perry-hir/src/lower_decl/class_decl.rs:685-692 | crates/perry-hir/src/lower_decl/class_members.rs:1096-1103 | crates/perry-hir/src/lower_decl/private_members.rs:408-415 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-hir/src/lower_decl/class_members.rs:530— crates/perry-hir/src/lower_decl/class_members.rs:530-537 | crates/perry-hir/src/lower_decl/private_members.rs:119-126 | crates/perry-hir/src/lower_decl/private_members.rs:334-341 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-hir/src/lower_decl/class_captures.rs:656— crates/perry-hir/src/lower_decl/class_captures.rs:656-663 | crates/perry-hir/src/lower_decl/class_captures.rs:667-674 | crates/perry-hir/src/lower_decl/class_captures.rs:675-684 — 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/perry-codegen/src/collectors/escape_arrays.rs:41— crates/perry-codegen/src/collectors/escape_arrays.rs:41-48 | crates/perry-codegen/src/collectors/escape_news.rs:123-130 | crates/perry-codegen/src/collectors/escape_objects.rs:28-35 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_arrays.rs` and `crates/perry-codegen/src/collectors/escape_objects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1069— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1069-1085 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:218-225 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:147-154 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/perry-codegen/src/codegen/typed_abi/lower.rs:298— crates/perry-codegen/src/codegen/typed_abi/lower.rs:298-305 | crates/perry-codegen/src/codegen/typed_abi/lower.rs:331-338 | crates/perry-codegen/src/codegen/typed_abi/lower.rs:467-474 — 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/perry-ext-net/src/payload_closed.rs:137— crates/perry-ext-net/src/payload_closed.rs:137-144 | crates/perry-ext-net/src/payload_pipe.rs:178-185 | crates/perry-ext-net/src/payload_server.rs:714-721 — before extracting anything, compare `crates/perry-ext-net/src/payload_closed.rs` and `crates/perry-ext-net/src/payload_server.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.
Duplicated block (8 lines × 3) crates/perry-codegen/src/expr/calls.rs:241— crates/perry-codegen/src/expr/calls.rs:241-248 | crates/perry-codegen/src/expr/calls.rs:355-362 | crates/perry-codegen/src/expr/calls.rs:368-375 — 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) scripts/addr_class_inventory.py:692— scripts/addr_class_inventory.py:692-699 | scripts/sso_unbox_inventory.py:384-391 | scripts/string_payload_access_inventory.py:243-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 all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) scripts/buffer_b1_validate.py:152— scripts/buffer_b1_validate.py:152-159 | scripts/buffer_b4_validate.py:164-171 | scripts/buffer_b5_validate.py:22-29 — before extracting anything, compare `scripts/buffer_b1_validate.py` and `scripts/buffer_b4_validate.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `scripts/buffer_b1_validate.py:152` 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.
Gen::expr_rest (cyclomatic 168) crates/perry-wpfacts/src/gen_rest.rs:136— Gen::expr_rest has cyclomatic complexity 168 (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.
Gen::expr_inner (cyclomatic 146) crates/perry-wpfacts/src/gen_expr.rs:425— Gen::expr_inner has cyclomatic complexity 146 (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.
Gen::stand_in_class (cyclomatic 53) crates/perry-wpfacts/src/gen/class_values.rs:636— Gen::stand_in_class 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.
Gen::stand_in_fn_of (cyclomatic 52) crates/perry-wpfacts/src/gen/import_values.rs:596— Gen::stand_in_fn_of has cyclomatic complexity 52 (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.
Gen::runtime_extern (cyclomatic 52) crates/perry-wpfacts/src/gen_call.rs:466— Gen::runtime_extern 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.
Gen::nested_fields (cyclomatic 49) crates/perry-wpfacts/src/gen/export.rs:1635— Gen::nested_fields 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.
Gen::runtime_glue (cyclomatic 43) crates/perry-wpfacts/src/gen/glue.rs:195— Gen::runtime_glue 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.
Gen::unit_boundary (cyclomatic 40) crates/perry-wpfacts/src/gen/export.rs:219— Gen::unit_boundary 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.
Gen::contract_check (cyclomatic 36) crates/perry-wpfacts/src/gen/export.rs:803— Gen::contract_check 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.
Gen::link_exports (cyclomatic 32) crates/perry-wpfacts/src/gen/export.rs:27— Gen::link_exports 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.
Gen::stmt_inner (cyclomatic 29) crates/perry-wpfacts/src/gen/walk.rs:532— Gen::stmt_inner 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.
Gen::walk_class (cyclomatic 26) crates/perry-wpfacts/src/gen/walk.rs:294— Gen::walk_class 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.
Gen::reports (cyclomatic 25) crates/perry-wpfacts/src/gen.rs:630— Gen::reports 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.
Gen::publish_result (cyclomatic 24) crates/perry-wpfacts/src/gen/export.rs:657— Gen::publish_result 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.
Gen::register_all (cyclomatic 23) crates/perry-wpfacts/src/gen.rs:467— Gen::register_all 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.
Gen::stand_in_value (cyclomatic 22) crates/perry-wpfacts/src/gen/class_values.rs:278— Gen::stand_in_value 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.
Gen::note_for_in_define_keys (cyclomatic 22) crates/perry-wpfacts/src/gen/for_in.rs:317— Gen::note_for_in_define_keys 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.
Gen::register_class (cyclomatic 21) crates/perry-wpfacts/src/gen.rs:1041— Gen::register_class 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.
Gen::widen_stand_in (cyclomatic 20) crates/perry-wpfacts/src/gen/class_values.rs:513— Gen::widen_stand_in 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.
Gen::const_eval (cyclomatic 20) crates/perry-wpfacts/src/gen_const.rs:38— Gen::const_eval 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.
Gen::closed_params (cyclomatic 19) crates/perry-wpfacts/src/gen/export.rs:489— Gen::closed_params 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.
Gen::compute_birth_keys (cyclomatic 19) crates/perry-wpfacts/src/gen/walk.rs:82— Gen::compute_birth_keys 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.
Gen::override_reports (cyclomatic 19) crates/perry-wpfacts/src/gen.rs:746— Gen::override_reports 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.
Gen::check_toks (cyclomatic 18) crates/perry-wpfacts/src/gen/export.rs:1129— Gen::check_toks 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.
Gen::fill_described (cyclomatic 18) crates/perry-wpfacts/src/gen/import_values.rs:412— Gen::fill_described 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.
perry_ext_http::server::handle_dispatch::js_ext_http_server_dispatch_method (cyclomatic 106) crates/perry-ext-http/src/server/handle_dispatch.rs:258— perry_ext_http::server::handle_dispatch::js_ext_http_server_dispatch_method has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ext_http::server::handle_dispatch::js_ext_http_server_response_dispatch_method (cyclomatic 53) crates/perry-ext-http/src/server/handle_dispatch.rs:875— perry_ext_http::server::handle_dispatch::js_ext_http_server_response_dispatch_method has cyclomatic complexity 53 (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.
perry_ext_http::client_request_surface::dispatch_method (cyclomatic 45) crates/perry-ext-http/src/client_request_surface.rs:616— perry_ext_http::client_request_surface::dispatch_method 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.
perry_ext_http::client_turnloop::native_client::run (cyclomatic 35) crates/perry-ext-http/src/client_turnloop/native_client.rs:221— perry_ext_http::client_turnloop::native_client::run has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ext_http::server::http2_server::pump::process_pending_h2_events (cyclomatic 34) crates/perry-ext-http/src/server/http2_server/pump.rs:169— perry_ext_http::server::http2_server::pump::process_pending_h2_events has cyclomatic complexity 34 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
perry_ext_http::server::http2_server::dispatch::js_ext_http2_session_dispatch_property (cyclomatic 27) crates/perry-ext-http/src/server/http2_server/dispatch.rs:146— perry_ext_http::server::http2_server::dispatch::js_ext_http2_session_dispatch_property 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.
perry_ext_http::agent::js_ext_http_agent_dispatch_property (cyclomatic 25) crates/perry-ext-http/src/agent.rs:857— perry_ext_http::agent::js_ext_http_agent_dispatch_property 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.
perry_ext_http::agent::agent_new_with_protocol (cyclomatic 25) crates/perry-ext-http/src/agent.rs:1017— perry_ext_http::agent::agent_new_with_protocol 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.
perry_ext_http::server::response_end::standalone_end (cyclomatic 24) crates/perry-ext-http/src/server/response_end.rs:136— perry_ext_http::server::response_end::standalone_end 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.
perry_ext_http::pending_dispatch::js_http_process_pending (cyclomatic 23) crates/perry-ext-http/src/pending_dispatch.rs:8— perry_ext_http::pending_dispatch::js_http_process_pending 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.
perry_ext_http::server::http2_server::dispatch::js_ext_http2_session_dispatch_method (cyclomatic 23) crates/perry-ext-http/src/server/http2_server/dispatch.rs:34— perry_ext_http::server::http2_server::dispatch::js_ext_http2_session_dispatch_method 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.
perry_ext_http::server::handle_dispatch::js_ext_http_server_dispatch_property (cyclomatic 22) crates/perry-ext-http/src/server/handle_dispatch.rs:635— perry_ext_http::server::handle_dispatch::js_ext_http_server_dispatch_property 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. This is NOT this file's highest cyclomatic complexity: perry_ext_http::server::handle_dispatch::js_ext_http_incoming_message_dispatch_method (cyclomatic 39) 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.
perry_ext_http::server::turnloop_serve::conn::decode_step (cyclomatic 22) crates/perry-ext-http/src/server/turnloop_serve/conn.rs:492— perry_ext_http::server::turnloop_serve::conn::decode_step 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.
perry_ext_http::client_turnloop::protocol::process (cyclomatic 20) crates/perry-ext-http/src/client_turnloop/protocol.rs:385— perry_ext_http::client_turnloop::protocol::process 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.
perry_ext_http::validation::validate_client_options (cyclomatic 19) crates/perry-ext-http/src/validation.rs:48— perry_ext_http::validation::validate_client_options 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.
perry_ext_http::agent::release_request (cyclomatic 18) crates/perry-ext-http/src/agent.rs:695— perry_ext_http::agent::release_request 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.
perry_ext_http::server::turnloop_h2::conn::pump (cyclomatic 18) crates/perry-ext-http/src/server/turnloop_h2/conn.rs:893— perry_ext_http::server::turnloop_h2::conn::pump 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.
perry_ext_http::server::turnloop_h2::stream::pump_outbox (cyclomatic 18) crates/perry-ext-http/src/server/turnloop_h2/stream.rs:719— perry_ext_http::server::turnloop_h2::stream::pump_outbox 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.
perry_ext_http::server::http2_server::dispatch::js_ext_http2_stream_dispatch_method (cyclomatic 17) crates/perry-ext-http/src/server/http2_server/dispatch.rs:230— perry_ext_http::server::http2_server::dispatch::js_ext_http2_stream_dispatch_method 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.
perry_ext_http::client_events::handle_response_event (cyclomatic 16) crates/perry-ext-http/src/client_events.rs:253— perry_ext_http::client_events::handle_response_event 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.
perry_ext_http::root_scanner::scan_http_roots (cyclomatic 16) crates/perry-ext-http/src/root_scanner.rs:7— perry_ext_http::root_scanner::scan_http_roots 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.
perry_ext_http::server::scan_http_server_roots (cyclomatic 16) crates/perry-ext-http/src/server/mod.rs:128— perry_ext_http::server::scan_http_server_roots has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
perry_ext_http::server::dispatch_ext::http_server_method_dispatch_ext (cyclomatic 16) crates/perry-ext-http/src/server/dispatch_ext.rs:348— perry_ext_http::server::dispatch_ext::http_server_method_dispatch_ext has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (perry_ext_http::server::dispatch_ext::http_server_property_dispatch_ext) 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.
perry_ext_http::server::dispatch_ext::http_server_property_dispatch_ext (cyclomatic 16) crates/perry-ext-http/src/server/dispatch_ext.rs:416— perry_ext_http::server::dispatch_ext::http_server_property_dispatch_ext has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (perry_ext_http::server::dispatch_ext::http_server_method_dispatch_ext) 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.
perry_ext_http::server::server::process_pending (cyclomatic 16) crates/perry-ext-http/src/server/server.rs:1231— perry_ext_http::server::server::process_pending 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.
Change coupling: masked_window.rs ↔ loops.rs crates/perry-codegen/src/expr/masked_window.rs:1— `crates/perry-codegen/src/expr/masked_window.rs` and `crates/perry-codegen/src/stmt/loops.rs` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `ff0b9919` perf: array read-modify-write in multi-statement loops takes the dens…; `0f70a367` refactor(codegen): route packed receiver hoists through region descri…; `0a164730` perf(codegen): packed-clone endgame — receiver caching, poll striding… — run `git show` on any of them.
Change coupling: native_runtime_branch.rs ↔ iterator_record.rs crates/perry-codegen/src/lower_call/native/native_runtime_branch.rs:1— `crates/perry-codegen/src/lower_call/native/native_runtime_branch.rs` and `crates/perry-hir/src/iterator_record.rs` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `7f74d17c` Release the transferred record payload once and preserve completion t…; `0fd36b9f` Use one private payload for array and protocol records; `8a25bf23` Admit the packed-f64 loop beside the record entry proof — run `git show` on any of them.
Change coupling: callable_export_check.rs ↔ module_keys.rs crates/perry-runtime/src/object/native_module/callable_export_check.rs:1— `crates/perry-runtime/src/object/native_module/callable_export_check.rs` and `crates/perry-runtime/src/object/native_module/module_keys.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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 11 shared commits counted here, the most recent 3 are `f9138a57` feat(bun): Bun.sleep and Bun.sleepSync; `91059fe2` feat: expose Perry heap statistics through bun:jsc; `86878744` feat(bun): add TCP socket facades — run `git show` on any of them.
Change coupling: node_core.rs ↔ native_module_dispatch.rs crates/perry-codegen/src/lower_call/native_table/node_core.rs:1— `crates/perry-codegen/src/lower_call/native_table/node_core.rs` and `crates/perry-runtime/src/object/native_module_dispatch.rs` change together 76% of the time (28 of the 37 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 28 shared commits counted here, the most recent 3 are `2c4fe681` [codex] Add node:module CommonJS internals (#4203); `e624f929` [codex] expose node:sea outside SEA (#4184); `1e830a1c` [codex] console: expose context and createTask helpers (#4145) — run `git show` on any of them.
Change coupling: REDACTED ↔ typedarray_view.rs crates/perry-runtime/src/typedarray/mod.rs:1— `crates/perry-runtime/src/typedarray/mod.rs` and `crates/perry-runtime/src/typedarray_view.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 9 shared commits counted here, the most recent 3 are `2c238044` Root typed-array byte copies and retire symbol payload screens; `2724261c` Speed up numeric typed-array element reads; `748cefbb` perf(typedarray): the header says where elements live, not a global v… — run `git show` on any of them.
Change coupling: concat_reverse.rs ↔ immutable.rs crates/perry-runtime/src/array/concat_reverse.rs:1— `crates/perry-runtime/src/array/concat_reverse.rs` and `crates/perry-runtime/src/array/immutable.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `f8d0166e` fix(runtime): make a pre-sized array's range addressable before fill …; `5dbb7b39` feat(runtime): maintain the dense prefix of the element-kind word; `0d7fe21b` fix(array): ask the typed-array question before clean_arr_ptr rejects… — run `git show` on any of them.
Change coupling: node_core.rs ↔ native_module.rs crates/perry-codegen/src/lower_call/native_table/node_core.rs:1— `crates/perry-codegen/src/lower_call/native_table/node_core.rs` and `crates/perry-runtime/src/object/native_module.rs` change together 70% of the time (26 of the 37 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 26 shared commits counted here, the most recent 3 are `2c4fe681` [codex] Add node:module CommonJS internals (#4203); `e624f929` [codex] expose node:sea outside SEA (#4184); `1e830a1c` [codex] console: expose context and createTask helpers (#4145) — run `git show` on any of them.
Change coupling: math_simple.rs ↔ strings.rs crates/perry-codegen/src/expr/math_simple.rs:1— `crates/perry-codegen/src/expr/math_simple.rs` and `crates/perry-codegen/src/runtime_decls/strings.rs` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `6925754a` fix(codegen): run field initializers at native-base super() and guard…; `cafc6d1c` fix(runtime): test262 built-ins value/throw bugs — primitive brand, v…; `d68453dd` [codex] fix existing Math API parity (#5170) — run `git show` on any of them.
Change coupling: nm_install.rs ↔ objects.rs crates/perry-codegen/src/nm_install.rs:1— `crates/perry-codegen/src/nm_install.rs` and `crates/perry-codegen/src/runtime_decls/objects.rs` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 10 shared commits counted here, the most recent 3 are `addf463c` One routed-module decision for linking and codegen; `db711f0f` Install zlib provider metadata before constructors and preserve gener…; `ec3c29be` fix(runtime): link built-in constructor prototypes and inherit their … — run `git show` on any of them.
Change coupling: lib.rs ↔ stdlib_features.rs crates/perry-stdlib/src/lib.rs:1— `crates/perry-stdlib/src/lib.rs` and `crates/perry/src/commands/stdlib_features.rs` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 9 shared commits counted here, the most recent 3 are `02212d46` Remove unused perry-ext-streams crate; `e97c3f67` stdlib: split the promise bridge from the tokio runtime (turnloop P8 …; `7b47239d` refactor(stdlib): remove nanoid native binding — run `git show` on any of them.
Change coupling: field_get_set.rs ↔ has_own_helpers.rs crates/perry-runtime/src/object/field_get_set.rs:1— `crates/perry-runtime/src/object/field_get_set.rs` and `crates/perry-runtime/src/object/has_own_helpers.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0eccf792` fix(buffer): ask the receiver-kind question above the byte and toLoca…; `731a2f4f` fix(runtime): honor JSON reviver prototype lookups (#4665); `e08e3d47` fix(runtime): array boundary-index, sparse length, and non-integer ke… — run `git show` on any of them.
Change coupling: REDACTED ↔ block_skip.rs crates/perry-runtime/src/arena/mod.rs:1— `crates/perry-runtime/src/arena/mod.rs` and `crates/perry-runtime/src/gc/trace/block_skip.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 6 shared commits counted here, the most recent 3 are `f80ec62f` perf(gc): remember old-to-young edges during full marking; `8b55a2ae` perf(runtime): move Map indexes and storage into owned MapStore; `321d1673` gc: expand a described promoted page only where a full's sweep reshap… — run `git show` on any of them.
Change coupling: dispatch.rs ↔ x509.rs crates/perry-stdlib/src/common/dispatch.rs:1— `crates/perry-stdlib/src/common/dispatch.rs` and `crates/perry-stdlib/src/crypto/x509.rs` change together 59% of the time (10 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 10 shared commits counted here, the most recent 3 are `2dab26cb` fix(crypto): expose x509 issuerCertificate surface (#4309); `b79e2771` fix(crypto): check x509 issuers (#4306); `dfc1cdf9` fix(crypto): check x509 private keys (#4303) — run `git show` on any of them.
Change coupling: media.rs ↔ stdlib_ffi.rs crates/perry-codegen/src/lower_call/native_table/media.rs:1— `crates/perry-codegen/src/lower_call/native_table/media.rs` and `crates/perry-codegen/src/runtime_decls/stdlib_ffi.rs` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `b3ff10c4` feat(sharp): AVIF encode (.avif) + quality-aware JPEG/AVIF encoding (…; `4a73b0e6` feat(sharp): EXIF auto-orient, .extend(), .trim(), .composite() (#5455); `24389a78` feat(sharp): metadata/toFile objects, Buffer-input factory, .extract(… — run `git show` on any of them.
Change coupling: callbacks.rs ↔ fs_promises.rs crates/perry-runtime/src/fs/callbacks.rs:1— `crates/perry-runtime/src/fs/callbacks.rs` and `crates/perry-runtime/src/node_submodules/fs_promises.rs` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `3c7696c6` fix(fs): preserve async write-unlink ordering (#9574); `b13a2009` fix: the event loop looks before it sleeps (#9441); async fs writes a…; `9a567aa1` fix(fs): appendFile must report failure, not resolve; writeFileSync m… — run `git show` on any of them.
Change coupling: escape_news.rs ↔ i32_locals.rs crates/perry-codegen/src/collectors/escape_news.rs:1— `crates/perry-codegen/src/collectors/escape_news.rs` and `crates/perry-codegen/src/collectors/i32_locals.rs` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 9 shared commits counted here, the most recent 3 are `77ea1791` fix(hir,codegen): instanceof RHS (ty_expr) was invisible to analysis …; `d68453dd` [codex] fix existing Math API parity (#5170); `ab4794e3` feat(runtime): async-from-sync iterator adapter (#4590) — run `git show` on any of them.
Change coupling: escape_check.rs ↔ i32_locals.rs crates/perry-codegen/src/collectors/escape_check.rs:1— `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/i32_locals.rs` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 9 shared commits counted here, the most recent 3 are `77ea1791` fix(hir,codegen): instanceof RHS (ty_expr) was invisible to analysis …; `d68453dd` [codex] fix existing Math API parity (#5170); `ab4794e3` feat(runtime): async-from-sync iterator adapter (#4590) — run `git show` on any of them.
Change coupling: arrays.rs ↔ REDACTED crates/perry-codegen/src/runtime_decls/arrays.rs:1— `crates/perry-codegen/src/runtime_decls/arrays.rs` and `crates/perry-runtime/src/array/mod.rs` change together 50% of the time (31 of the 62 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 31 shared commits counted here, the most recent 3 are `2f065374` perf(generators): for-of and yield* steps allocate no IteratorResult; `c3c66b8a` fix(array): a generic Array.prototype.flatMap for non-array receivers…; `be726422` perf(generators): direct protocol entry, one-step iterator results, s… — run `git show` on any of them.
Change coupling: builtin.rs ↔ strings_part2.rs crates/perry-codegen/src/lower_call/builtin.rs:1— `crates/perry-codegen/src/lower_call/builtin.rs` and `crates/perry-codegen/src/runtime_decls/strings_part2.rs` change together 50% of the time (16 of the 32 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 16 shared commits counted here, the most recent 3 are `493f5d97` fix(fetch): preserve Request inputs and apply init overrides (#10380); `ecf5439f` fix(runtime): implement resizable ArrayBuffer (#10873); `fd082e59` fix(hir,fetch): preserve Hono response state (#8982) — run `git show` on any of them.
Change coupling: descriptors.rs ↔ has_own.rs crates/perry-runtime/src/object/descriptors.rs:1— `crates/perry-runtime/src/object/descriptors.rs` and `crates/perry-runtime/src/object/object_ops/has_own.rs` change together 50% of the time (10 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 10 shared commits counted here, the most recent 3 are `d911e3c6` Functions answer through their layout; builtin prototypes stay on the…; `82cd702f` runtime: a fresh class object owns its length, name and static methods; `880e9a43` feat(runtime): class static accessors are accessor properties of the … — run `git show` on any of them.
Change coupling: part_4.rs ↔ callable_export_check.rs crates/perry-api-manifest/src/entries/part_4.rs:1— `crates/perry-api-manifest/src/entries/part_4.rs` and `crates/perry-runtime/src/object/native_module/callable_export_check.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f9138a57` feat(bun): Bun.sleep and Bun.sleepSync; `91059fe2` feat: expose Perry heap statistics through bun:jsc; `86878744` feat(bun): add TCP socket facades — run `git show` on any of them.
Change coupling: nested_fn_decl.rs ↔ fn_decl.rs crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:1— `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `ec5270e8` perf(hir): an unrebound parameter is the compound-assignment receiver; `5b3593e8` fix(runtime): honor sloppy function poison-pill stores (#9525); `56a7a564` fix(hir): scope class-expression capture refreshes per evaluation (#6… — run `git show` on any of them.
Change coupling: driver.rs ↔ zlib.rs crates/perry-ext-zlib/src/stream/driver.rs:1— `crates/perry-ext-zlib/src/stream/driver.rs` and `crates/perry-runtime/src/node_submodules/zlib.rs` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 5 shared commits counted here, the most recent 3 are `14919597` fix(zlib): honor decoder completion and trailing-input options (#13202); `7da477ee` fix(zlib): apply Zstd dictionaries through codec resets; `6fb246e7` fix(zlib): apply DEFLATE dictionaries in sync and stream codecs — run `git show` on any of them.
Change coupling: prototype_override.rs ↔ native_call_method.rs crates/perry-runtime/src/object/field_get_set/prototype_override.rs:1— `crates/perry-runtime/src/object/field_get_set/prototype_override.rs` and `crates/perry-runtime/src/object/native_call_method.rs` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 5 shared commits counted here, the most recent 3 are `23fad159` fix(runtime): a new F() instance reads its recorded [[Prototype]] aft…; `81652e4e` fix: preserve per-evaluation class heritage in factories; `f001b030` fix(runtime): separate user prototype override signal (#9333) — run `git show` on any of them.
Change coupling: boxed_vars.rs ↔ type_analysis.rs crates/perry-codegen/src/boxed_vars.rs:1— `crates/perry-codegen/src/boxed_vars.rs` and `crates/perry-codegen/src/type_analysis.rs` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `b4373788` Add shared HIR value type inference spine (#5314); `2db07e60` Fix Discord BigInt and root import reducers (#4946); `5b182137` fix(hir): iteration-statement protocol test262 parity (#4750) — run `git show` on any of them.
Duplicated block (9 lines × 3) crates/perry-codegen/src/codegen/reach_report.rs:269— crates/perry-codegen/src/codegen/reach_report.rs:269-277 | crates/perry-codegen/src/codegen/source_need/flow.rs:417-425 | crates/perry-codegen/src/codegen/source_need/flow.rs:501-509 — 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 (9 lines × 3) crates/perry-codegen/src/collectors/i32_locals.rs:775— crates/perry-codegen/src/collectors/i32_locals.rs:775-783 | crates/perry-codegen/src/collectors/integer_locals.rs:825-833 | crates/perry-codegen/src/collectors/integer_locals.rs:1153-1161 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/integer_locals.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/perry-codegen/src/expr/array_push.rs:214— crates/perry-codegen/src/expr/array_push.rs:214-223 | crates/perry-codegen/src/expr/array_push.rs:307-315 | crates/perry-codegen/src/expr/write_barrier.rs:523-531 — 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 (9 lines × 3) crates/perry-codegen/src/expr/env_clones.rs:250— crates/perry-codegen/src/expr/env_clones.rs:250-258 | crates/perry-codegen/src/expr/env_clones.rs:367-375 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:113-121 — 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 (9 lines × 3) crates/perry-codegen/src/expr/property_get.rs:923— crates/perry-codegen/src/expr/property_get.rs:923-931 | crates/perry-codegen/src/expr/property_get.rs:1381-1389 | crates/perry-codegen/src/expr/property_get.rs:1544-1552 — 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/perry-codegen/src/expr/u8_buffer_read.rs:158— crates/perry-codegen/src/expr/u8_buffer_read.rs:158-166 | crates/perry-codegen/src/expr/u8_buffer_read.rs:214-222 | crates/perry-codegen/src/expr/u8_buffer_read.rs:370-378 — 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/perry-codegen/src/expr/url_main.rs:169— crates/perry-codegen/src/expr/url_main.rs:169-177 | crates/perry-hir/src/walker/expr_mut.rs:1166-1174 | crates/perry-hir/src/walker/expr_ref.rs:1153-1161 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/write_barrier.rs:219— crates/perry-codegen/src/expr/write_barrier.rs:219-227 | crates/perry-codegen/src/expr/write_barrier.rs:365-373 | crates/perry-codegen/src/expr/write_barrier.rs:875-883 — 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/perry-codegen/src/layout_desc.rs:415— crates/perry-codegen/src/layout_desc.rs:415-423 | crates/perry-codegen/src/layout_desc.rs:772-780 | crates/perry-codegen/src/layout_desc.rs:1360-1368 — 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/perry-codegen/src/lower_call/extern_func.rs:1207— crates/perry-codegen/src/lower_call/extern_func.rs:1207-1215 | crates/perry-codegen/src/lower_call/extern_func.rs:1223-1231 | crates/perry-codegen/src/lower_call/extern_func.rs:1315-1323 — 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/perry-codegen/src/lower_call/new.rs:1520— crates/perry-codegen/src/lower_call/new.rs:1520-1528 | crates/perry-codegen/src/lower_call/new.rs:1563-1571 | crates/perry-codegen/src/lower_call/new_helpers.rs:422-430 — 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 (9 lines × 3) crates/perry-ext-net/src/payload_abi.rs:575— crates/perry-ext-net/src/payload_abi.rs:575-583 | crates/perry-ext-net/src/payload_abi.rs:590-598 | crates/perry-ext-net/src/payload_abi.rs:812-820 — 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/perry-hir/src/lower/const_fold_fn.rs:644— crates/perry-hir/src/lower/const_fold_fn.rs:644-652 | crates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rs:144-152 | crates/perry-hir/src/lower/fn_ctor_env.rs:154-162 — before extracting anything, compare `crates/perry-hir/src/lower/const_fold_fn.rs` and `crates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/perry-hir/src/lower/decorators.rs:420— crates/perry-hir/src/lower/decorators.rs:420-428 | crates/perry-hir/src/lower/expr_object.rs:1105-1113 | crates/perry-hir/src/lower/expr_object.rs:1512-1520 — 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 (9 lines × 3) crates/perry-hir/src/lower/eval_super_scan.rs:481— crates/perry-hir/src/lower/eval_super_scan.rs:481-489 | crates/perry-hir/src/lower/eval_super_scan.rs:492-500 | crates/perry-hir/src/lower/eval_super_scan.rs:532-540 — 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/perry-hir/src/lower/expr_call/array_only_methods.rs:233— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:233-241 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:267-275 | crates/perry-hir/src/lower_types.rs:81-89 — 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 (9 lines × 3) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:264— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:264-272 | crates/perry-hir/src/lower_types.rs:1222-1230 | crates/perry-hir/src/lower_types.rs:1285-1293 — 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 (9 lines × 3) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:945— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:945-953 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:226-234 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:155-163 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the 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/perry-hir/src/lower/expr_call/array_only_methods.rs:1238— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1238-1246 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:193-201 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:122-130 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the 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/perry-hir/src/lower/expr_call/array_only_methods.rs:1274— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1274-1282 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:204-212 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:133-141 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the 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/perry-hir/src/lower/expr_call/array_only_methods.rs:1293— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1293-1301 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:244-252 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:173-181 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the 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/perry-hir/src/lower/expr_call/array_only_methods.rs:1369— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1369-1377 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:285-293 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:214-222 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the 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/perry-hir/src/lower/expr_new/helpers.rs:299— crates/perry-hir/src/lower/expr_new/helpers.rs:299-307 | crates/perry-hir/src/lower/expr_new/non_ident.rs:176-184 | crates/perry-hir/src/lower/expr_new/non_ident.rs:243-251 — 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 (9 lines × 3) crates/perry-codegen/src/expr/method_site.rs:779— crates/perry-codegen/src/expr/method_site.rs:779-795 | crates/perry-codegen/src/expr/put_value_store_ic.rs:132-145 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1347-1355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) crates/perry-codegen/src/expr/env_clones.rs:435— crates/perry-codegen/src/expr/env_clones.rs:435-443 | crates/perry-codegen/src/expr/logical_collections.rs:1698-1710 | crates/perry-codegen/src/expr/super_method.rs:204-216 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/super_method.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
TooManyFields: FnCtx crates/perry-codegen/src/expr/mod.rs:367— TooManyFields — 279 stored fields beside 33 methods. The bar is 30 stored fields; this is 249 over it, 9.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Model crates/perry-wpfacts/src/model.rs:1086— TooManyFields — 263 stored fields beside 265 methods. The bar is 30 stored fields; this is 233 over it, 8.77× 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: RuntimeImports crates/perry-codegen-wasm/src/emit/runtime_imports.rs:10— TooManyFields — 212 stored fields. The bar is 30 stored fields; this is 182 over it, 7.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LoweringContext crates/perry-hir/src/lower/lowering_context.rs:130— TooManyFields — 198 stored fields beside 134 methods. The bar is 30 stored fields; this is 168 over it, 6.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CompilationContext crates/perry/src/commands/compile/types.rs:683— TooManyFields — 143 stored fields beside 1 method. The bar is 30 stored fields; this is 113 over it, 4.77× 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: Gen crates/perry-wpfacts/src/gen.rs:93— TooManyFields — 87 stored fields beside 215 methods. The bar is 30 stored fields; this is 57 over it, 2.90× 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: JniCache crates/perry-ui-android/src/jni_bridge.rs:24— TooManyFields — 70 stored fields. The bar is 30 stored fields; this is 40 over it, 2.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LoweringSummary crates/perry/src/commands/compile/lowering_report.rs:106— TooManyFields — 63 stored fields. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RegexDiag crates/perry-runtime/src/hot_diag.rs:173— TooManyFields — 61 stored fields beside 5 methods. The bar is 30 stored fields; this is 31 over it, 2.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.
TooManyFields: CompileArgs crates/perry/src/commands/compile/types.rs:83— TooManyFields — 60 stored fields. The bar is 30 stored fields; this is 30 over it, 2.00× 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: ComposeService crates/perry-container-compose/src/types.rs:477— TooManyFields — 52 stored fields beside 14 methods. The bar is 30 stored fields; this is 22 over it, 1.73× 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: NodeData crates/perry-ui-watchos/src/tree.rs:35— TooManyFields — 45 stored fields beside 1 method. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: BuildManifest crates/perry/src/commands/publish/server_api.rs:83— TooManyFields — 44 stored fields. The bar is 30 stored fields; this is 14 over it, 1.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Api crates/perry-runtime/src/tls/roots/macos.rs:107— TooManyFields — 42 stored fields beside 9 methods. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ProgramFacts crates/perry-wpfacts/src/lib.rs:132— TooManyFields — 42 stored fields beside 8 methods. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WasmHostOps crates/perry-abi/src/wasm_host.rs:117— TooManyFields — 41 stored fields. The bar is 30 stored fields; this is 11 over it, 1.37× 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: SocketFields crates/perry-ext-net/src/payload_transport.rs:33— TooManyFields — 39 stored fields beside 1 method. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Env crates/perry-runtime/src/node_api_host/mod.rs:162— TooManyFields — 36 stored fields beside 15 methods. The bar is 30 stored fields; this is 6 over it, 1.20× 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: Module crates/perry-hir/src/ir/module.rs:67— TooManyFields — 36 stored fields beside 2 methods. The bar is 30 stored fields; this is 6 over it, 1.20× 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: LlFunction crates/perry-codegen/src/function.rs:30— TooManyFields — 34 stored fields beside 65 methods. The bar is 30 stored fields; this is 4 over it, 1.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: ClientRequestHandle crates/perry-ext-http/src/lib.rs:374— TooManyFields — 34 stored fields. The bar is 30 stored fields; this is 4 over it, 1.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: StreamState crates/perry-runtime/src/fs/stream.rs:52— TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NativeRepRecord crates/perry-codegen/src/native_value/artifact.rs:253— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: H2Conn crates/perry-ext-http/src/server/turnloop_h2/conn.rs:207— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: GcCycleTrace crates/perry-runtime/src/gc/telemetry.rs:963— TooManyFields — 31 stored fields beside 7 methods. 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.
Duplicated block (16 lines × 2) crates/perry-codegen/src/codegen/closure.rs:996— crates/perry-codegen/src/codegen/closure.rs:996-1011 | crates/perry-codegen/src/codegen/method.rs:533-548 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/perry-codegen/src/codegen/entry.rs:943— crates/perry-codegen/src/codegen/entry.rs:943-958 | crates/perry-codegen/src/codegen/entry/module_init.rs:423-438 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/collectors/typed_locals.rs:757— crates/perry-codegen/src/collectors/typed_locals.rs:757-772 | crates/perry-codegen/src/collectors/typed_locals.rs:855-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-codegen/src/expr/native_memory.rs:246— crates/perry-codegen/src/expr/native_memory.rs:246-261 | crates/perry-codegen/src/expr/proven_view_access.rs:259-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/perry-codegen/src/expr/property_get/helpers.rs:233— crates/perry-codegen/src/expr/property_get/helpers.rs:233-248 | crates/perry-codegen/src/expr/property_get/helpers.rs:309-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-codegen/src/expr/static_method.rs:518— crates/perry-codegen/src/expr/static_method.rs:518-533 | crates/perry-codegen/src/lower_call/buffer_intrinsic.rs:503-518 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) crates/perry-ext-net/src/payload_server.rs:512— crates/perry-ext-net/src/payload_server.rs:512-527 | crates/perry-ext-net/src/payload_socket.rs:1705-1720 — before extracting anything, compare `crates/perry-ext-net/src/payload_server.rs` and `crates/perry-ext-net/src/payload_socket.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/perry-ext-net/src/payload_socket.rs:111— crates/perry-ext-net/src/payload_socket.rs:111-126 | crates/perry-ext-net/src/payload_socket.rs:519-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-ffi/src/turnloop_net.rs:933— crates/perry-ffi/src/turnloop_net.rs:933-948 | crates/perry-ffi/src/turnloop_net.rs:1587-1602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-gc-effects/src/instructions.rs:462— crates/perry-gc-effects/src/instructions.rs:462-477 | crates/perry-gc-effects/src/instructions.rs:522-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-hir/src/lower/stmt.rs:1528— crates/perry-hir/src/lower/stmt.rs:1528-1543 | crates/perry-hir/src/lower_decl/body_stmt.rs:1067-1082 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower/stmt_loops.rs:1749— crates/perry-hir/src/lower/stmt_loops.rs:1749-1764 | crates/perry-hir/src/lower_decl/body_stmt.rs:2230-2245 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:113— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:113-128 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:113-128 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower_decl/class_members.rs:667— crates/perry-hir/src/lower_decl/class_members.rs:667-682 | crates/perry-hir/src/lower_decl/fn_decl.rs:355-370 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/perry-hir/src/walker/expr_mut.rs:570— crates/perry-hir/src/walker/expr_mut.rs:570-585 | crates/perry-hir/src/walker/expr_ref.rs:567-582 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/perry-codegen/src/lower_call/property_get/number_string.rs:129— crates/perry-codegen/src/lower_call/property_get/number_string.rs:129-144 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:176-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-codegen-arkts/src/widgets/structure.rs:451— crates/perry-codegen-arkts/src/widgets/structure.rs:451-466 | crates/perry-codegen-arkts/src/widgets/structure.rs:496-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/perry-codegen/src/expr/calls/crypto_misc.rs:472— crates/perry-codegen/src/expr/calls/crypto_misc.rs:472-487 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:520-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.
Duplicated block (16 lines × 2) crates/perry-codegen/src/expr/js_runtime.rs:84— crates/perry-codegen/src/expr/js_runtime.rs:84-99 | crates/perry-codegen/src/expr/js_runtime.rs:213-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:214— android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:214-229 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/HoneEditorView.kt:214-229 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/HoneEditorView.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/HoneEditorView.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (16 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1426— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1426-1441 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2002-2017 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (16 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1463— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1463-1478 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2036-2051 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1463` 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) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1550— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1550-1565 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2123-2138 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (16 lines × 2) scripts/compiler_output_harness/verification.py:724— scripts/compiler_output_harness/verification.py:724-739 | scripts/compiler_output_harness/verification.py:1080-1095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/compiler_output_harness/verification.py:724` 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) scripts/gc_runtime_root_holders.py:600— scripts/gc_runtime_root_holders.py:600-615 | scripts/gc_runtime_root_holders.py:682-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
perry_ui_android::widgets::canvas::repaint (cognitive 71) crates/perry-ui-android/src/widgets/canvas.rs:230— perry_ui_android::widgets::canvas::repaint has cognitive complexity 71 (threshold 15). Drivers by points: if/else 17 (51 pts), loops 3 (14 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_android::widgets::image::create_file (cognitive 70) crates/perry-ui-android/src/widgets/image.rs:11— perry_ui_android::widgets::image::create_file has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (70 pts) (nesting depth added 55). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_android::widgets::add_child (cognitive 65) crates/perry-ui-android/src/widgets/mod.rs:191— perry_ui_android::widgets::add_child has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (64 pts), boolean chains 1 (nesting depth added 49). 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.
perry_ui_android::ffi::tabbar_layout::perry_ui_stack_set_distribution (cognitive 55) crates/perry-ui-android/src/ffi/tabbar_layout.rs:153— perry_ui_android::ffi::tabbar_layout::perry_ui_stack_set_distribution has cognitive complexity 55 (threshold 15). Drivers by points: if/else 9 (52 pts), loops 1 (3 pts) (nesting depth added 45). 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.
perry_ui_android::widgets::canvas::load_image (cognitive 40) crates/perry-ui-android/src/widgets/canvas.rs:699— perry_ui_android::widgets::canvas::load_image has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (40 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_android::state::state_set (cognitive 39) crates/perry-ui-android/src/state.rs:138— perry_ui_android::state::state_set has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 9 (18 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.
perry_ui_android::system::preferences_get (cognitive 39) crates/perry-ui-android/src/system.rs:177— perry_ui_android::system::preferences_get has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 9 (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.
perry_ui_android::widgets::textfield::get_string_value (cognitive 30) crates/perry-ui-android/src/widgets/textfield.rs:124— perry_ui_android::widgets::textfield::get_string_value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (30 pts) (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.
perry_ui_android::Java_com_perry_app_PerryBridge_nativeMain (cognitive 29) crates/perry-ui-android/src/lib.rs:249— perry_ui_android::Java_com_perry_app_PerryBridge_nativeMain has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 1 (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.
perry_ui_android::media_playback::poll_tick (cognitive 29) crates/perry-ui-android/src/media_playback.rs:678— perry_ui_android::media_playback::poll_tick has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_android::widgets::set_background_color (cognitive 27) crates/perry-ui-android/src/widgets/mod.rs:545— perry_ui_android::widgets::set_background_color has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (27 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_android::audio::start (cognitive 21) crates/perry-ui-android/src/audio.rs:110— perry_ui_android::audio::start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4 (5 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_android::widgets::set_width (cognitive 21) crates/perry-ui-android/src/widgets/mod.rs:916— perry_ui_android::widgets::set_width has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (21 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_android::widgets::set_hugging (cognitive 21) crates/perry-ui-android/src/widgets/mod.rs:1343— perry_ui_android::widgets::set_hugging 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.
perry_ui_android::widgets::bottom_nav::add_item (cognitive 19) crates/perry-ui-android/src/widgets/bottom_nav.rs:162— perry_ui_android::widgets::bottom_nav::add_item has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 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.
perry_ui_android::widgets::bottom_nav::set_badge (cognitive 19) crates/perry-ui-android/src/widgets/bottom_nav.rs:416— perry_ui_android::widgets::bottom_nav::set_badge has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_android::widgets::attributed_text::append (cognitive 18) crates/perry-ui-android/src/widgets/attributed_text.rs:72— perry_ui_android::widgets::attributed_text::append has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2, 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.
perry_ui_android::ws::io_thread (cognitive 18) crates/perry-ui-android/src/ws.rs:82— perry_ui_android::ws::io_thread has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (6 pts), match/switch 2 (6 pts), if/else 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_android::widgets::set_corner_radius (cognitive 17) crates/perry-ui-android/src/widgets/mod.rs:465— perry_ui_android::widgets::set_corner_radius has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (17 pts) (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.
perry_ui_android::widgets::image_gallery::add_image (cognitive 17) crates/perry-ui-android/src/widgets/image_gallery.rs:113— perry_ui_android::widgets::image_gallery::add_image has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_android::screenshot::perry_ui_screenshot_capture (cognitive 16) crates/perry-ui-android/src/screenshot.rs:14— perry_ui_android::screenshot::perry_ui_screenshot_capture has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 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.
perry_ui_android::widgets::set_height (cognitive 16) crates/perry-ui-android/src/widgets/mod.rs:982— perry_ui_android::widgets::set_height has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (16 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TooManyMethods: Model crates/perry-wpfacts/src/model.rs:1086— TooManyMethods — 265 methods, declared across 10 files: model/operations.rs (64), src/solve.rs (53), src/summary.rs (46), solve/call_and_construct.rs (34), +6 more file(s). The bar is 30 methods; this is 235 over it, 8.83× 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: Gen crates/perry-wpfacts/src/gen.rs:93— TooManyMethods — 215 methods, declared across 19 files: gen/export.rs (36), src/gen.rs (28), src/gen_expr.rs (28), gen/import_values.rs (19), +15 more file(s). The bar is 30 methods; this is 185 over it, 7.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: LoweringContext crates/perry-hir/src/lower/lowering_context.rs:130— TooManyMethods — 134 methods, declared across 5 files: lower/context.rs (116), context/construct.rs (8), lower/jump_targets.rs (5), lower/context_new.rs (3), +1 more file(s). The bar is 30 methods; this is 104 over it, 4.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LlBlock crates/perry-codegen/src/block.rs:404— TooManyMethods — 107 methods, declared across 2 files: src/block.rs (102), src/array_storage.rs (5). The bar is 30 methods; this is 77 over it, 3.57× 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: PerryBridge android-build/app/src/main/java/com/perry/app/PerryBridge.kt:46— TooManyMethods — 100 methods. The bar is 30 methods; this is 70 over it, 3.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LlModule crates/perry-codegen/src/module.rs:53— TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.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: LlFunction crates/perry-codegen/src/function.rs:30— TooManyMethods — 65 methods, declared across 2 files: src/function.rs (64), function/proof_dominance.rs (1). The bar is 30 methods; this is 35 over it, 2.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: TypeFacts crates/perry-codegen/src/collectors/hir_facts.rs:12— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× 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: ShapeRecord crates/perry-runtime/src/object/shapes_store.rs:116— TooManyMethods — 51 methods, declared across 7 files: object/shapes_store.rs (29), shapes_store/transitions.rs (11), shapes_store/extras.rs (3), object/shapes_store_symbol_presence.rs (3), +3 more file(s). The bar is 30 methods; this is 21 over it, 1.70× 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: Solver scripts/wpfacts_recompute.py:89— 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: DirectParser crates/perry-runtime/src/json/parser.rs:262— TooManyMethods — 41 methods, declared across 2 files: json/parser.rs (40), json/parser_escape_chunk.rs (1). The bar is 30 methods; this is 11 over it, 1.37× 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: JSValue crates/perry-runtime/src/value/jsvalue.rs:9— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JsEmitter crates/perry-codegen-js/src/emit/mod.rs:32— TooManyMethods — 38 methods, declared across 7 files: emit/mod.rs (17), emit/decls.rs (8), emit/calls.rs (7), emit/exprs.rs (2), +3 more file(s). 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: ShapeSlab crates/perry-runtime/src/object/shapes_store.rs:1244— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.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: RuntimeRootVisitor crates/perry-runtime/src/gc/roots.rs:915— 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: ReceiverDescriptorTable crates/perry-codegen/src/collectors/receiver_regions.rs:363— 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: TcpSocket crates/perry-wasi/src/sockets/tcp.rs:92— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× 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: AgentTimers crates/perry-runtime/src/timer/store.rs:224— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FnCtx crates/perry-codegen/src/expr/mod.rs:367— TooManyMethods — 33 methods, declared across 4 files: expr/mod.rs (23), expr/record_value.rs (8), src/array_storage.rs (1), expr/toint32.rs (1). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Writer crates/perry-runtime/src/thread/clone_write.rs:262— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FuncEmitCtx crates/perry-codegen-wasm/src/emit/func_emit_ctx.rs:10— TooManyMethods — 31 methods, declared across 21 files: emit/function.rs (5), emit/memcall.rs (4), emit/binary.rs (3), emit/stmt.rs (2), +17 more file(s). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ShapeRecordRef crates/perry-runtime/src/object/shapes.rs:300— TooManyMethods — 31 methods, declared across 2 files: object/shapes.rs (29), object/shapes_spread.rs (2). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
perry_ui_ios::widgets::alert::topmost_view_controller (cognitive 49) crates/perry-ui-ios/src/widgets/alert.rs:37— perry_ui_ios::widgets::alert::topmost_view_controller has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 3 (8 pts), match/switch 1 (nesting depth added 32). 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.
perry_ui_ios::widgets::rich_tooltip::find_key_window (cognitive 49) crates/perry-ui-ios/src/widgets/rich_tooltip.rs:263— perry_ui_ios::widgets::rich_tooltip::find_key_window has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (42 pts), loops 2 (7 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_ios::app::key_window_root_vc (cognitive 46) crates/perry-ui-ios/src/app.rs:784— perry_ui_ios::app::key_window_root_vc has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 2 (7 pts), match/switch 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_ios::state::state_set (cognitive 38) crates/perry-ui-ios/src/state.rs:147— perry_ui_ios::state::state_set has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 8 (15 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.
perry_ui_ios::widgets::clear_children (cognitive 35) crates/perry-ui-ios/src/widgets/mod.rs:193— perry_ui_ios::widgets::clear_children has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (12 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_ios::drag_drop::perform_drop_impl (cognitive 34) crates/perry-ui-ios/src/drag_drop.rs:149— perry_ui_ios::drag_drop::perform_drop_impl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 3 (6 pts) (nesting depth added 15). Of this number, 25 points are the body's own statements and 9 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.
perry_ui_ios::audio_playback::drain_pending_callbacks (cognitive 30) crates/perry-ui-ios/src/audio_playback.rs:638— perry_ui_ios::audio_playback::drain_pending_callbacks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_ios::audio_playback::reapply_solo_state (cognitive 30) crates/perry-ui-ios/src/audio_playback.rs:1159— perry_ui_ios::audio_playback::reapply_solo_state has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (10 pts), loops 3 (6 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.
perry_ui_ios::deeplinks::dispatch_scene_connection_options (cognitive 29) crates/perry-ui-ios/src/deeplinks.rs:162— perry_ui_ios::deeplinks::dispatch_scene_connection_options has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_ios::ffi::camera::perry_system_preferences_get (cognitive 28) crates/perry-ui-ios/src/ffi/camera.rs:94— perry_ui_ios::ffi::camera::perry_system_preferences_get has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (28 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_ios::widgets::button::set_image (cognitive 28) crates/perry-ui-ios/src/widgets/button.rs:312— perry_ui_ios::widgets::button::set_image has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (27 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.
perry_ui_ios::adaptive_layout::current_snapshot (cognitive 27) crates/perry-ui-ios/src/adaptive_layout.rs:120— perry_ui_ios::adaptive_layout::current_snapshot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 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.
perry_ui_ios::audio_playback::perry_audio_play (cognitive 27) crates/perry-ui-ios/src/audio_playback.rs:418— perry_ui_ios::audio_playback::perry_audio_play has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 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, 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.
perry_ui_ios::audio_playback::perry_audio_load_sound (cognitive 25) crates/perry-ui-ios/src/audio_playback.rs:257— perry_ui_ios::audio_playback::perry_audio_load_sound has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 4 (6 pts), boolean chains 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.
perry_ui_ios::menu::build_uimenu (cognitive 25) crates/perry-ui-ios/src/menu.rs:235— perry_ui_ios::menu::build_uimenu has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (11 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.
perry_ui_ios::widgets::perry_ui_read_widget_value (cognitive 25) crates/perry-ui-ios/src/widgets/mod.rs:96— perry_ui_ios::widgets::perry_ui_read_widget_value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (25 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.
perry_ui_ios::widgets::attributed_text::append (cognitive 21) crates/perry-ui-ios/src/widgets/attributed_text.rs:42— perry_ui_ios::widgets::attributed_text::append 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.
perry_ui_ios::widgets::padding::set_edge_insets (cognitive 20) crates/perry-ui-ios/src/widgets/padding.rs:116— perry_ui_ios::widgets::padding::set_edge_insets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
perry_ui_ios::websocket::schedule_receive_raw (cognitive 19) crates/perry-ui-ios/src/websocket.rs:112— perry_ui_ios::websocket::schedule_receive_raw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_ios::media_playback::poll_tick (cognitive 18) crates/perry-ui-ios/src/media_playback.rs:819— perry_ui_ios::media_playback::poll_tick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
perry_ui_ios::media_playback::set_now_playing (cognitive 17) crates/perry-ui-ios/src/media_playback.rs:557— perry_ui_ios::media_playback::set_now_playing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (17 lines × 2) crates/perry-codegen/src/codegen/function.rs:94— crates/perry-codegen/src/codegen/function.rs:94-110 | crates/perry-codegen/src/codegen/method_typed.rs:37-53 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_typed.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/perry-codegen/src/codegen/function.rs:128— crates/perry-codegen/src/codegen/function.rs:128-144 | crates/perry-codegen/src/codegen/method_typed.rs:170-186 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_typed.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/perry-codegen/src/codegen/function.rs:163— crates/perry-codegen/src/codegen/function.rs:163-179 | crates/perry-codegen/src/codegen/method_typed.rs:124-140 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_typed.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/perry-codegen/src/codegen/function.rs:201— crates/perry-codegen/src/codegen/function.rs:201-217 | crates/perry-codegen/src/codegen/method_typed.rs:216-232 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_typed.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/perry-codegen/src/codegen/tdz_names.rs:108— crates/perry-codegen/src/codegen/tdz_names.rs:108-124 | crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:463-479 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/perry-codegen/src/collectors/byte_read_key.rs:107— crates/perry-codegen/src/collectors/byte_read_key.rs:107-123 | crates/perry-codegen/src/expr/closure.rs:54-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/perry-codegen/src/collectors/not_bigint_locals.rs:194— crates/perry-codegen/src/collectors/not_bigint_locals.rs:194-210 | crates/perry-codegen/src/type_analysis/numeric.rs:923-939 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/perry-codegen/src/collectors/pointer_locals.rs:507— crates/perry-codegen/src/collectors/pointer_locals.rs:507-523 | crates/perry-codegen/src/collectors/pointer_locals.rs:734-750 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/array_push.rs:185— crates/perry-codegen/src/expr/array_push.rs:185-201 | crates/perry-codegen/src/expr/array_push.rs:283-299 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/i32_fast_path.rs:132— crates/perry-codegen/src/expr/i32_fast_path.rs:132-148 | crates/perry-codegen/src/expr/i32_fast_path.rs:149-165 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/loops.rs:8304— crates/perry-codegen/src/stmt/loops.rs:8304-8320 | crates/perry-codegen/src/stmt/loops.rs:8409-8425 — both copies are in the same file, so extract the block into 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/perry-codegen/src/strings.rs:185— crates/perry-codegen/src/strings.rs:185-201 | crates/perry-codegen/src/strings.rs:228-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/perry-codegen/src/testing/temp_slots.rs:102— crates/perry-codegen/src/testing/temp_slots.rs:102-118 | crates/perry-codegen/src/testing/temp_slots.rs:156-172 — both copies are in the same file, so extract the block into 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/perry-ext-ethers/src/lib.rs:72— crates/perry-ext-ethers/src/lib.rs:72-88 | crates/perry-ext-nodemailer/src/lib.rs:173-189 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/perry-ext-parcel-watcher/src/lib.rs:848— crates/perry-ext-parcel-watcher/src/lib.rs:848-864 | crates/perry-ext-parcel-watcher/src/lib.rs:889-905 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_call/intrinsics/require.rs:34— crates/perry-hir/src/lower/expr_call/intrinsics/require.rs:34-50 | crates/perry-hir/src/lower/expr_call/intrinsics/require.rs:128-144 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_function.rs:1555— crates/perry-hir/src/lower/expr_function.rs:1555-1571 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:253-269 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower/stmt.rs:1581— crates/perry-hir/src/lower/stmt.rs:1581-1597 | crates/perry-hir/src/lower_decl/body_stmt.rs:1122-1138 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower/stmt.rs:1647— crates/perry-hir/src/lower/stmt.rs:1647-1663 | crates/perry-hir/src/lower_decl/body_stmt.rs:1175-1191 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower_patterns.rs:454— crates/perry-hir/src/lower_patterns.rs:454-470 | crates/perry-hir/src/lower_patterns.rs:511-527 — both copies are in the same file, so extract the block into 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) scripts/check_cross_thread_promise_provenance.py:76— scripts/check_cross_thread_promise_provenance.py:76-92 | scripts/runtime_abi_check.py:150-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
perry_ui_macos::widgets::clear_children (cognitive 44) crates/perry-ui-macos/src/widgets/mod.rs:454— perry_ui_macos::widgets::clear_children has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 5 (16 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.
perry_ui_macos::app::app_run (cognitive 42) crates/perry-ui-macos/src/app.rs:395— perry_ui_macos::app::app_run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (5 pts), match/switch 2 (4 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.
perry_ui_macos::state::state_set (cognitive 35) crates/perry-ui-macos/src/state.rs:159— perry_ui_macos::state::state_set has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 8 (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.
perry_ui_macos::widgets::image::create_file (cognitive 35) crates/perry-ui-macos/src/widgets/image.rs:41— perry_ui_macos::widgets::image::create_file has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 1 (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.
perry_ui_macos::audio_playback::drain_pending_callbacks (cognitive 30) crates/perry-ui-macos/src/audio_playback.rs:635— perry_ui_macos::audio_playback::drain_pending_callbacks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_macos::audio_playback::reapply_solo_state (cognitive 30) crates/perry-ui-macos/src/audio_playback.rs:1156— perry_ui_macos::audio_playback::reapply_solo_state has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (10 pts), loops 3 (6 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.
perry_ui_macos::audio_playback::perry_audio_play (cognitive 27) crates/perry-ui-macos/src/audio_playback.rs:415— perry_ui_macos::audio_playback::perry_audio_play has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 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, 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.
perry_ui_macos::widgets::set_hidden (cognitive 26) crates/perry-ui-macos/src/widgets/mod.rs:274— perry_ui_macos::widgets::set_hidden has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (26 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_macos::audio_playback::perry_audio_load_sound (cognitive 25) crates/perry-ui-macos/src/audio_playback.rs:254— perry_ui_macos::audio_playback::perry_audio_load_sound has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 4 (6 pts), boolean chains 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.
perry_ui_macos::widgets::perry_ui_read_widget_value (cognitive 25) crates/perry-ui-macos/src/widgets/mod.rs:125— perry_ui_macos::widgets::perry_ui_read_widget_value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (25 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.
perry_ui_macos::app::register_global_hotkey (cognitive 23) crates/perry-ui-macos/src/app.rs:1060— perry_ui_macos::app::register_global_hotkey has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 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.
perry_ui_macos::pointer::handle_event (cognitive 23) crates/perry-ui-macos/src/pointer.rs:200— perry_ui_macos::pointer::handle_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_macos::widgets::max_width::set_max_width (cognitive 23) crates/perry-ui-macos/src/widgets/max_width.rs:87— perry_ui_macos::widgets::max_width::set_max_width has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (5 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.
perry_ui_macos::widgets::set_background_gradient (cognitive 20) crates/perry-ui-macos/src/widgets/mod.rs:707— perry_ui_macos::widgets::set_background_gradient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 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.
perry_ui_macos::widgets::padding::set_edge_insets (cognitive 20) crates/perry-ui-macos/src/widgets/padding.rs:230— perry_ui_macos::widgets::padding::set_edge_insets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
perry_ui_macos::drag_drop::start_drag (cognitive 18) crates/perry-ui-macos/src/drag_drop.rs:325— perry_ui_macos::drag_drop::start_drag has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 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.
perry_ui_macos::media_playback::poll_tick (cognitive 18) crates/perry-ui-macos/src/media_playback.rs:626— perry_ui_macos::media_playback::poll_tick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
perry_ui_macos::widgets::collect_subtree_handles (cognitive 18) crates/perry-ui-macos/src/widgets/mod.rs:391— perry_ui_macos::widgets::collect_subtree_handles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 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.
perry_ui_macos::widgets::button::set_image (cognitive 17) crates/perry-ui-macos/src/widgets/button.rs:220— perry_ui_macos::widgets::button::set_image has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
perry_ui_macos::widgets::attributed_text::append (cognitive 16) crates/perry-ui-macos/src/widgets/attributed_text.rs:65— perry_ui_macos::widgets::attributed_text::append has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Duplicated block (18 lines × 2) crates/perry-codegen-glance/src/emit.rs:663— crates/perry-codegen-glance/src/emit.rs:663-680 | crates/perry-codegen-wear-tiles/src/emit.rs:448-465 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/codegen/closure.rs:936— crates/perry-codegen/src/codegen/closure.rs:936-953 | crates/perry-codegen/src/codegen/method.rs:482-499 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/perry-codegen/src/codegen/closure.rs:1361— crates/perry-codegen/src/codegen/closure.rs:1361-1378 | crates/perry-codegen/src/codegen/method.rs:752-769 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/perry-codegen/src/codegen/entry.rs:1064— crates/perry-codegen/src/codegen/entry.rs:1064-1081 | crates/perry-codegen/src/codegen/entry/module_init.rs:544-561 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/codegen/spec_return_proof.rs:236— crates/perry-codegen/src/codegen/spec_return_proof.rs:236-253 | crates/perry-codegen/src/lower_call/func_ref.rs:681-698 — before extracting anything, compare `crates/perry-codegen/src/codegen/spec_return_proof.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/codegen/string_pool.rs:1596— crates/perry-codegen/src/codegen/string_pool.rs:1596-1613 | crates/perry-codegen/src/codegen/string_pool.rs:1669-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.
Duplicated block (18 lines × 2) crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:37— crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:37-54 | crates/perry-codegen/src/stmt/stable_packed_accumulator.rs:228-245 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:470— crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:470-487 | crates/perry-codegen/src/expr/slot_rep.rs:936-953 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) crates/perry-codegen/src/collectors/segview.rs:711— crates/perry-codegen/src/collectors/segview.rs:711-728 | crates/perry-codegen/src/collectors/segview.rs:1332-1349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/perry-codegen/src/expr/bigint_set.rs:385— crates/perry-codegen/src/expr/bigint_set.rs:385-402 | crates/perry-codegen/src/expr/math_simple.rs:122-139 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/perry-codegen/src/expr/mod.rs:3537— crates/perry-codegen/src/expr/mod.rs:3537-3554 | crates/perry-codegen/src/expr/mod.rs:3604-3621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/perry-codegen/src/expr/new_dynamic.rs:143— crates/perry-codegen/src/expr/new_dynamic.rs:143-160 | crates/perry-codegen/src/expr/proxy_reflect.rs:1186-1203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) crates/perry-codegen/src/expr/this_super_call.rs:902— crates/perry-codegen/src/expr/this_super_call.rs:902-919 | crates/perry-codegen/src/expr/this_super_call.rs:969-986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/perry-codegen/src/lower_call/scalar_method.rs:331— crates/perry-codegen/src/lower_call/scalar_method.rs:331-348 | crates/perry-codegen/src/lower_call/scalar_method.rs:435-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/perry-component-host/src/sync_wasi/sockets.rs:53— crates/perry-component-host/src/sync_wasi/sockets.rs:53-70 | crates/perry-component-io/src/embedding.rs:97-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) crates/perry-ext-http/src/lib.rs:1084— crates/perry-ext-http/src/lib.rs:1084-1101 | crates/perry-ext-http/src/lib.rs:1224-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/perry-hir/src/lower/expr_call/post_args_dispatch.rs:168— crates/perry-hir/src/lower/expr_call/post_args_dispatch.rs:168-185 | crates/perry-hir/src/lower/expr_call/post_args_dispatch.rs:238-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/perry-hir/src/lower/stmt.rs:1506— crates/perry-hir/src/lower/stmt.rs:1506-1523 | crates/perry-hir/src/lower_decl/body_stmt.rs:1047-1064 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:42— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:42-59 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:42-59 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:657— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:657-674 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:811-828 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (5 lines × 3) crates/perry-codegen/src/codegen/function.rs:950— crates/perry-codegen/src/codegen/function.rs:950-954 | crates/perry-codegen/src/codegen/method.rs:448-454 | crates/perry-codegen/src/codegen/method_static.rs:166-178 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/logical_collections.rs:792— crates/perry-codegen/src/expr/logical_collections.rs:792-798 | crates/perry-codegen/src/expr/logical_collections.rs:1504-1508 | crates/perry-codegen/src/expr/logical_collections.rs:1542-1559 — 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) crates/perry-codegen/src/expr/method_site.rs:963— crates/perry-codegen/src/expr/method_site.rs:963-967 | crates/perry-codegen/src/expr/private_field_site.rs:326-330 | crates/perry-codegen/src/expr/typed_element.rs:410-414 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (5 lines × 3) crates/perry-codegen/src/expr/this_super_call.rs:119— crates/perry-codegen/src/expr/this_super_call.rs:119-124 | crates/perry-codegen/src/expr/this_super_call.rs:178-183 | crates/perry-codegen/src/stmt/region_loop/mod.rs:882-886 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/perry-codegen/src/lower_call/method_override.rs:1276— crates/perry-codegen/src/lower_call/method_override.rs:1276-1280 | crates/perry-codegen/src/lower_call/method_override.rs:1361-1365 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1865-1869 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/perry-codegen/src/lower_call/options/fetch.rs:553— crates/perry-codegen/src/lower_call/options/fetch.rs:553-557 | crates/perry-codegen/src/lower_call/options/fetch.rs:722-726 | crates/perry-codegen/src/lower_call/options/fetch.rs:835-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.
Duplicated block (5 lines × 3) crates/perry-ext-net/src/payload_closed.rs:65— crates/perry-ext-net/src/payload_closed.rs:65-69 | crates/perry-ext-net/src/payload_closed.rs:85-89 | crates/perry-ext-net/src/payload_closed.rs:107-111 — 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) crates/perry-hir/src/lower/expr_assign.rs:801— crates/perry-hir/src/lower/expr_assign.rs:801-805 | crates/perry-hir/src/lower/expr_call/static_and_instance.rs:233-239 | crates/perry-hir/src/lower/expr_member.rs:1125-1134 — 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/perry-hir/src/lower/expr_call/globals.rs:928— crates/perry-hir/src/lower/expr_call/globals.rs:928-932 | crates/perry-hir/src/lower/expr_call/module_static.rs:1295-1299 | crates/perry-hir/src/lower/expr_call/native_module/buffer_statics.rs:152-156 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-hir/src/lower/expr_member.rs:972— crates/perry-hir/src/lower/expr_member.rs:972-976 | crates/perry-hir/src/lower/expr_member.rs:1060-1064 | crates/perry-hir/src/lower/stmt.rs:519-523 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/perry-codegen/src/collectors/ptr_numarray.rs:122— crates/perry-codegen/src/collectors/ptr_numarray.rs:122-126 | crates/perry-codegen/src/collectors/ptr_shape.rs:161-165 | crates/perry-codegen/src/expr/slot_rep.rs:252-256 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/arrays_finds.rs:1454— crates/perry-codegen/src/expr/arrays_finds.rs:1454-1461 | crates/perry-codegen/src/expr/arrays_finds.rs:1464-1468 | crates/perry-codegen/src/expr/arrays_finds.rs:1471-1475 — 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) crates/perry-codegen/src/codegen/helpers.rs:304— crates/perry-codegen/src/codegen/helpers.rs:304-308 | crates/perry-codegen/src/codegen/helpers.rs:360-364 | crates/perry-codegen/src/codegen/spec_abi.rs:106-110 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/perry-codegen/src/expr/array_methods.rs:275— crates/perry-codegen/src/expr/array_methods.rs:275-279 | crates/perry-codegen/src/expr/bigint_set.rs:702-706 | crates/perry-codegen/src/expr/logical_collections.rs:1148-1152 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/dialect/mod.rs:797— crates/perry-codegen/src/dialect/mod.rs:797-801 | crates/perry-codegen/src/dialect/mod.rs:1171-1175 | crates/perry-codegen/src/dialect/mod.rs:1232-1236 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/perry-hir/src/lower/widget_decl.rs:738— crates/perry-hir/src/lower/widget_decl.rs:738-742 | crates/perry-hir/src/lower/widget_decl.rs:790-794 | crates/perry-hir/src/lower/widget_decl.rs:1131-1135 — 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) crates/perry-codegen/src/expr/index.rs:429— crates/perry-codegen/src/expr/index.rs:429-433 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:45-49 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:65-69 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:64— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:64-68 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:64-68 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:66-70 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:91— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:91-95 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:91-95 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:93-97 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:91` it does not close everything it opens, so those exact lines 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) scripts/component_async_compound_resources_acceptance.py:32— scripts/component_async_compound_resources_acceptance.py:32-36 | scripts/component_async_guest_resources_acceptance.py:36-40 | scripts/component_async_resource_cancel_acceptance.py:32-36 — before extracting anything, compare `scripts/component_async_compound_resources_acceptance.py` and `scripts/component_async_resource_cancel_acceptance.py` as WHOLE FILES: this scan already matched 5 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.
perry_ext_net::classes::parse_rule_string (cognitive 70) crates/perry-ext-net/src/classes.rs:273— perry_ext_net::classes::parse_rule_string has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (56 pts), match/switch 2 (8 pts), loops 3 (6 pts) (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.
perry_ext_net::payload_io::sink (cognitive 66) crates/perry-ext-net/src/payload_io.rs:50— perry_ext_net::payload_io::sink has cognitive complexity 66 (threshold 15). Drivers by points: if/else 30 (54 pts), boolean chains 9, 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.
perry_ext_net::payload_socket::get (cognitive 60) crates/perry-ext-net/src/payload_socket.rs:1466— perry_ext_net::payload_socket::get has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (37 pts), match/switch 9 (20 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.
perry_ext_net::tls::js_tls_connect (cognitive 51) crates/perry-ext-net/src/tls.rs:625— perry_ext_net::tls::js_tls_connect has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 7, match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::payload_tls::drive (cognitive 47) crates/perry-ext-net/src/payload_tls.rs:328— perry_ext_net::payload_tls::drive has cognitive complexity 47 (threshold 15). Drivers by points: if/else 28 (43 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::payload_socket::write (cognitive 44) crates/perry-ext-net/src/payload_socket.rs:977— perry_ext_net::payload_socket::write has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (35 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::payload_socket::destroy (cognitive 39) crates/perry-ext-net/src/payload_socket.rs:542— perry_ext_net::payload_socket::destroy has cognitive complexity 39 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 4, 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.
perry_ext_net::turnloop_tls::step (cognitive 35) crates/perry-ext-net/src/turnloop_tls.rs:351— perry_ext_net::turnloop_tls::step has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 5 (12 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.
perry_ext_net::payload_socket::end (cognitive 25) crates/perry-ext-net/src/payload_socket.rs:1227— perry_ext_net::payload_socket::end has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20 (24 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.
perry_ext_net::payload_tls::begin_connected (cognitive 25) crates/perry-ext-net/src/payload_tls.rs:214— perry_ext_net::payload_tls::begin_connected has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 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.
perry_ext_net::payload_socket::connect (cognitive 24) crates/perry-ext-net/src/payload_socket.rs:280— perry_ext_net::payload_socket::connect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 2, 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.
perry_ext_net::jsvalue::jsvalue_to_socket_bytes (cognitive 19) crates/perry-ext-net/src/jsvalue.rs:96— perry_ext_net::jsvalue::jsvalue_to_socket_bytes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 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.
perry_ext_net::classes::js_net_socket_address_parse (cognitive 17) crates/perry-ext-net/src/classes.rs:722— perry_ext_net::classes::js_net_socket_address_parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::payload_io::wrote (cognitive 17) crates/perry-ext-net/src/payload_io.rs:446— perry_ext_net::payload_io::wrote has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::bun_tcp::event (cognitive 16) crates/perry-ext-net/src/bun_tcp.rs:24— perry_ext_net::bun_tcp::event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 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.
perry_ext_net::classes::block_list_check_boxed (cognitive 16) crates/perry-ext-net/src/classes.rs:517— perry_ext_net::classes::block_list_check_boxed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 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.
perry_ext_net::classes::js_net_block_list_from_json (cognitive 16) crates/perry-ext-net/src/classes.rs:569— perry_ext_net::classes::js_net_block_list_from_json has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::payload_server::close (cognitive 16) crates/perry-ext-net/src/payload_server.rs:337— perry_ext_net::payload_server::close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_net::payload_socket::cache_before_release (cognitive 16) crates/perry-ext-net/src/payload_socket.rs:467— perry_ext_net::payload_socket::cache_before_release has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), 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.
Duplicated block (11–12 lines × 2) crates/perry-codegen-arkts/src/mutations.rs:1037— crates/perry-codegen-arkts/src/mutations.rs:1037-1048 | crates/perry-codegen-arkts/src/widgets/structure.rs:103-113 — 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–12 lines × 2) crates/perry-codegen/src/codegen/function.rs:315— crates/perry-codegen/src/codegen/function.rs:315-325 | crates/perry-codegen/src/codegen/method_trampolines.rs:117-128 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_trampolines.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) crates/perry-codegen/src/collectors/receiver_regions.rs:1067— crates/perry-codegen/src/collectors/receiver_regions.rs:1067-1077 | crates/perry-codegen/src/collectors/safepoint_sites.rs:56-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) crates/perry-codegen/src/expr/array_push.rs:214— crates/perry-codegen/src/expr/array_push.rs:214-225 | crates/perry-codegen/src/expr/array_push.rs:307-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/perry-codegen/src/expr/dispatch.rs:378— crates/perry-codegen/src/expr/dispatch.rs:378-389 | crates/perry-codegen/src/providers.rs:333-343 — 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–12 lines × 2) crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:671— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:671-682 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:741-751 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs` and `crates/perry-codegen/src/stmt/stable_packed_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-codegen/src/expr/this_super_call.rs:1024— crates/perry-codegen/src/expr/this_super_call.rs:1024-1035 | crates/perry-codegen/src/expr/this_super_call.rs:1103-1113 — both copies are in the same file, so extract the block into 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/perry-codegen/src/lower_call/property_get/static_dispatch.rs:472— crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:472-482 | crates/perry-codegen/src/lower_call/web_storage.rs:47-58 — before extracting anything, compare `crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs` and `crates/perry-codegen/src/lower_call/web_storage.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-codegen/src/lower_call/proven_call.rs:77— crates/perry-codegen/src/lower_call/proven_call.rs:77-87 | crates/perry-codegen/src/lower_call/proven_call.rs:151-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/perry-codegen/src/type_analysis/strings.rs:359— crates/perry-codegen/src/type_analysis/strings.rs:359-369 | crates/perry-codegen/src/type_analysis/strings.rs:733-744 — both copies are in the same file, so extract the block into 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/perry-container-compose/src/compose.rs:1116— crates/perry-container-compose/src/compose.rs:1116-1127 | crates/perry-container-compose/src/compose.rs:1177-1187 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_object.rs:620— crates/perry-hir/src/lower/expr_object.rs:620-630 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:263-274 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-hir/src/lower/stmt.rs:1382— crates/perry-hir/src/lower/stmt.rs:1382-1392 | crates/perry-hir/src/lower_decl/body_stmt.rs:916-927 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-hir/src/lower/stmt.rs:1464— crates/perry-hir/src/lower/stmt.rs:1464-1474 | crates/perry-hir/src/lower_decl/body_stmt.rs:1000-1011 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:809— crates/perry-hir/src/lower/stmt_loops.rs:809-820 | crates/perry-hir/src/lower_decl/body_stmt.rs:1536-1546 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1630— crates/perry-hir/src/lower/stmt_loops.rs:1630-1641 | crates/perry-hir/src/lower_decl/body_stmt.rs:2112-2122 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-hir/src/lower_decl/class_members.rs:505— crates/perry-hir/src/lower_decl/class_members.rs:505-516 | crates/perry-hir/src/lower_decl/private_members.rs:105-115 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) scripts/copied_minor_fallback_report.py:823— scripts/copied_minor_fallback_report.py:823-834 | scripts/copied_minor_fallback_report.py:897-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/copied_minor_fallback_report.py:823` 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, `scripts/copied_minor_fallback_report.py:896` calls `check_fallback_source_attribution` and `scripts/copied_minor_fallback_report.py:823` 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–12 lines × 2) scripts/thread_exit_address_globals.py:660— scripts/thread_exit_address_globals.py:660-670 | scripts/thread_exit_address_globals.py:678-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/thread_exit_address_globals.py:660` it does not close everything it opens, so those 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, `scripts/thread_exit_address_globals.py:659` calls `expect`, `any` and `scripts/thread_exit_address_globals.py:678` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) crates/perry-codegen-wasm/src/emit/stmt.rs:101— crates/perry-codegen-wasm/src/emit/stmt.rs:101-110 | crates/perry-codegen-wasm/src/emit/stmt.rs:149-158 | crates/perry-codegen-wasm/src/emit/stmt.rs:234-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 (10 lines × 3) crates/perry-codegen/src/collectors/hir_facts.rs:1719— crates/perry-codegen/src/collectors/hir_facts.rs:1719-1728 | crates/perry-hir/src/walker/expr_mut.rs:1637-1646 | crates/perry-hir/src/walker/expr_ref.rs:1612-1621 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/perry-codegen/src/collectors/proven_args.rs:302— crates/perry-codegen/src/collectors/proven_args.rs:302-311 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:973-982 | crates/perry-codegen/src/expr/slot_rep.rs:955-964 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) crates/perry-codegen/src/expr/bigint_set.rs:126— crates/perry-codegen/src/expr/bigint_set.rs:126-135 | crates/perry-codegen/src/expr/bigint_set.rs:238-247 | crates/perry-codegen/src/expr/bigint_set.rs:307-316 — 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/perry-codegen/src/expr/buffer_access.rs:502— crates/perry-codegen/src/expr/buffer_access.rs:502-511 | crates/perry-codegen/src/expr/buffer_access.rs:580-589 | crates/perry-codegen/src/expr/buffer_access.rs:880-889 — 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/perry-codegen/src/expr/this_super_call.rs:912— crates/perry-codegen/src/expr/this_super_call.rs:912-921 | crates/perry-codegen/src/expr/this_super_call.rs:953-968 | crates/perry-codegen/src/expr/this_super_call.rs:979-988 — 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/perry-codegen/src/temp_root_coverage/call_callee.rs:69— crates/perry-codegen/src/temp_root_coverage/call_callee.rs:69-78 | crates/perry-codegen/src/testing/temp_slots.rs:221-230 | crates/perry-codegen/src/testing/temp_slots.rs:409-418 — 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/perry-ext-net/src/payload_abi.rs:477— crates/perry-ext-net/src/payload_abi.rs:477-486 | crates/perry-ext-net/src/payload_abi.rs:714-723 | crates/perry-ext-net/src/payload_abi.rs:1062-1071 — 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/perry-ext-net/src/payload_abi.rs:543— crates/perry-ext-net/src/payload_abi.rs:543-552 | crates/perry-ext-net/src/payload_abi.rs:780-789 | crates/perry-ext-net/src/payload_abi.rs:1084-1093 — 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/perry-ext-net/src/payload_abi.rs:559— crates/perry-ext-net/src/payload_abi.rs:559-568 | crates/perry-ext-net/src/payload_abi.rs:796-805 | crates/perry-ext-net/src/payload_abi.rs:1103-1112 — 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/perry-ext-net/src/payload_abi.rs:649— crates/perry-ext-net/src/payload_abi.rs:649-658 | crates/perry-ext-net/src/payload_abi.rs:665-674 | crates/perry-ext-net/src/payload_abi.rs:842-851 — 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/perry-hir/src/lower/expr_call/local_array_methods.rs:642— crates/perry-hir/src/lower/expr_call/local_array_methods.rs:642-651 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:824-833 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:868-877 — 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/perry-hir/src/lower/expr_object.rs:472— crates/perry-hir/src/lower/expr_object.rs:472-481 | crates/perry-hir/src/lower/expr_object.rs:625-634 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:269-278 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:62— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:62-71 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:62-71 | crates/perry-hir/src/lower_decl/helpers.rs:16-25 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-codegen/src/lower_call/namespace_call.rs:146— crates/perry-codegen/src/lower_call/namespace_call.rs:146-160 | crates/perry-codegen/src/lower_call/namespace_call.rs:178-192 | crates/perry-codegen/src/lower_call/namespace_call.rs:210-219 — 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/perry-codegen/src/collectors/ptr_numarray.rs:260— crates/perry-codegen/src/collectors/ptr_numarray.rs:260-269 | crates/perry-codegen/src/collectors/ptr_shape.rs:241-250 | crates/perry-codegen/src/expr/slot_rep.rs:277-286 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/perry-hir/src/lower/widget_decl.rs:1498— crates/perry-hir/src/lower/widget_decl.rs:1498-1507 | crates/perry-hir/src/lower/widget_decl.rs:1512-1521 | crates/perry-hir/src/lower/widget_decl.rs:1555-1564 — 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) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:13— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:13-22 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:13-22 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:13-22 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:80— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:80-89 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:80-89 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:82-91 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
perry_codegen_arkts::widgets::text::emit_style_modifiers (cognitive 122) crates/perry-codegen-arkts/src/widgets/text.rs:146— perry_codegen_arkts::widgets::text::emit_style_modifiers has cognitive complexity 122 (threshold 15). Drivers by points: if/else 24 (93 pts), match/switch 5 (19 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 89). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen_arkts::mutations::collect_mutations_in_expr (cognitive 82) crates/perry-codegen-arkts/src/mutations.rs:204— perry_codegen_arkts::mutations::collect_mutations_in_expr has cognitive complexity 82 (threshold 15). Drivers by points: if/else 33 (58 pts), match/switch 11 (22 pts), loops 1 (2 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.
perry_codegen_arkts::emit_widget::emit_widget (cognitive 39) crates/perry-codegen-arkts/src/emit_widget.rs:16— perry_codegen_arkts::emit_widget::emit_widget has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 4 (6 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_codegen_arkts::mutations::collect_mutations_in_stmt (cognitive 38) crates/perry-codegen-arkts/src/mutations.rs:43— perry_codegen_arkts::mutations::collect_mutations_in_stmt has cognitive complexity 38 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 8 (17 pts), match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_codegen_arkts::conditions::evaluate_condition::to_lit (cognitive 37) crates/perry-codegen-arkts/src/conditions.rs:223— perry_codegen_arkts::conditions::evaluate_condition::to_lit has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 9 (17 pts), boolean chains 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_codegen_arkts::state_rewrite::rewrite_state_in_expr (cognitive 34) crates/perry-codegen-arkts/src/state_rewrite.rs:67— perry_codegen_arkts::state_rewrite::rewrite_state_in_expr has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 5 (10 pts), match/switch 1 (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.
perry_codegen_arkts::set_hidden::rewrite_set_hidden_in_expr (cognitive 29) crates/perry-codegen-arkts/src/set_hidden.rs:73— perry_codegen_arkts::set_hidden::rewrite_set_hidden_in_expr has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (10 pts), match/switch 2 (6 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.
perry_codegen_arkts::inline::inlined_analysis_init (cognitive 25) crates/perry-codegen-arkts/src/inline.rs:21— perry_codegen_arkts::inline::inlined_analysis_init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (5 pts), loops 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen_arkts::emit_index_ets (cognitive 23) crates/perry-codegen-arkts/src/lib.rs:105— perry_codegen_arkts::emit_index_ets has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 7 (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.
perry_codegen_arkts::inline::inline_calls_in_expr (cognitive 23) crates/perry-codegen-arkts/src/inline.rs:211— perry_codegen_arkts::inline::inline_calls_in_expr has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (11 pts), loops 4 (8 pts), if/else 3 (4 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_codegen_arkts::inline::collect_local_ids_in_stmts (cognitive 23) crates/perry-codegen-arkts/src/inline.rs:588— perry_codegen_arkts::inline::collect_local_ids_in_stmts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen_arkts::view_builders::scan_module_level_addchild_in_expr (cognitive 19) crates/perry-codegen-arkts/src/view_builders.rs:173— perry_codegen_arkts::view_builders::scan_module_level_addchild_in_expr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 9). 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.
perry_codegen_arkts::inline::remap_let_ids_in_stmt (cognitive 18) crates/perry-codegen-arkts/src/inline.rs:540— perry_codegen_arkts::inline::remap_let_ids_in_stmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 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.
perry_codegen_arkts::view_builders::scan_closure_body_for_view_builder_calls_in_expr (cognitive 18) crates/perry-codegen-arkts/src/view_builders.rs:438— perry_codegen_arkts::view_builders::scan_closure_body_for_view_builder_calls_in_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 9). 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.
perry_codegen_arkts::widgets::scroll::emit_scrollview (cognitive 17) crates/perry-codegen-arkts/src/widgets/scroll.rs:19— perry_codegen_arkts::widgets::scroll::emit_scrollview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 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.
perry_codegen_arkts::widgets::tree::build_tree_node (cognitive 17) crates/perry-codegen-arkts/src/widgets/tree.rs:102— perry_codegen_arkts::widgets::tree::build_tree_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 pts), match/switch 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.
perry_codegen_arkts::view_builders::collect_view_builders (cognitive 16) crates/perry-codegen-arkts/src/view_builders.rs:23— perry_codegen_arkts::view_builders::collect_view_builders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4, 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.
perry_codegen_arkts::view_builders::rewrite_view_builder_calls_in_expr (cognitive 16) crates/perry-codegen-arkts/src/view_builders.rs:304— perry_codegen_arkts::view_builders::rewrite_view_builder_calls_in_expr has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (5 pts), match/switch 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.
perry_ui_windows::layout::measure_intrinsic (cyclomatic 50) crates/perry-ui-windows/src/layout.rs:363— perry_ui_windows::layout::measure_intrinsic 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.
perry_ui_windows::app::wnd_proc (cyclomatic 48) crates/perry-ui-windows/src/app.rs:1509— perry_ui_windows::app::wnd_proc 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. This is NOT this file's highest cyclomatic complexity: perry_ui_windows::app::key_to_vk (cyclomatic 62) 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.
perry_ui_windows::layout::layout_stack (cyclomatic 40) crates/perry-ui-windows/src/layout.rs:41— perry_ui_windows::layout::layout_stack 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.
perry_ui_windows::app::app_run (cyclomatic 28) crates/perry-ui-windows/src/app.rs:618— perry_ui_windows::app::app_run 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: perry_ui_windows::app::key_to_vk (cyclomatic 62) 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.
perry_ui_windows::widgets::canvas::paint_canvas (cyclomatic 28) crates/perry-ui-windows/src/widgets/canvas.rs:145— perry_ui_windows::widgets::canvas::paint_canvas 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.
perry_ui_windows::window::window_default_wnd_proc (cyclomatic 26) crates/perry-ui-windows/src/window.rs:47— perry_ui_windows::window::window_default_wnd_proc 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.
perry_ui_windows::audio::start (cyclomatic 25) crates/perry-ui-windows/src/audio.rs:108— perry_ui_windows::audio::start 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.
perry_ui_windows::widgets::handle_command (cyclomatic 25) crates/perry-ui-windows/src/widgets/mod.rs:849— perry_ui_windows::widgets::handle_command has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ui_windows::state::state_set (cyclomatic 22) crates/perry-ui-windows/src/state.rs:155— perry_ui_windows::state::state_set 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.
perry_ui_windows::pointer::dispatch_message (cyclomatic 21) crates/perry-ui-windows/src/pointer.rs:186— perry_ui_windows::pointer::dispatch_message 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.
perry_ui_windows::widgets::paint_shadow_for_child (cyclomatic 21) crates/perry-ui-windows/src/widgets/mod.rs:1360— perry_ui_windows::widgets::paint_shadow_for_child 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.
perry_ui_windows::widgets::hstack::container_wnd_proc (cyclomatic 20) crates/perry-ui-windows/src/widgets/hstack.rs:46— perry_ui_windows::widgets::hstack::container_wnd_proc 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.
perry_ui_windows::widgets::vstack::container_wnd_proc (cyclomatic 20) crates/perry-ui-windows/src/widgets/vstack.rs:51— perry_ui_windows::widgets::vstack::container_wnd_proc 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.
perry_ui_windows::widgets::scrollview::scroll_wnd_proc (cyclomatic 19) crates/perry-ui-windows/src/widgets/scrollview.rs:131— perry_ui_windows::widgets::scrollview::scroll_wnd_proc 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.
perry_ui_windows::media_playback::set_now_playing (cyclomatic 17) crates/perry-ui-windows/src/media_playback.rs:264— perry_ui_windows::media_playback::set_now_playing 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.
perry_ui_windows::widgets::webview::install_navigation_handlers (cyclomatic 17) crates/perry-ui-windows/src/widgets/webview.rs:446— perry_ui_windows::widgets::webview::install_navigation_handlers 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.
perry_ui_windows::widgets::image::image_wnd_proc (cyclomatic 16) crates/perry-ui-windows/src/widgets/image.rs:82— perry_ui_windows::widgets::image::image_wnd_proc 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.
perry_ui_visionos::widgets::alert::topmost_view_controller (cognitive 49) crates/perry-ui-visionos/src/widgets/alert.rs:37— perry_ui_visionos::widgets::alert::topmost_view_controller has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 3 (8 pts), match/switch 1 (nesting depth added 32). 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.
perry_ui_visionos::widgets::rich_tooltip::find_key_window (cognitive 49) crates/perry-ui-visionos/src/widgets/rich_tooltip.rs:263— perry_ui_visionos::widgets::rich_tooltip::find_key_window has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (42 pts), loops 2 (7 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_visionos::widgets::clear_children (cognitive 35) crates/perry-ui-visionos/src/widgets/mod.rs:190— perry_ui_visionos::widgets::clear_children has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (12 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_visionos::drag_drop::perform_drop_impl (cognitive 34) crates/perry-ui-visionos/src/drag_drop.rs:155— perry_ui_visionos::drag_drop::perform_drop_impl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 3 (6 pts) (nesting depth added 15). Of this number, 25 points are the body's own statements and 9 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.
perry_ui_visionos::state::state_set (cognitive 32) crates/perry-ui-visionos/src/state.rs:128— perry_ui_visionos::state::state_set has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 8 (14 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.
perry_ui_visionos::audio_playback::drain_pending_callbacks (cognitive 30) crates/perry-ui-visionos/src/audio_playback.rs:638— perry_ui_visionos::audio_playback::drain_pending_callbacks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_visionos::audio_playback::reapply_solo_state (cognitive 30) crates/perry-ui-visionos/src/audio_playback.rs:1159— perry_ui_visionos::audio_playback::reapply_solo_state has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (10 pts), loops 3 (6 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.
perry_ui_visionos::ffi_system::perry_system_preferences_get (cognitive 28) crates/perry-ui-visionos/src/ffi_system.rs:245— perry_ui_visionos::ffi_system::perry_system_preferences_get has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (28 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_visionos::audio_playback::perry_audio_play (cognitive 27) crates/perry-ui-visionos/src/audio_playback.rs:418— perry_ui_visionos::audio_playback::perry_audio_play has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 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, 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.
perry_ui_visionos::audio_playback::perry_audio_load_sound (cognitive 25) crates/perry-ui-visionos/src/audio_playback.rs:257— perry_ui_visionos::audio_playback::perry_audio_load_sound has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 4 (6 pts), boolean chains 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.
perry_ui_visionos::menu::build_uimenu (cognitive 25) crates/perry-ui-visionos/src/menu.rs:235— perry_ui_visionos::menu::build_uimenu has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (11 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.
perry_ui_visionos::widgets::perry_ui_read_widget_value (cognitive 25) crates/perry-ui-visionos/src/widgets/mod.rs:93— perry_ui_visionos::widgets::perry_ui_read_widget_value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (25 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.
perry_ui_visionos::widgets::button::set_image (cognitive 24) crates/perry-ui-visionos/src/widgets/button.rs:186— perry_ui_visionos::widgets::button::set_image has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 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.
perry_ui_visionos::widgets::attributed_text::append (cognitive 21) crates/perry-ui-visionos/src/widgets/attributed_text.rs:42— perry_ui_visionos::widgets::attributed_text::append 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.
perry_ui_visionos::widgets::padding::set_edge_insets (cognitive 20) crates/perry-ui-visionos/src/widgets/padding.rs:112— perry_ui_visionos::widgets::padding::set_edge_insets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
perry_ui_visionos::websocket::schedule_receive_raw (cognitive 19) crates/perry-ui-visionos/src/websocket.rs:112— perry_ui_visionos::websocket::schedule_receive_raw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_visionos::media_playback::poll_tick (cognitive 18) crates/perry-ui-visionos/src/media_playback.rs:661— perry_ui_visionos::media_playback::poll_tick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
perry_ui_gtk4::widgets::canvas::create (cognitive 67) crates/perry-ui-gtk4/src/widgets/canvas.rs:120— perry_ui_gtk4::widgets::canvas::create has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (50 pts), loops 3 (12 pts), match/switch 1 (3 pts), boolean chains 2 (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.
perry_ui_gtk4::state::state_set (cognitive 46) crates/perry-ui-gtk4/src/state.rs:156— perry_ui_gtk4::state::state_set has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 8 (14 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.
perry_ui_gtk4::app::app_run (cognitive 44) crates/perry-ui-gtk4/src/app.rs:144— perry_ui_gtk4::app::app_run has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (35 pts), match/switch 2 (6 pts), loops 2, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_gtk4::widgets::remove_child (cognitive 29) crates/perry-ui-gtk4/src/widgets/mod.rs:742— perry_ui_gtk4::widgets::remove_child has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (29 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_gtk4::app::get_app_icon (cognitive 28) crates/perry-ui-gtk4/src/app.rs:804— perry_ui_gtk4::app::get_app_icon has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 1 (3 pts) (nesting depth added 19). 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.
perry_ui_gtk4::keyboard::gdk_name_to_keycode (cognitive 27) crates/perry-ui-gtk4/src/keyboard.rs:92— perry_ui_gtk4::keyboard::gdk_name_to_keycode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_gtk4::widgets::add_child (cognitive 27) crates/perry-ui-gtk4/src/widgets/mod.rs:130— perry_ui_gtk4::widgets::add_child has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_gtk4::camera::schedule_frame_processing (cognitive 23) crates/perry-ui-gtk4/src/camera.rs:128— perry_ui_gtk4::camera::schedule_frame_processing has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_gtk4::drag_drop::deliver_drop (cognitive 23) crates/perry-ui-gtk4/src/drag_drop.rs:157— perry_ui_gtk4::drag_drop::deliver_drop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
perry_ui_gtk4::widgets::set_alignment (cognitive 23) crates/perry-ui-gtk4/src/widgets/mod.rs:705— perry_ui_gtk4::widgets::set_alignment has cognitive complexity 23 (threshold 15). Drivers by points: loops 2 (8 pts), match/switch 2 (8 pts), if/else 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.
perry_ui_gtk4::widgets::clear_children (cognitive 21) crates/perry-ui-gtk4/src/widgets/mod.rs:74— perry_ui_gtk4::widgets::clear_children has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (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.
perry_ui_gtk4::widgets::add_child_at (cognitive 21) crates/perry-ui-gtk4/src/widgets/mod.rs:99— perry_ui_gtk4::widgets::add_child_at has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_gtk4::widgets::webview::install_signal_handlers (cognitive 19) crates/perry-ui-gtk4/src/widgets/webview.rs:128— perry_ui_gtk4::widgets::webview::install_signal_handlers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3, 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.
perry_ui_gtk4::media_playback::poll_tick (cognitive 18) crates/perry-ui-gtk4/src/media_playback.rs:401— perry_ui_gtk4::media_playback::poll_tick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
perry_ui_gtk4::widgets::command_palette::refresh_filter (cognitive 18) crates/perry-ui-gtk4/src/widgets/command_palette.rs:57— perry_ui_gtk4::widgets::command_palette::refresh_filter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (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.
perry_ui_gtk4::camera::sample_color (cognitive 17) crates/perry-ui-gtk4/src/camera.rs:566— perry_ui_gtk4::camera::sample_color has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Off the main sequence: perry-api-manifest — perry-api-manifest: 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: perry-dispatch — perry-dispatch: 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: perry-native-registration — perry-native-registration: 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: perry-perex — perry-perex: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: perry-ui-model — perry-ui-model: 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: perry-uuid — perry-uuid: 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: perry-wit — perry-wit: 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: perry-abi — perry-abi: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: perry-ffi — perry-ffi: abstractness 0.02, instability 0.09, distance 0.89 — zone of pain — concrete and depended on by 31 project(s), so it's rigid to change.
Off the main sequence: perry-diagnostics — perry-diagnostics: abstractness 0.11, instability 0.00, distance 0.89 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: perry-tls-session — perry-tls-session: abstractness 0.11, instability 0.00, distance 0.89 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: perry-runtime-manifest — perry-runtime-manifest: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: perry-ui — perry-ui: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: perry-audio-miniaudio — perry-audio-miniaudio: 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: perry-base64 — perry-base64: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 17 project(s), so it's rigid to change.
Off the main sequence: perry-parser — perry-parser: 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.
perry_codegen_arkts::mutations::collect_mutations_in_expr (cyclomatic 89) crates/perry-codegen-arkts/src/mutations.rs:204— perry_codegen_arkts::mutations::collect_mutations_in_expr has cyclomatic complexity 89 (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.
perry_codegen_arkts::widgets::text::emit_style_modifiers (cyclomatic 58) crates/perry-codegen-arkts/src/widgets/text.rs:146— perry_codegen_arkts::widgets::text::emit_style_modifiers 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.
perry_codegen_arkts::emit_widget::emit_widget (cyclomatic 44) crates/perry-codegen-arkts/src/emit_widget.rs:16— perry_codegen_arkts::emit_widget::emit_widget has cyclomatic complexity 44 (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.
perry_codegen_arkts::conditions::evaluate_condition::to_lit (cyclomatic 38) crates/perry-codegen-arkts/src/conditions.rs:223— perry_codegen_arkts::conditions::evaluate_condition::to_lit has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
perry_codegen_arkts::conditions::serialize_condition (cyclomatic 28) crates/perry-codegen-arkts/src/conditions.rs:52— perry_codegen_arkts::conditions::serialize_condition has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 2 function items 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.
perry_codegen_arkts::set_hidden::rewrite_set_hidden_in_expr (cyclomatic 25) crates/perry-codegen-arkts/src/set_hidden.rs:73— perry_codegen_arkts::set_hidden::rewrite_set_hidden_in_expr has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
perry_codegen_arkts::state_rewrite::rewrite_state_in_expr (cyclomatic 24) crates/perry-codegen-arkts/src/state_rewrite.rs:67— perry_codegen_arkts::state_rewrite::rewrite_state_in_expr 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.
perry_codegen_arkts::inline::inline_calls_in_expr (cyclomatic 19) crates/perry-codegen-arkts/src/inline.rs:211— perry_codegen_arkts::inline::inline_calls_in_expr has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
perry_codegen_arkts::media::module_uses_media (cyclomatic 19) crates/perry-codegen-arkts/src/media.rs:149— perry_codegen_arkts::media::module_uses_media has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (stmt_uses, expr_uses). 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.
perry_codegen_arkts::view_builders::rewrite_view_builder_calls_in_expr (cyclomatic 18) crates/perry-codegen-arkts/src/view_builders.rs:304— perry_codegen_arkts::view_builders::rewrite_view_builder_calls_in_expr has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
perry_codegen_arkts::widget_walks::walk_for_set_hidden_targets_in_expr (cyclomatic 18) crates/perry-codegen-arkts/src/widget_walks.rs:197— perry_codegen_arkts::widget_walks::walk_for_set_hidden_targets_in_expr 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.
perry_codegen_arkts::set_hidden::rewrite_set_hidden_in_closures_in_expr (cyclomatic 17) crates/perry-codegen-arkts/src/set_hidden.rs:238— perry_codegen_arkts::set_hidden::rewrite_set_hidden_in_closures_in_expr 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.
perry_codegen_arkts::widget_walks::walk_init_for_closure_targets_in_expr (cyclomatic 17) crates/perry-codegen-arkts/src/widget_walks.rs:83— perry_codegen_arkts::widget_walks::walk_init_for_closure_targets_in_expr 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.
perry_codegen_arkts::mutations::collect_mutations_in_stmt (cyclomatic 16) crates/perry-codegen-arkts/src/mutations.rs:43— perry_codegen_arkts::mutations::collect_mutations_in_stmt 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.
ClassTooLong: Expr crates/perry-hir/src/ir/expr.rs:57— ClassTooLong — 1421 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 2 blocks, lines 57-2956. The bar is 400 significant lines; this is 1021 over it, 3.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Gen crates/perry-wpfacts/src/gen.rs:93— ClassTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 215 methods, 2 blocks, lines 93-1616. The bar is 400 significant lines; this is 620 over it, 2.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LlBlock crates/perry-codegen/src/block.rs:404— ClassTooLong — 926 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 107 methods, 2 blocks, lines 404-1962. The bar is 400 significant lines; this is 526 over it, 2.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Writer crates/perry-runtime/src/thread/clone_write.rs:262— ClassTooLong — 842 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 262-1436. The bar is 400 significant lines; this is 442 over it, 2.11× 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: LlModule crates/perry-codegen/src/module.rs:53— ClassTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 67 methods, 2 blocks, lines 53-1692. The bar is 400 significant lines; this is 432 over it, 2.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: GcCycleState crates/perry-runtime/src/gc/cycle.rs:614— ClassTooLong — 820 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, 3 blocks, lines 614-1937. The bar is 400 significant lines; this is 420 over it, 2.05× 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: ComposeEngine crates/perry-container-compose/src/compose.rs:32— ClassTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 32-998. The bar is 400 significant lines; this is 166 over it, 1.42× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FnCtx crates/perry-codegen/src/expr/mod.rs:367— ClassTooLong — 481 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 367-3237. The bar is 400 significant lines; this is 81 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.
ClassTooLong: UseWalk crates/perry-codegen/src/collectors/ptr_shape.rs:1017— ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 1017-1744. The bar is 400 significant lines; this is 40 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: ArrayFactCollector crates/perry-codegen/src/collectors/hir_facts.rs:1362— ClassTooLong — 439 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 1362-2009. The bar is 400 significant lines; this is 39 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: GcCycleTrace crates/perry-runtime/src/gc/telemetry.rs:963— ClassTooLong — 420 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 963-1464. The bar is 400 significant lines; this is 20 over it, 1.05× 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: ArenaSweepObjectsState crates/perry-runtime/src/gc/oldgen/sweep_objects.rs:6— ClassTooLong — 412 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, 3 blocks, lines 6-706. The bar is 400 significant lines; this is 12 over it, 1.03× 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: Host crates/perry-component-host/src/lib.rs:88— ClassTooLong — 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 4 blocks, lines 88-608. The bar is 400 significant lines; this is 6 over it, 1.02× 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: Reader crates/perry-runtime/src/thread/clone_read.rs:95— ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 95-627. The bar is 400 significant lines; this is 1 over it, 1.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.
FuncEmitCtx::try_emit_expr_native_method (cyclomatic 91) crates/perry-codegen-wasm/src/emit/expr/native_method.rs:9— FuncEmitCtx::try_emit_expr_native_method has cyclomatic complexity 91 (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.
FuncEmitCtx::try_emit_expr_literals_vars (cyclomatic 70) crates/perry-codegen-wasm/src/emit/expr/literals_vars.rs:9— FuncEmitCtx::try_emit_expr_literals_vars has cyclomatic complexity 70 (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.
FuncEmitCtx::try_emit_expr_classes (cyclomatic 65) crates/perry-codegen-wasm/src/emit/expr/classes.rs:9— FuncEmitCtx::try_emit_expr_classes 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.
FuncEmitCtx::try_emit_expr_url_process_path (cyclomatic 57) crates/perry-codegen-wasm/src/emit/expr/url_process_path.rs:9— FuncEmitCtx::try_emit_expr_url_process_path has cyclomatic complexity 57 (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.
FuncEmitCtx::emit_stmt (cyclomatic 56) crates/perry-codegen-wasm/src/emit/stmt.rs:10— FuncEmitCtx::emit_stmt 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.
FuncEmitCtx::try_emit_expr_date_error (cyclomatic 55) crates/perry-codegen-wasm/src/emit/expr/date_error.rs:9— FuncEmitCtx::try_emit_expr_date_error has cyclomatic complexity 55 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FuncEmitCtx::try_emit_expr_calls (cyclomatic 52) crates/perry-codegen-wasm/src/emit/expr/calls.rs:9— FuncEmitCtx::try_emit_expr_calls has cyclomatic complexity 52 (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.
FuncEmitCtx::try_emit_expr_math (cyclomatic 44) crates/perry-codegen-wasm/src/emit/expr/math.rs:9— FuncEmitCtx::try_emit_expr_math has cyclomatic complexity 44 (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.
FuncEmitCtx::try_emit_expr_arrays (cyclomatic 43) crates/perry-codegen-wasm/src/emit/expr/arrays.rs:9— FuncEmitCtx::try_emit_expr_arrays 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.
FuncEmitCtx::try_emit_expr_objects (cyclomatic 38) crates/perry-codegen-wasm/src/emit/expr/objects.rs:9— FuncEmitCtx::try_emit_expr_objects has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FuncEmitCtx::emit_method_call (cyclomatic 37) crates/perry-codegen-wasm/src/emit/method_call.rs:12— FuncEmitCtx::emit_method_call 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.
FuncEmitCtx::try_emit_expr_buffers (cyclomatic 33) crates/perry-codegen-wasm/src/emit/expr/buffers.rs:9— FuncEmitCtx::try_emit_expr_buffers 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.
FuncEmitCtx::try_emit_expr_net_fetch_crypto (cyclomatic 24) crates/perry-codegen-wasm/src/emit/expr/net_fetch_crypto.rs:9— FuncEmitCtx::try_emit_expr_net_fetch_crypto 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.
Duplicated block (22 lines × 2) crates/perry-codegen-swiftui/src/emit.rs:286— crates/perry-codegen-swiftui/src/emit.rs:286-307 | crates/perry-codegen-swiftui/src/emit.rs:327-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.
Duplicated block (22 lines × 2) crates/perry-codegen/src/codegen/param_guard.rs:872— crates/perry-codegen/src/codegen/param_guard.rs:872-893 | crates/perry-codegen/src/codegen/param_guard.rs:1052-1073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/perry-codegen/src/codegen/typed_abi/lower.rs:244— crates/perry-codegen/src/codegen/typed_abi/lower.rs:244-265 | crates/perry-codegen/src/codegen/typed_abi/lower.rs:530-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/perry-codegen/src/collectors/clamp_detect.rs:25— crates/perry-codegen/src/collectors/clamp_detect.rs:25-46 | crates/perry-codegen/src/collectors/clamp_detect.rs:52-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/perry-codegen/src/collectors/clamp_detect.rs:101— crates/perry-codegen/src/collectors/clamp_detect.rs:101-122 | crates/perry-codegen/src/collectors/clamp_detect.rs:127-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:431— crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:431-452 | crates/perry-codegen/src/expr/slot_rep.rs:893-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.
Duplicated block (22 lines × 2) crates/perry-ext-http/src/server/https_server.rs:452— crates/perry-ext-http/src/server/https_server.rs:452-473 | crates/perry-ext-http/src/server/server.rs:1296-1317 — before extracting anything, compare `crates/perry-ext-http/src/server/https_server.rs` and `crates/perry-ext-http/src/server/server.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. If that is what happened, the fix is to keep one copy and have the 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) crates/perry-hir/src/destructuring/pattern_binding.rs:678— crates/perry-hir/src/destructuring/pattern_binding.rs:678-699 | crates/perry-hir/src/destructuring/pattern_binding.rs:702-723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/perry-hir/src/lower/expr_assign.rs:113— crates/perry-hir/src/lower/expr_assign.rs:113-134 | crates/perry-hir/src/lower_patterns.rs:556-577 — 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 (22 lines × 2) crates/perry-hir/src/lower/expr_call/globals.rs:670— crates/perry-hir/src/lower/expr_call/globals.rs:670-691 | crates/perry-hir/src/lower/expr_call/module_static.rs:1460-1481 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) crates/perry-hir/src/lower/expr_call/module_static.rs:1559— crates/perry-hir/src/lower/expr_call/module_static.rs:1559-1580 | crates/perry-hir/src/lower/expr_call/native_module/imported_module_dispatch.rs:45-66 — 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 (22 lines × 2) crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:149— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:149-170 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:151-172 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/codegen/class_artifacts.rs:715— crates/perry-codegen/src/codegen/class_artifacts.rs:715-736 | crates/perry-codegen/src/codegen/class_artifacts.rs:760-781 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/codegen/mod.rs:4103— crates/perry-codegen/src/codegen/mod.rs:4103-4122 | crates/perry-codegen/src/codegen/mod.rs:4146-4165 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/collectors/hot_callees.rs:406— crates/perry-codegen/src/collectors/hot_callees.rs:406-425 | crates/perry-codegen/src/collectors/loop_bounded_i32.rs:904-923 — before extracting anything, compare `crates/perry-codegen/src/collectors/hot_callees.rs` and `crates/perry-codegen/src/collectors/loop_bounded_i32.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) crates/perry-codegen/src/collectors/scalar_methods.rs:309— crates/perry-codegen/src/collectors/scalar_methods.rs:309-328 | crates/perry-codegen/src/collectors/scalar_methods.rs:343-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1249— crates/perry-codegen/src/dialect/mod.rs:1249-1268 | crates/perry-codegen/src/dialect/mod.rs:1369-1388 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/expr/env_clones.rs:247— crates/perry-codegen/src/expr/env_clones.rs:247-266 | crates/perry-codegen/src/expr/env_clones.rs:364-383 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/expr/i32_fast_path.rs:685— crates/perry-codegen/src/expr/i32_fast_path.rs:685-704 | crates/perry-codegen/src/expr/ta_param_f64_read.rs:268-287 — before extracting anything, compare `crates/perry-codegen/src/expr/i32_fast_path.rs` and `crates/perry-codegen/src/expr/ta_param_f64_read.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) crates/perry-codegen/src/expr/i32_fast_path.rs:1059— crates/perry-codegen/src/expr/i32_fast_path.rs:1059-1078 | crates/perry-codegen/src/expr/i32_fast_path.rs:1471-1490 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/expr/index_set_packed_loop.rs:126— crates/perry-codegen/src/expr/index_set_packed_loop.rs:126-145 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:243-262 — both copies are in the same file, so extract the block into 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) crates/perry-hir/src/js_transform/local_natives.rs:977— crates/perry-hir/src/js_transform/local_natives.rs:977-996 | crates/perry-hir/src/js_transform/local_natives.rs:1002-1021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/perry-hir/src/js_transform/local_natives.rs:988— crates/perry-hir/src/js_transform/local_natives.rs:988-1007 | crates/perry-hir/src/js_transform/local_natives.rs:1107-1126 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/expr/new_dynamic.rs:327— crates/perry-codegen/src/expr/new_dynamic.rs:327-346 | crates/perry-codegen/src/expr/new_dynamic.rs:555-583 — both copies are in the same file, so extract the block into 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) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1127— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1127-1146 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1475-1494 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (20 lines × 2) scripts/compiler_output_harness/repsel_determinism.py:148— scripts/compiler_output_harness/repsel_determinism.py:148-167 | scripts/compiler_output_harness/repsel_temp_hygiene.py:186-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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, `scripts/compiler_output_harness/repsel_temp_hygiene.py:211` calls `mkdir` and `scripts/compiler_output_harness/repsel_determinism.py:170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) crates/perry-codegen/src/codegen/closure.rs:1338— crates/perry-codegen/src/codegen/closure.rs:1338-1348 | crates/perry-codegen/src/codegen/method.rs:729-739 | crates/perry-codegen/src/codegen/method_static.rs:404-414 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/collectors/escape_arrays.rs:691— crates/perry-codegen/src/collectors/escape_arrays.rs:691-701 | crates/perry-codegen/src/collectors/escape_check.rs:464-474 | crates/perry-codegen/src/collectors/escape_objects.rs:532-542 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_arrays.rs` and `crates/perry-codegen/src/collectors/escape_objects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/collectors/integer_locals.rs:197— crates/perry-codegen/src/collectors/integer_locals.rs:197-207 | crates/perry-codegen/src/collectors/segview.rs:526-536 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1268-1278 — before extracting anything, compare `crates/perry-codegen/src/collectors/segview.rs` and `crates/perry-hir/src/lower/shared_mutable_capture.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen/src/expr/i32_fast_path.rs:1069— crates/perry-codegen/src/expr/i32_fast_path.rs:1069-1079 | crates/perry-codegen/src/expr/i32_fast_path.rs:1481-1491 | crates/perry-codegen/src/lower_call/func_ref.rs:880-890 — 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 (11 lines × 3) crates/perry-codegen/src/lower_call/builtin.rs:450— crates/perry-codegen/src/lower_call/builtin.rs:450-460 | crates/perry-codegen/src/lower_call/builtin.rs:922-932 | crates/perry-codegen/src/lower_call/builtin.rs:1110-1120 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/perry-codegen/src/stmt/loops.rs:7673— crates/perry-codegen/src/stmt/loops.rs:7673-7683 | crates/perry-codegen/src/stmt/loops.rs:9855-9865 | crates/perry-codegen/src/stmt/loops.rs:9935-9945 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/perry-codegen/src/stmt/region_loop/plan.rs:549— crates/perry-codegen/src/stmt/region_loop/plan.rs:549-559 | crates/perry-hir/src/walker/expr_mut.rs:22-32 | crates/perry-hir/src/walker/expr_ref.rs:23-33 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-ext-http/src/client_events.rs:736— crates/perry-ext-http/src/client_events.rs:736-746 | crates/perry-ext-http/src/client_events.rs:768-778 | crates/perry-ext-http/src/client_events.rs:806-816 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/perry-hir/src/lower/expr_object.rs:1368— crates/perry-hir/src/lower/expr_object.rs:1368-1378 | crates/perry-hir/src/lower/expr_object.rs:1396-1406 | crates/perry-hir/src/lower/expr_object.rs:1631-1641 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:176— crates/perry-codegen/src/collectors/int_valued_ta_locals.rs:176-186 | crates/perry-codegen/src/expr/binary.rs:1160-1170 | crates/perry-codegen/src/stmt/number_local_loop.rs:256-266 — 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 (11 lines × 3) crates/perry-codegen/src/lower_string_method.rs:703— crates/perry-codegen/src/lower_string_method.rs:703-716 | crates/perry-codegen/src/lower_string_method.rs:790-802 | crates/perry-codegen/src/lower_string_method.rs:811-821 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/perry-ext-better-sqlite3/src/lib.rs:540— crates/perry-ext-better-sqlite3/src/lib.rs:540-550 | crates/perry-ext-better-sqlite3/src/lib.rs:555-565 | crates/perry-ext-better-sqlite3/src/lib.rs:570-580 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/perry-codegen/src/lower_call/options/fetch.rs:803— crates/perry-codegen/src/lower_call/options/fetch.rs:803-813 | crates/perry-codegen/src/lower_call/options/fetch.rs:971-981 | crates/perry-codegen/src/lower_call/options/fetch.rs:992-1002 — 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–9 lines × 2) crates/perry-codegen/src/concat_site_cache.rs:222— crates/perry-codegen/src/concat_site_cache.rs:222-230 | crates/perry-codegen/src/expr/array_pop.rs:136-143 — 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–9 lines × 2) crates/perry-codegen/src/expr/compare.rs:394— crates/perry-codegen/src/expr/compare.rs:394-401 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:952-960 — before extracting anything, compare `crates/perry-codegen/src/expr/compare.rs` and `crates/perry-codegen/src/expr/property_get/generic_dispatch.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 2) crates/perry-codegen/src/expr/dyn_extern_i18n.rs:499— crates/perry-codegen/src/expr/dyn_extern_i18n.rs:499-506 | crates/perry-codegen/src/expr/dyn_extern_i18n.rs:1353-1361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/perry-codegen/src/expr/index.rs:656— crates/perry-codegen/src/expr/index.rs:656-664 | crates/perry-codegen/src/expr/index.rs:689-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.
Duplicated block (8–9 lines × 2) crates/perry-codegen/src/expr/index_get.rs:414— crates/perry-codegen/src/expr/index_get.rs:414-422 | crates/perry-codegen/src/expr/index_get.rs:620-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.
Duplicated block (8–9 lines × 2) crates/perry-codegen/src/lower_call/extern_func.rs:1249— crates/perry-codegen/src/lower_call/extern_func.rs:1249-1257 | crates/perry-codegen/src/lower_call/extern_func.rs:1284-1291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/perry-ext-http/src/client_request_surface.rs:39— crates/perry-ext-http/src/client_request_surface.rs:39-47 | crates/perry-ext-http/src/server/request.rs:844-851 — 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–9 lines × 2) crates/perry-hir/src/destructuring/pattern_binding.rs:586— crates/perry-hir/src/destructuring/pattern_binding.rs:586-593 | crates/perry-hir/src/destructuring/pattern_binding.rs:839-847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/perry-hir/src/js_transform/cross_module_natives.rs:787— crates/perry-hir/src/js_transform/cross_module_natives.rs:787-794 | crates/perry-hir/src/js_transform/cross_module_natives.rs:907-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/perry-hir/src/native_profile.rs:75— crates/perry-hir/src/native_profile.rs:75-83 | crates/perry-hir/src/native_profile.rs:173-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) scripts/gc_root_dominance_check.py:863— scripts/gc_root_dominance_check.py:863-870 | scripts/gc_root_dominance_check.py:1382-1390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) scripts/test262_subset.py:227— scripts/test262_subset.py:227-235 | scripts/test262_subset.py:237-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/test262_subset.py:227` 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–9 lines × 2) scripts/ci_e2e_scope.py:284— scripts/ci_e2e_scope.py:284-291 | scripts/ci_e2e_scope.py:405-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/ci_e2e_scope.py:284` it does not close everything it opens, so those exact lines 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/perry-codegen/src/expr/call_spread.rs:701— crates/perry-codegen/src/expr/call_spread.rs:701-705 | crates/perry-codegen/src/expr/this_super_call.rs:812-816 | crates/perry-codegen/src/lower_call/method_override.rs:693-697 | crates/perry-codegen/src/lower_call/new_helpers.rs:258-262 — 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 (5 lines × 4) crates/perry-codegen/src/lower_call/native/mod.rs:395— crates/perry-codegen/src/lower_call/native/mod.rs:395-399 | crates/perry-codegen/src/lower_call/native/mod.rs:450-454 | crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:461-465 | crates/perry-codegen/src/lower_call/web_storage.rs:36-40 — before extracting anything, compare `crates/perry-codegen/src/lower_call/native/mod.rs` and `crates/perry-codegen/src/lower_call/web_storage.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 (5 lines × 4) crates/perry-codegen/src/lower_string_method.rs:513— crates/perry-codegen/src/lower_string_method.rs:513-517 | crates/perry-codegen/src/lower_string_method.rs:881-885 | crates/perry-codegen/src/lower_string_method.rs:1050-1055 | crates/perry-codegen/src/lower_string_method.rs:1270-1274 — 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/perry-hir/src/lower/expr_call/native_module/object_statics.rs:14— crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:14-18 | crates/perry-hir/src/lower/expr_call/static_and_instance.rs:17-21 | crates/perry-hir/src/lower/expr_member/member_tail.rs:532-536 | crates/perry-hir/src/lower/expr_member/member_tail.rs:567-571 — 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/perry-hir/src/lower/stmt_loops/for_await_targets.rs:62— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:62-66 | crates/perry-hir/src/lower_decl/body_stmt.rs:1261-1265 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:62-66 | crates/perry-hir/src/lower_decl/helpers.rs:16-20 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) crates/perry-codegen/src/expr/calls/crypto_misc.rs:202— crates/perry-codegen/src/expr/calls/crypto_misc.rs:202-206 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:34-38 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:46-53 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:62-69 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 4) crates/perry-codegen-glance/src/emit.rs:112— crates/perry-codegen-glance/src/emit.rs:112-116 | crates/perry-codegen-glance/src/emit.rs:136-140 | crates/perry-codegen-glance/src/emit_glue.rs:10-15 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:11-16 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (5 lines × 4) crates/perry-codegen/src/expr/arrays_finds.rs:649— crates/perry-codegen/src/expr/arrays_finds.rs:649-653 | crates/perry-codegen/src/expr/os_uri_dates.rs:311-315 | crates/perry-codegen/src/expr/property_get.rs:199-203 | crates/perry-codegen/src/expr/string_regex_proc.rs:317-321 — before extracting anything, compare `crates/perry-codegen/src/expr/arrays_finds.rs` and `crates/perry-codegen/src/expr/string_regex_proc.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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/perry-ext-http/src/server/response.rs:635— crates/perry-ext-http/src/server/response.rs:635-639 | crates/perry-ext-http/src/server/response.rs:648-652 | crates/perry-ext-http/src/server/response.rs:674-678 | crates/perry-ext-http/src/server/response.rs:716-720 — 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/perry-codegen/src/expr/dyn_extern_i18n.rs:482— crates/perry-codegen/src/expr/dyn_extern_i18n.rs:482-486 | crates/perry-codegen/src/expr/dyn_extern_i18n.rs:1321-1325 | crates/perry-codegen/src/expr/index_set_guarded.rs:492-496 | crates/perry-codegen/src/expr/property_set.rs:401-405 — 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/perry-codegen/src/codegen/closure.rs:1587— crates/perry-codegen/src/codegen/closure.rs:1587-1591 | crates/perry-codegen/src/codegen/entry.rs:1471-1475 | crates/perry-codegen/src/codegen/entry/module_init.rs:680-684 | crates/perry-codegen/src/codegen/function.rs:1813-1817 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:550— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:550-554 | android-build/app/src/main/java/com/perry/app/PerryBridge.kt:597-601 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:701-705 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:748-752 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:550` 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 × 4) scripts/component_host_acceptance.py:81— scripts/component_host_acceptance.py:81-85 | scripts/component_host_acceptance.py:106-110 | scripts/component_host_acceptance.py:130-134 | scripts/component_host_acceptance.py:154-158 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Weak hash algorithm crates/perry-container-compose/src/compose.rs:21— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-container-compose/src/service.rs:4— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-container-compose/src/service.rs:21— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-container-compose/src/testing/mock_backend.rs:130— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-http-client/src/ws/frame.rs:96— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/certificate.rs:197— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/hash.rs:87— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/hash_handles.rs:176— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/hash_handles.rs:188— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/util.rs:135— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/x509.rs:723— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/crypto/x509.rs:1048— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/perry-stdlib/src/webcrypto/util.rs:1035— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
perry_ui_tvos::widgets::alert::topmost_view_controller (cognitive 49) crates/perry-ui-tvos/src/widgets/alert.rs:37— perry_ui_tvos::widgets::alert::topmost_view_controller has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 3 (8 pts), match/switch 1 (nesting depth added 32). 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.
perry_ui_tvos::state::state_set (cognitive 32) crates/perry-ui-tvos/src/state.rs:128— perry_ui_tvos::state::state_set has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 8 (14 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.
perry_ui_tvos::audio_playback::drain_pending_callbacks (cognitive 30) crates/perry-ui-tvos/src/audio_playback.rs:638— perry_ui_tvos::audio_playback::drain_pending_callbacks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_tvos::audio_playback::reapply_solo_state (cognitive 30) crates/perry-ui-tvos/src/audio_playback.rs:1159— perry_ui_tvos::audio_playback::reapply_solo_state has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (10 pts), loops 3 (6 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.
perry_ui_tvos::audio_playback::perry_audio_play (cognitive 27) crates/perry-ui-tvos/src/audio_playback.rs:418— perry_ui_tvos::audio_playback::perry_audio_play has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 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, 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.
perry_ui_tvos::audio_playback::perry_audio_load_sound (cognitive 25) crates/perry-ui-tvos/src/audio_playback.rs:257— perry_ui_tvos::audio_playback::perry_audio_load_sound has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 4 (6 pts), boolean chains 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.
perry_ui_tvos::menu::build_uimenu (cognitive 25) crates/perry-ui-tvos/src/menu.rs:200— perry_ui_tvos::menu::build_uimenu has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (11 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.
perry_ui_tvos::widgets::button::set_image (cognitive 24) crates/perry-ui-tvos/src/widgets/button.rs:183— perry_ui_tvos::widgets::button::set_image has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 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.
perry_ui_tvos::widgets::attributed_text::append (cognitive 21) crates/perry-ui-tvos/src/widgets/attributed_text.rs:42— perry_ui_tvos::widgets::attributed_text::append 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.
perry_ui_tvos::widgets::padding::set_edge_insets (cognitive 20) crates/perry-ui-tvos/src/widgets/padding.rs:112— perry_ui_tvos::widgets::padding::set_edge_insets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
perry_ui_tvos::websocket::schedule_receive_raw (cognitive 19) crates/perry-ui-tvos/src/websocket.rs:112— perry_ui_tvos::websocket::schedule_receive_raw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_tvos::media_playback::poll_tick (cognitive 18) crates/perry-ui-tvos/src/media_playback.rs:661— perry_ui_tvos::media_playback::poll_tick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
Duplicated block (19 lines × 2) crates/perry-codegen-arkts/src/widgets/calendar.rs:22— crates/perry-codegen-arkts/src/widgets/calendar.rs:22-40 | crates/perry-codegen-arkts/src/widgets/date_picker.rs:21-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) crates/perry-codegen/src/codegen/method_entries.rs:98— crates/perry-codegen/src/codegen/method_entries.rs:98-116 | crates/perry-codegen/src/codegen/method_entries.rs:204-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:86— crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:86-104 | crates/perry-codegen/src/layout_desc.rs:614-632 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19 lines × 2) crates/perry-codegen/src/expr/family_slot.rs:226— crates/perry-codegen/src/expr/family_slot.rs:226-244 | crates/perry-codegen/src/layout_desc/create_families.rs:1328-1346 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19 lines × 2) crates/perry-hir/src/egress.rs:259— crates/perry-hir/src/egress.rs:259-277 | crates/perry-hir/src/egress.rs:287-305 — both copies are in the same file, so extract the block into 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) crates/perry-hir/src/lower/expr_call/local_array_methods.rs:1140— crates/perry-hir/src/lower/expr_call/local_array_methods.rs:1140-1158 | crates/perry-hir/src/lower/expr_call/textencoder.rs:99-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) crates/perry-hir/src/lower/expr_call/native_module/imported_module_dispatch.rs:295— crates/perry-hir/src/lower/expr_call/native_module/imported_module_dispatch.rs:295-313 | crates/perry-hir/src/lower/expr_call/native_module/process_module.rs:372-390 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) crates/perry-codegen/src/lower_call/console_promise.rs:207— crates/perry-codegen/src/lower_call/console_promise.rs:207-225 | crates/perry-codegen/src/lower_call/console_promise.rs:366-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/perry-codegen/src/codegen/class_artifacts.rs:376— crates/perry-codegen/src/codegen/class_artifacts.rs:376-394 | crates/perry-codegen/src/codegen/class_artifacts.rs:500-518 — both copies are in the same file, so extract the block into 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) crates/perry-codegen/src/expr/property_get/helpers.rs:523— crates/perry-codegen/src/expr/property_get/helpers.rs:523-541 | crates/perry-codegen/src/expr/property_get/helpers.rs:625-643 — both copies are in the same file, so extract the block into 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) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:503— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:503-521 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:654-672 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (19 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1154— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1154-1172 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1502-1520 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (9–10 lines × 2) crates/perry-audio-miniaudio/src/lib.rs:826— crates/perry-audio-miniaudio/src/lib.rs:826-835 | crates/perry-audio-miniaudio/src/lib.rs:892-900 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/entry.rs:709— crates/perry-codegen/src/codegen/entry.rs:709-718 | crates/perry-codegen/src/codegen/entry/module_init.rs:194-202 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–10 lines × 2) crates/perry-codegen/src/expr/arrays_finds.rs:202— crates/perry-codegen/src/expr/arrays_finds.rs:202-210 | crates/perry-codegen/src/expr/u8_buffer_read.rs:244-253 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) crates/perry-codegen/src/expr/closure.rs:71— crates/perry-codegen/src/expr/closure.rs:71-79 | crates/perry-hir/src/lower/lower_module_fn.rs:150-159 — 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–10 lines × 2) crates/perry-codegen/src/expr/compare.rs:608— crates/perry-codegen/src/expr/compare.rs:608-617 | crates/perry-codegen/src/expr/compare.rs:1097-1105 — both copies are in the same file, so extract the block into 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/perry-codegen/src/expr/index_set_guarded.rs:122— crates/perry-codegen/src/expr/index_set_guarded.rs:122-130 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:182-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–10 lines × 2) crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:600— crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:600-608 | crates/perry-codegen/src/expr/string_length.rs:59-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–10 lines × 2) crates/perry-codegen/src/expr/string_regex_proc.rs:62— crates/perry-codegen/src/expr/string_regex_proc.rs:62-71 | crates/perry-codegen/src/expr/string_regex_proc.rs:78-86 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/element_shape_loop.rs:1013— crates/perry-codegen/src/stmt/element_shape_loop.rs:1013-1022 | crates/perry-codegen/src/stmt/element_shape_loop.rs:1036-1044 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/stable_packed_loop.rs:737— crates/perry-codegen/src/stmt/stable_packed_loop.rs:737-745 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1111-1120 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/builder_fold.rs:600— crates/perry-hir/src/lower/builder_fold.rs:600-608 | crates/perry-hir/src/lower/builder_fold_width_hints.rs:353-362 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–10 lines × 2) scripts/parity_known_failures.py:484— scripts/parity_known_failures.py:484-492 | scripts/parity_known_failures.py:540-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/parity_known_failures.py:540` 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 (21 lines × 2) crates/perry-codegen/src/codegen/entry.rs:792— crates/perry-codegen/src/codegen/entry.rs:792-812 | crates/perry-codegen/src/codegen/entry/module_init.rs:275-295 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/codegen/indexed_method_artifacts.rs:100— crates/perry-codegen/src/codegen/indexed_method_artifacts.rs:100-120 | crates/perry-codegen/src/codegen/indexed_method_artifacts.rs:145-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/perry-codegen/src/expr/write_barrier.rs:221— crates/perry-codegen/src/expr/write_barrier.rs:221-241 | crates/perry-codegen/src/expr/write_barrier.rs:314-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/perry-codegen/src/layout_families.rs:803— crates/perry-codegen/src/layout_families.rs:803-823 | crates/perry-codegen/src/stmt/class_first_loop.rs:334-354 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (21 lines × 2) crates/perry-codegen/src/opt_report/mod.rs:971— crates/perry-codegen/src/opt_report/mod.rs:971-991 | crates/perry-codegen/src/opt_report/mod.rs:1081-1101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/perry-codegen/src/stmt/stable_packed_loop.rs:924— crates/perry-codegen/src/stmt/stable_packed_loop.rs:924-944 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1497-1517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/perry-hir/src/js_transform/local_natives.rs:1095— crates/perry-hir/src/js_transform/local_natives.rs:1095-1115 | crates/perry-hir/src/js_transform/local_natives.rs:1120-1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:572— crates/perry-hir/src/lower/stmt_loops.rs:572-592 | crates/perry-hir/src/lower_decl/body_stmt/for_await.rs:15-35 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt/for_await.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower_decl/class_decl.rs:911— crates/perry-hir/src/lower_decl/class_decl.rs:911-931 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:489-509 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-hir/src/lower_decl/class_decl/member_helpers.rs:102— crates/perry-hir/src/lower_decl/class_decl/member_helpers.rs:102-122 | crates/perry-hir/src/lower_decl/class_decl/member_registration.rs:14-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21 lines × 2) crates/perry-hir/src/lower_decl/class_members.rs:1141— crates/perry-hir/src/lower_decl/class_members.rs:1141-1161 | crates/perry-hir/src/lower_decl/private_members.rs:438-458 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) crates/perry-codegen-glance/src/emit.rs:86— crates/perry-codegen-glance/src/emit.rs:86-92 | crates/perry-codegen-glance/src/emit_glue.rs:153-159 | crates/perry-codegen-wear-tiles/src/emit.rs:103-109 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:95-101 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) crates/perry-codegen/src/codegen/closure.rs:255— crates/perry-codegen/src/codegen/closure.rs:255-261 | crates/perry-codegen/src/codegen/closure.rs:307-313 | crates/perry-codegen/src/codegen/closure.rs:353-359 | crates/perry-codegen/src/codegen/closure.rs:399-405 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:23— crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:23-29 | crates/perry-codegen/src/expr/typed_feedback.rs:207-213 | crates/perry-codegen/src/module.rs:901-907 | crates/perry-codegen/src/strings.rs:333-339 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (7 lines × 4) crates/perry-codegen/src/expr/array_pop.rs:79— crates/perry-codegen/src/expr/array_pop.rs:79-86 | crates/perry-codegen/src/expr/class_field_push.rs:51-57 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:244-251 | crates/perry-codegen/src/stmt/loops.rs:3317-3323 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/class_field_push.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 (7 lines × 4) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:72— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:72-78 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:110-116 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:241-247 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:316-322 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) crates/perry-codegen/src/expr/range_facts.rs:633— crates/perry-codegen/src/expr/range_facts.rs:633-639 | crates/perry-codegen/src/expr/range_facts.rs:976-982 | crates/perry-codegen/src/stmt/loops.rs:8346-8352 | crates/perry-codegen/src/stmt/loops.rs:8433-8439 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) crates/perry-codegen/src/linker.rs:1517— crates/perry-codegen/src/linker.rs:1517-1523 | crates/perry-hir/src/lower/const_fold_fn.rs:117-123 | crates/perry-hir/src/lower/fn_ctor_env.rs:248-254 | crates/perry-runtime-manifest/src/realm_json.rs:38-44 — before extracting anything, compare `crates/perry-hir/src/lower/const_fold_fn.rs` and `crates/perry-hir/src/lower/fn_ctor_env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) crates/perry-codegen/src/stmt/loops.rs:8306— crates/perry-codegen/src/stmt/loops.rs:8306-8312 | crates/perry-codegen/src/stmt/loops.rs:8411-8417 | crates/perry-codegen/src/stmt/loops.rs:8528-8534 | crates/perry-codegen/src/stmt/loops.rs:8588-8594 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) crates/perry-hir/src/lower_decl/class_members.rs:530— crates/perry-hir/src/lower_decl/class_members.rs:530-536 | crates/perry-hir/src/lower_decl/class_members.rs:941-947 | crates/perry-hir/src/lower_decl/private_members.rs:119-125 | crates/perry-hir/src/lower_decl/private_members.rs:334-340 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) crates/perry-codegen/src/expr/calls/fs.rs:30— crates/perry-codegen/src/expr/calls/fs.rs:30-36 | crates/perry-codegen/src/expr/calls/fs.rs:48-54 | crates/perry-codegen/src/expr/calls/fs.rs:359-365 | crates/perry-codegen/src/expr/calls/fs.rs:461-467 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) crates/perry-ext-argon2/src/lib.rs:25— crates/perry-ext-argon2/src/lib.rs:25-31 | crates/perry-ext-argon2/src/lib.rs:83-89 | crates/perry-ext-bcrypt/src/lib.rs:49-55 | crates/perry-ext-bcrypt/src/lib.rs:76-82 — 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.
perry_ext_net::payload_socket::get (cyclomatic 54) crates/perry-ext-net/src/payload_socket.rs:1466— perry_ext_net::payload_socket::get has cyclomatic complexity 54 (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.
perry_ext_net::payload_io::sink (cyclomatic 45) crates/perry-ext-net/src/payload_io.rs:50— perry_ext_net::payload_io::sink 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.
perry_ext_net::tls::js_tls_connect (cyclomatic 30) crates/perry-ext-net/src/tls.rs:625— perry_ext_net::tls::js_tls_connect 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.
perry_ext_net::payload_tls::drive (cyclomatic 29) crates/perry-ext-net/src/payload_tls.rs:328— perry_ext_net::payload_tls::drive 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.
perry_ext_net::payload_socket::destroy (cyclomatic 27) crates/perry-ext-net/src/payload_socket.rs:542— perry_ext_net::payload_socket::destroy 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.
perry_ext_net::payload_socket::write (cyclomatic 25) crates/perry-ext-net/src/payload_socket.rs:977— perry_ext_net::payload_socket::write 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.
perry_ext_net::turnloop_tls::step (cyclomatic 25) crates/perry-ext-net/src/turnloop_tls.rs:351— perry_ext_net::turnloop_tls::step 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.
perry_ext_net::classes::parse_rule_string (cyclomatic 20) crates/perry-ext-net/src/classes.rs:273— perry_ext_net::classes::parse_rule_string 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.
perry_ext_net::payload_socket::connect (cyclomatic 20) crates/perry-ext-net/src/payload_socket.rs:280— perry_ext_net::payload_socket::connect 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.
perry_ext_net::payload_socket::end (cyclomatic 20) crates/perry-ext-net/src/payload_socket.rs:1227— perry_ext_net::payload_socket::end 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.
Build::expr (cognitive 101) crates/perry-codegen/src/codegen/source_need/flow.rs:888— Build::expr has cognitive complexity 101 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 13 (30 pts), match/switch 9 (19 pts), boolean chains 6 (nesting depth added 51). 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.
Build::expr_kind (cognitive 54) crates/perry-codegen/src/codegen/reach_report.rs:314— Build::expr_kind has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 7 (24 pts), boolean chains 2, 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.
Build::stmt (cognitive 44) crates/perry-codegen/src/codegen/source_need/flow.rs:553— Build::stmt has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Build::call (cognitive 43) crates/perry-codegen/src/codegen/source_need/flow.rs:772— Build::call has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (8 pts), boolean chains 7, match/switch 1 (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.
Build::solve (cognitive 37) crates/perry-codegen/src/codegen/source_need/flow.rs:1836— Build::solve has cognitive complexity 37 (threshold 15). Drivers by points: loops 11 (19 pts), if/else 5 (14 pts), match/switch 1 (3 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.
Build::class (cognitive 30) crates/perry-codegen/src/codegen/source_need/flow.rs:1360— Build::class has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 8 (11 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.
Build::resolve_name (cognitive 29) crates/perry-codegen/src/codegen/source_need/flow.rs:402— Build::resolve_name has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (7 pts), loops 2 (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.
Build::named (cognitive 27) crates/perry-codegen/src/codegen/reach_report.rs:251— Build::named has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 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.
Build::export_function (cognitive 18) crates/perry-codegen/src/codegen/source_need/flow.rs:453— Build::export_function has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Build::import_function (cognitive 16) crates/perry-codegen/src/codegen/source_need/flow.rs:497— Build::import_function has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 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.
Duplicated block (7–9 lines × 2) crates/perry-codegen/src/block.rs:1699— crates/perry-codegen/src/block.rs:1699-1707 | crates/perry-codegen/src/block.rs:1753-1759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/perry-codegen/src/codegen/export_value_wrappers.rs:251— crates/perry-codegen/src/codegen/export_value_wrappers.rs:251-257 | crates/perry-codegen/src/codegen/export_value_wrappers.rs:356-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/perry-codegen/src/stmt/loops.rs:7643— crates/perry-codegen/src/stmt/loops.rs:7643-7649 | crates/perry-codegen/src/stmt/loops.rs:7655-7663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/perry-container-compose/src/service.rs:4— crates/perry-container-compose/src/service.rs:4-10 | crates/perry-container-compose/src/service.rs:21-29 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/perry-ext-parcel-watcher/src/lib.rs:551— crates/perry-ext-parcel-watcher/src/lib.rs:551-559 | crates/perry-ext-parcel-watcher/src/lib.rs:577-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/perry-hir/src/destructuring/var_decl/native_new.rs:242— crates/perry-hir/src/destructuring/var_decl/native_new.rs:242-248 | crates/perry-hir/src/lower/module_decl.rs:1127-1135 — 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–9 lines × 2) crates/perry-hir/src/js_transform/imports.rs:554— crates/perry-hir/src/js_transform/imports.rs:554-562 | crates/perry-hir/src/js_transform/imports.rs:631-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/perry-hir/src/lower/expr_call/native_module.rs:562— crates/perry-hir/src/lower/expr_call/native_module.rs:562-570 | crates/perry-hir/src/lower/expr_call/native_module/buffer_statics.rs:176-182 — 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–9 lines × 2) crates/perry-hir/src/lower_decl/block.rs:178— crates/perry-hir/src/lower_decl/block.rs:178-186 | crates/perry-hir/src/lower_decl/block/switch_case_tdz.rs:69-75 — 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–9 lines × 2) scripts/compiler_output_harness/repsel_knob_isolation.py:553— scripts/compiler_output_harness/repsel_knob_isolation.py:553-561 | scripts/compiler_output_harness/repsel_knob_isolation.py:603-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/compiler_output_harness/repsel_knob_isolation.py: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.
Low cohesion: WasiFilesystemCtxView (LCOM4 26) crates/perry-wasi/src/filesystem.rs:73— WasiFilesystemCtxView's methods fall into 26 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 26 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: LoweringContext (LCOM4 18) crates/perry-hir/src/lower/lowering_context.rs:130— LoweringContext's methods fall into 18 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 18 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: FnCtx (LCOM4 6) crates/perry-codegen/src/expr/mod.rs:367— FnCtx's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ComposeService (LCOM4 5) crates/perry-container-compose/src/types.rs:477— ComposeService'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: Scan (LCOM4 5) crates/perry-hir/src/lower/pre_scan/function_ctor_reach.rs:84— Scan'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: State (LCOM4 4) crates/perry-component-host/src/sync_wasi/mod.rs:62— State's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Accessor (LCOM4 4) crates/perry-runtime/src/object/accessor_pair.rs:60— Accessor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: NetCompletion (LCOM4 4) crates/perry-runtime/src/turnloop_net/sink.rs:115— NetCompletion's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WasiRandomCtx (LCOM4 4) crates/perry-wasi/src/random.rs:54— WasiRandomCtx's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AsyncIo (LCOM4 4) third_party/turnloop/turnloop/src/executor.rs:707— AsyncIo'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.
FuncEmitCtx::try_emit_expr_calls (cognitive 158) crates/perry-codegen-wasm/src/emit/expr/calls.rs:9— FuncEmitCtx::try_emit_expr_calls has cognitive complexity 158 (threshold 15). Drivers by points: loops 17 (75 pts), if/else 21 (64 pts), match/switch 6 (18 pts), boolean chains 1 (nesting depth added 113). 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.
FuncEmitCtx::try_emit_expr_classes (cognitive 136) crates/perry-codegen-wasm/src/emit/expr/classes.rs:9— FuncEmitCtx::try_emit_expr_classes has cognitive complexity 136 (threshold 15). Drivers by points: if/else 35 (74 pts), loops 14 (54 pts), match/switch 4 (8 pts) (nesting depth added 83). 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.
FuncEmitCtx::emit_stmt (cognitive 101) crates/perry-codegen-wasm/src/emit/stmt.rs:10— FuncEmitCtx::emit_stmt has cognitive complexity 101 (threshold 15). Drivers by points: if/else 38 (70 pts), loops 11 (29 pts), boolean chains 1, match/switch 1 (nesting depth added 50). 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.
FuncEmitCtx::try_emit_expr_native_method (cognitive 81) crates/perry-codegen-wasm/src/emit/expr/native_method.rs:9— FuncEmitCtx::try_emit_expr_native_method has cognitive complexity 81 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 6 (23 pts), match/switch 7 (19 pts) (nesting depth added 53). 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.
FuncEmitCtx::try_emit_expr_literals_vars (cognitive 63) crates/perry-codegen-wasm/src/emit/expr/literals_vars.rs:9— FuncEmitCtx::try_emit_expr_literals_vars has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 11 (22 pts), loops 1 (2 pts) (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FuncEmitCtx::try_emit_expr_objects (cognitive 41) crates/perry-codegen-wasm/src/emit/expr/objects.rs:9— FuncEmitCtx::try_emit_expr_objects has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 5 (8 pts), loops 3 (6 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.
FuncEmitCtx::try_emit_expr_buffers (cognitive 36) crates/perry-codegen-wasm/src/emit/expr/buffers.rs:9— FuncEmitCtx::try_emit_expr_buffers has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FuncEmitCtx::try_emit_expr_arrays (cognitive 29) crates/perry-codegen-wasm/src/emit/expr/arrays.rs:9— FuncEmitCtx::try_emit_expr_arrays has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 2 (4 pts), match/switch 2 (4 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.
FuncEmitCtx::try_emit_expr_math (cognitive 19) crates/perry-codegen-wasm/src/emit/expr/math.rs:9— FuncEmitCtx::try_emit_expr_math has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (9 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.
perry_codegen_wasm::minify::minify_js (cognitive 86) crates/perry-codegen-wasm/src/minify.rs:10— perry_codegen_wasm::minify::minify_js has cognitive complexity 86 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 8 (24 pts), boolean chains 14, match/switch 1 (2 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.
perry_codegen_wasm::emit::locals::resolve_export_to_func (cognitive 80) crates/perry-codegen-wasm/src/emit/locals.rs:418— perry_codegen_wasm::emit::locals::resolve_export_to_func has cognitive complexity 80 (threshold 15). Drivers by points: if/else 19 (67 pts), loops 6 (11 pts), match/switch 1 (2 pts) (nesting depth added 54). 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.
perry_codegen_wasm::emit::locals::resolve_export_to_let (cognitive 68) crates/perry-codegen-wasm/src/emit/locals.rs:312— perry_codegen_wasm::emit::locals::resolve_export_to_let has cognitive complexity 68 (threshold 15). Drivers by points: if/else 15 (57 pts), loops 4 (9 pts), match/switch 1 (2 pts) (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_codegen_wasm::emit::locals::collect_locals (cognitive 43) crates/perry-codegen-wasm/src/emit/locals.rs:109— perry_codegen_wasm::emit::locals::collect_locals has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 3 (7 pts), match/switch 1 (2 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.
perry_codegen_wasm::emit::closures::collect_closures_from_stmts (cognitive 30) crates/perry-codegen-wasm/src/emit/closures.rs:9— perry_codegen_wasm::emit::closures::collect_closures_from_stmts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (4 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.
perry_codegen_wasm::minify::copy_template_literal (cognitive 30) crates/perry-codegen-wasm/src/minify.rs:145— perry_codegen_wasm::minify::copy_template_literal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (9 pts), boolean chains 4, match/switch 1 (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.
perry_codegen_wasm::emit::closures::collect_closures_from_expr (cognitive 28) crates/perry-codegen-wasm/src/emit/closures.rs:92— perry_codegen_wasm::emit::closures::collect_closures_from_expr has cognitive complexity 28 (threshold 15). Drivers by points: loops 8 (16 pts), if/else 5 (11 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
perry_codegen_wasm::emit::scoped_js::scoped_js_names::visit (cognitive 28) crates/perry-codegen-wasm/src/emit/scoped_js.rs:23— perry_codegen_wasm::emit::scoped_js::scoped_js_names::visit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 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.
perry_codegen_wasm::emit::locals::resolve_source_module_idx (cognitive 19) crates/perry-codegen-wasm/src/emit/locals.rs:34— perry_codegen_wasm::emit::locals::resolve_source_module_idx has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 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.
Duplicated block (12 lines × 3) crates/perry-codegen-swiftui/src/emit.rs:287— crates/perry-codegen-swiftui/src/emit.rs:287-298 | crates/perry-codegen-swiftui/src/emit.rs:328-339 | crates/perry-codegen-swiftui/src/emit.rs:420-431 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/perry-codegen/src/collectors/escape_check.rs:1060— crates/perry-codegen/src/collectors/escape_check.rs:1060-1071 | crates/perry-codegen/src/collectors/escape_check.rs:1073-1084 | crates/perry-codegen/src/collectors/escape_check.rs:1103-1114 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/perry-codegen/src/collectors/escape_news.rs:780— crates/perry-codegen/src/collectors/escape_news.rs:780-791 | crates/perry-codegen/src/collectors/escape_news.rs:793-804 | crates/perry-codegen/src/collectors/escape_news.rs:823-834 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/perry-codegen/src/stmt/loops.rs:4010— crates/perry-codegen/src/stmt/loops.rs:4010-4021 | crates/perry-codegen/src/stmt/loops.rs:4056-4067 | crates/perry-codegen/src/stmt/loops.rs:4112-4123 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/perry-container-compose/src/backend/detect.rs:33— crates/perry-container-compose/src/backend/detect.rs:33-44 | crates/perry-container-compose/src/backend/detect.rs:55-66 | crates/perry-container-compose/src/backend/detect.rs:96-107 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/perry-codegen/src/expr/this_super_call.rs:482— crates/perry-codegen/src/expr/this_super_call.rs:482-497 | crates/perry-codegen/src/expr/this_super_call.rs:515-526 | crates/perry-codegen/src/expr/this_super_call.rs:548-559 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/perry-codegen/src/stmt/indexed_owner_loop.rs:1516— crates/perry-codegen/src/stmt/indexed_owner_loop.rs:1516-1530 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1806-1817 | crates/perry-codegen/src/stmt/versioned_indexed_loop.rs:709-720 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (12 lines × 3) crates/perry-hir/src/lower/expr_call/module_class_static.rs:110— crates/perry-hir/src/lower/expr_call/module_class_static.rs:110-122 | crates/perry-hir/src/lower/expr_call/native_module/imported_module_dispatch.rs:284-296 | crates/perry-hir/src/lower/expr_member/member_tail.rs:783-794 — 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 (12 lines × 3) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:98— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:98-109 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:98-109 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:100-111 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–11 lines × 2) crates/perry-codegen/src/concat_site_cache.rs:209— crates/perry-codegen/src/concat_site_cache.rs:209-219 | crates/perry-codegen/src/expr/number_to_string_inline.rs:50-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.
Duplicated block (10–11 lines × 2) crates/perry-codegen/src/concat_site_cache.rs:234— crates/perry-codegen/src/concat_site_cache.rs:234-243 | crates/perry-codegen/src/concat_site_cache.rs:249-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/perry-codegen/src/expr/proven_view_access.rs:310— crates/perry-codegen/src/expr/proven_view_access.rs:310-320 | crates/perry-codegen/src/expr/proven_view_access.rs:629-638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/perry-codegen/src/linker.rs:973— crates/perry-codegen/src/linker.rs:973-982 | crates/perry-codegen/src/linker.rs:1042-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/perry-codegen/src/lower_call/field_init.rs:953— crates/perry-codegen/src/lower_call/field_init.rs:953-963 | crates/perry-codegen/src/lower_call/field_init.rs:1014-1023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/perry-codegen/src/lower_call/options/fetch.rs:811— crates/perry-codegen/src/lower_call/options/fetch.rs:811-821 | crates/perry-codegen/src/lower_call/options/fetch.rs:1050-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/perry-codegen/src/lower_string_method.rs:1259— crates/perry-codegen/src/lower_string_method.rs:1259-1268 | crates/perry-codegen/src/lower_string_method.rs:1314-1324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/perry-hir/src/lower/expr_new.rs:1876— crates/perry-hir/src/lower/expr_new.rs:1876-1886 | crates/perry-hir/src/lower/expr_new/non_ident.rs:196-205 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1663— crates/perry-hir/src/lower/stmt_loops.rs:1663-1672 | crates/perry-hir/src/lower_decl/body_stmt.rs:2141-2151 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen-glance/src/emit.rs:719— crates/perry-codegen-glance/src/emit.rs:719-727 | crates/perry-codegen-glance/src/emit_glue.rs:166-174 | crates/perry-codegen-wear-tiles/src/emit.rs:479-487 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:108-116 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen/src/codegen/method.rs:1359— crates/perry-codegen/src/codegen/method.rs:1359-1367 | crates/perry-codegen/src/codegen/method.rs:1437-1445 | crates/perry-codegen/src/expr/write_barrier.rs:1183-1191 | crates/perry-codegen/src/lower_call/new.rs:1818-1826 — 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 (9 lines × 4) crates/perry-codegen/src/codegen/mod.rs:2074— crates/perry-codegen/src/codegen/mod.rs:2074-2082 | crates/perry-codegen/src/codegen/mod.rs:2093-2101 | crates/perry-codegen/src/codegen/mod.rs:2112-2120 | crates/perry-codegen/src/codegen/mod.rs:2131-2139 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) crates/perry-codegen/src/codegen/mod.rs:2276— crates/perry-codegen/src/codegen/mod.rs:2276-2284 | crates/perry-codegen/src/codegen/mod.rs:2323-2331 | crates/perry-codegen/src/codegen/mod.rs:2344-2352 | crates/perry-codegen/src/codegen/mod.rs:2365-2373 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) crates/perry-codegen/src/expr/bigint_set.rs:220— crates/perry-codegen/src/expr/bigint_set.rs:220-228 | crates/perry-codegen/src/expr/bigint_set.rs:287-295 | crates/perry-codegen/src/expr/logical_collections.rs:510-518 | crates/perry-codegen/src/expr/math_simple.rs:395-403 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) crates/perry-codegen/src/lower_call/builtin.rs:779— crates/perry-codegen/src/lower_call/builtin.rs:779-787 | crates/perry-codegen/src/lower_call/builtin.rs:800-808 | crates/perry-codegen/src/lower_call/builtin.rs:821-829 | crates/perry-codegen/src/lower_call/builtin.rs:927-935 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) crates/perry-hir/src/monomorph/driver.rs:667— crates/perry-hir/src/monomorph/driver.rs:667-675 | crates/perry-hir/src/monomorph/update_call_sites.rs:504-512 | crates/perry-hir/src/walker/expr_mut.rs:181-189 | crates/perry-hir/src/walker/expr_ref.rs:182-190 — before extracting anything, compare `crates/perry-hir/src/monomorph/driver.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 578 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) scripts/component_async_acceptance.py:39— scripts/component_async_acceptance.py:39-47 | scripts/component_persistent_acceptance.py:30-38 | scripts/component_producer_acceptance.py:39-47 | scripts/component_reader_acceptance.py:37-45 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/component_async_acceptance.py:39` it does not close everything it opens, so those exact lines 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) scripts/component_async_acceptance.py:73— scripts/component_async_acceptance.py:73-81 | scripts/component_persistent_acceptance.py:64-72 | scripts/component_producer_acceptance.py:76-84 | scripts/component_reader_acceptance.py:74-82 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/component_async_acceptance.py:73` it does not close everything it opens, so those exact lines 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/perry-codegen/src/expr/compare.rs:124— crates/perry-codegen/src/expr/compare.rs:124-129 | crates/perry-codegen/src/expr/compare.rs:503-508 | crates/perry-codegen/src/expr/compare.rs:1107-1112 | crates/perry-codegen/src/expr/suffix_cursor.rs:48-53 — before extracting anything, compare `crates/perry-codegen/src/expr/compare.rs` and `crates/perry-codegen/src/expr/suffix_cursor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) crates/perry-codegen/src/lower_call/early_branches.rs:918— crates/perry-codegen/src/lower_call/early_branches.rs:918-923 | crates/perry-codegen/src/lower_call/early_branches.rs:1129-1134 | crates/perry-codegen/src/lower_call/func_ref.rs:1228-1233 | crates/perry-codegen/src/lower_call/func_ref.rs:1397-1402 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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 (6 lines × 4) crates/perry-ext-net/src/payload_abi.rs:319— crates/perry-ext-net/src/payload_abi.rs:319-324 | crates/perry-ext-net/src/payload_abi.rs:334-339 | crates/perry-ext-net/src/payload_abi.rs:375-380 | crates/perry-ext-net/src/payload_abi.rs:390-395 — 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/perry-ext-net/src/payload_events.rs:146— crates/perry-ext-net/src/payload_events.rs:146-151 | crates/perry-ext-net/src/payload_events.rs:189-194 | crates/perry-ext-net/src/payload_server.rs:359-365 | crates/perry-ext-net/src/payload_socket.rs:929-936 — before extracting anything, compare `crates/perry-ext-net/src/payload_server.rs` and `crates/perry-ext-net/src/payload_socket.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) crates/perry-hir/src/lower/expr_call/mod.rs:193— crates/perry-hir/src/lower/expr_call/mod.rs:193-198 | crates/perry-hir/src/lower/expr_call/native_module.rs:58-63 | crates/perry-hir/src/lower/expr_call/os.rs:88-93 | crates/perry-hir/src/lower/expr_member.rs:70-75 — 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 (6 lines × 4) crates/perry-hir/src/lower/expr_object.rs:873— crates/perry-hir/src/lower/expr_object.rs:873-882 | crates/perry-hir/src/lower/expr_object.rs:1100-1107 | crates/perry-hir/src/lower/expr_object.rs:1509-1514 | crates/perry-hir/src/lower/lower_expr/arm_ident.rs:186-191 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) crates/perry-hir/src/lower/module_decl.rs:593— crates/perry-hir/src/lower/module_decl.rs:593-598 | crates/perry-hir/src/lower/module_decl.rs:1715-1720 | crates/perry-hir/src/lower/module_decl.rs:1794-1799 | crates/perry-hir/src/lower/stmt.rs:438-443 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1335— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1335-1340 | android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1392-1397 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1913-1918 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1968-1973 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1335` 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) scripts/component_async_acceptance.py:48— scripts/component_async_acceptance.py:48-53 | scripts/component_persistent_acceptance.py:39-44 | scripts/component_producer_acceptance.py:48-53 | scripts/component_reader_acceptance.py:46-51 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/component_async_acceptance.py:48` 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.
JsEmitter::emit_expr (cyclomatic 319) crates/perry-codegen-js/src/emit/exprs.rs:65— JsEmitter::emit_expr has cyclomatic complexity 319 (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.
JsEmitter::emit_expr_continued (cyclomatic 303) crates/perry-codegen-js/src/emit/exprs_more.rs:19— JsEmitter::emit_expr_continued has cyclomatic complexity 303 (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.
JsEmitter::emit_ui_method_call (cyclomatic 172) crates/perry-codegen-js/src/emit/calls.rs:125— JsEmitter::emit_ui_method_call has cyclomatic complexity 172 (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.
JsEmitter::emit_native_method_call (cyclomatic 71) crates/perry-codegen-js/src/emit/native.rs:7— JsEmitter::emit_native_method_call has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsEmitter::emit_stmt (cyclomatic 42) crates/perry-codegen-js/src/emit/stmts.rs:7— JsEmitter::emit_stmt 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.
JsEmitter::emit_system_method_call (cyclomatic 22) crates/perry-codegen-js/src/emit/calls.rs:16— JsEmitter::emit_system_method_call 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.
JsEmitter::emit_class (cyclomatic 21) crates/perry-codegen-js/src/emit/decls.rs:56— JsEmitter::emit_class has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
JsEmitter::emit_module (cyclomatic 21) crates/perry-codegen-js/src/emit/mod.rs:91— JsEmitter::emit_module has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_codegen_wasm::minify::minify_js (cyclomatic 43) crates/perry-codegen-wasm/src/minify.rs:10— perry_codegen_wasm::minify::minify_js 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.
perry_codegen_wasm::emit::closures::collect_closures_from_expr (cyclomatic 39) crates/perry-codegen-wasm/src/emit/closures.rs:92— perry_codegen_wasm::emit::closures::collect_closures_from_expr 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.
perry_codegen_wasm::emit::locals::resolve_export_to_func (cyclomatic 27) crates/perry-codegen-wasm/src/emit/locals.rs:418— perry_codegen_wasm::emit::locals::resolve_export_to_func 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.
perry_codegen_wasm::emit::locals::collect_locals (cyclomatic 23) crates/perry-codegen-wasm/src/emit/locals.rs:109— perry_codegen_wasm::emit::locals::collect_locals 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.
perry_codegen_wasm::emit::closures::collect_closures_from_stmts (cyclomatic 21) crates/perry-codegen-wasm/src/emit/closures.rs:9— perry_codegen_wasm::emit::closures::collect_closures_from_stmts 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.
perry_codegen_wasm::emit::locals::resolve_export_to_let (cyclomatic 21) crates/perry-codegen-wasm/src/emit/locals.rs:312— perry_codegen_wasm::emit::locals::resolve_export_to_let 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.
perry_codegen_wasm::emit::scoped_js::scoped_js_names::visit (cyclomatic 18) crates/perry-codegen-wasm/src/emit/scoped_js.rs:23— perry_codegen_wasm::emit::scoped_js::scoped_js_names::visit 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.
perry_codegen_wasm::minify::copy_template_literal (cyclomatic 17) crates/perry-codegen-wasm/src/minify.rs:145— perry_codegen_wasm::minify::copy_template_literal 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.
perry_ui_ios::state::state_set (cyclomatic 22) crates/perry-ui-ios/src/state.rs:147— perry_ui_ios::state::state_set 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.
perry_ui_ios::audio_playback::perry_audio_load_sound (cyclomatic 20) crates/perry-ui-ios/src/audio_playback.rs:257— perry_ui_ios::audio_playback::perry_audio_load_sound 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.
perry_ui_ios::audio_playback::perry_audio_play (cyclomatic 18) crates/perry-ui-ios/src/audio_playback.rs:418— perry_ui_ios::audio_playback::perry_audio_play 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.
perry_ui_ios::drag_drop::perform_drop_impl (cyclomatic 18) crates/perry-ui-ios/src/drag_drop.rs:149— perry_ui_ios::drag_drop::perform_drop_impl has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ui_ios::widgets::alert::topmost_view_controller (cyclomatic 18) crates/perry-ui-ios/src/widgets/alert.rs:37— perry_ui_ios::widgets::alert::topmost_view_controller 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.
perry_ui_ios::adaptive_layout::current_snapshot (cyclomatic 16) crates/perry-ui-ios/src/adaptive_layout.rs:120— perry_ui_ios::adaptive_layout::current_snapshot 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.
perry_ui_ios::app::key_window_root_vc (cyclomatic 16) crates/perry-ui-ios/src/app.rs:784— perry_ui_ios::app::key_window_root_vc 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.
perry_ui_ios::widgets::rich_tooltip::find_key_window (cyclomatic 16) crates/perry-ui-ios/src/widgets/rich_tooltip.rs:263— perry_ui_ios::widgets::rich_tooltip::find_key_window 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.
perry_gc_effects::graph::classify (cognitive 216) crates/perry-gc-effects/src/graph.rs:335— perry_gc_effects::graph::classify has cognitive complexity 216 (threshold 15). Drivers by points: if/else 50 (134 pts), loops 31 (61 pts), boolean chains 21 (nesting depth added 114). 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.
perry_gc_effects::archive::build_graph (cognitive 82) crates/perry-gc-effects/src/archive.rs:307— perry_gc_effects::archive::build_graph has cognitive complexity 82 (threshold 15). Drivers by points: if/else 15 (52 pts), loops 5 (13 pts), match/switch 3 (11 pts), boolean chains 6 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_gc_effects::instructions::analyze_node (cognitive 67) crates/perry-gc-effects/src/instructions.rs:618— perry_gc_effects::instructions::analyze_node has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (49 pts), boolean chains 9, loops 3 (9 pts) (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.
perry_gc_effects::instructions::idiom (cognitive 39) crates/perry-gc-effects/src/instructions.rs:539— perry_gc_effects::instructions::idiom has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 13, loops 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.
perry_gc_effects::archive::parse_section (cognitive 36) crates/perry-gc-effects/src/archive.rs:150— perry_gc_effects::archive::parse_section has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (6 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.
perry_gc_effects::instructions::writes (cognitive 36) crates/perry-gc-effects/src/instructions.rs:127— perry_gc_effects::instructions::writes has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 10, match/switch 1 (3 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.
perry_gc_effects::archive::decode_sections (cognitive 30) crates/perry-gc-effects/src/archive.rs:239— perry_gc_effects::archive::decode_sections has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (6 pts), match/switch 1 (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.
perry_gc_effects::instructions::flow (cognitive 27) crates/perry-gc-effects/src/instructions.rs:281— perry_gc_effects::instructions::flow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (24 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.
JsEmitter::emit_expr (cognitive 212) crates/perry-codegen-js/src/emit/exprs.rs:65— JsEmitter::emit_expr has cognitive complexity 212 (threshold 15). Drivers by points: if/else 75 (152 pts), match/switch 14 (29 pts), loops 14 (28 pts), boolean chains 3 (nesting depth added 106). 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.
JsEmitter::emit_native_method_call (cognitive 146) crates/perry-codegen-js/src/emit/native.rs:7— JsEmitter::emit_native_method_call has cognitive complexity 146 (threshold 15). Drivers by points: if/else 24 (82 pts), loops 20 (56 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 97). 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.
JsEmitter::emit_expr_continued (cognitive 129) crates/perry-codegen-js/src/emit/exprs_more.rs:19— JsEmitter::emit_expr_continued has cognitive complexity 129 (threshold 15). Drivers by points: if/else 42 (94 pts), loops 15 (32 pts), match/switch 2 (3 pts) (nesting depth added 70). 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.
JsEmitter::emit_stmt (cognitive 66) crates/perry-codegen-js/src/emit/stmts.rs:7— JsEmitter::emit_stmt has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 10 (24 pts), match/switch 2 (4 pts) (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.
JsEmitter::emit_ui_method_call (cognitive 35) crates/perry-codegen-js/src/emit/calls.rs:125— JsEmitter::emit_ui_method_call has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (8 pts), 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.
JsEmitter::emit_class (cognitive 34) crates/perry-codegen-js/src/emit/decls.rs:56— JsEmitter::emit_class has cognitive complexity 34 (threshold 15). Drivers by points: loops 11 (17 pts), if/else 9 (16 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.
JsEmitter::emit_module (cognitive 27) crates/perry-codegen-js/src/emit/mod.rs:91— JsEmitter::emit_module has cognitive complexity 27 (threshold 15). Drivers by points: loops 14 (16 pts), if/else 6 (10 pts), boolean chains 1 (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.
JsEmitter::emit_params (cognitive 23) crates/perry-codegen-js/src/emit/decls.rs:254— JsEmitter::emit_params has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_component_host::task_exit::instrument::instrument (cognitive 112) crates/perry-component-host/src/task_exit/instrument.rs:21— perry_component_host::task_exit::instrument::instrument has cognitive complexity 112 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 10 (22 pts), match/switch 8 (22 pts), boolean chains 6 (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.
perry_component_host::driver::async_values::execute (cognitive 47) crates/perry-component-host/src/driver/async_values.rs:42— perry_component_host::driver::async_values::execute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 30 (38 pts), match/switch 3 (7 pts), boolean chains 2 (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.
perry_component_host::driver::writers::execute (cognitive 40) crates/perry-component-host/src/driver/writers.rs:14— perry_component_host::driver::writers::execute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27 (38 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.
perry_component_host::driver::resources::execute (cognitive 26) crates/perry-component-host/src/driver/resources.rs:15— perry_component_host::driver::resources::execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 2 (4 pts), boolean chains 3, 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.
perry_component_host::ffi::new_bridge (cognitive 25) crates/perry-component-host/src/ffi.rs:210— perry_component_host::ffi::new_bridge has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_component_host::async_values::reader_cleanup::visitors::emit (cognitive 22) crates/perry-component-host/src/async_values/reader_cleanup.rs:8— perry_component_host::async_values::reader_cleanup::visitors::emit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 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.
perry_component_host::async_values::reader::generate (cognitive 20) crates/perry-component-host/src/async_values/reader.rs:15— perry_component_host::async_values::reader::generate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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.
perry_component_host::driver::run (cognitive 20) crates/perry-component-host/src/driver.rs:269— perry_component_host::driver::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ui_watchos::audio_playback::drain_pending_callbacks (cognitive 30) crates/perry-ui-watchos/src/audio_playback.rs:638— perry_ui_watchos::audio_playback::drain_pending_callbacks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_watchos::audio_playback::reapply_solo_state (cognitive 30) crates/perry-ui-watchos/src/audio_playback.rs:1159— perry_ui_watchos::audio_playback::reapply_solo_state has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (10 pts), loops 3 (6 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.
perry_ui_watchos::system::perry_system_preferences_get (cognitive 28) crates/perry-ui-watchos/src/system.rs:57— perry_ui_watchos::system::perry_system_preferences_get has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (28 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ui_watchos::audio_playback::perry_audio_play (cognitive 27) crates/perry-ui-watchos/src/audio_playback.rs:418— perry_ui_watchos::audio_playback::perry_audio_play has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 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, 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.
perry_ui_watchos::audio_playback::perry_audio_load_sound (cognitive 25) crates/perry-ui-watchos/src/audio_playback.rs:257— perry_ui_watchos::audio_playback::perry_audio_load_sound has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 4 (6 pts), boolean chains 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.
perry_ui_watchos::state::state_set (cognitive 25) crates/perry-ui-watchos/src/state.rs:174— perry_ui_watchos::state::state_set has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 7 (12 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.
perry_ui_watchos::media_playback::poll_tick (cognitive 18) crates/perry-ui-watchos/src/media_playback.rs:684— perry_ui_watchos::media_playback::poll_tick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
perry_ui_watchos::audio::start (cognitive 17) crates/perry-ui-watchos/src/audio.rs:28— perry_ui_watchos::audio::start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×8
Change-coupling hub: expr.rs → exprs_more.rs, escape_check.rs, escape_news.rs, refs.rs, expr_mut.rs, expr_ref.rs crates/perry-hir/src/stable_hash/expr.rs— `crates/perry-hir/src/stable_hash/expr.rs` changes together with 6 other files — `crates/perry-codegen-js/src/emit/exprs_more.rs`, `crates/perry-codegen/src/collectors/escape_check.rs`, `crates/perry-codegen/src/collectors/escape_news.rs`, `crates/perry-codegen/src/collectors/refs.rs`, `crates/perry-hir/src/walker/expr_mut.rs`, `crates/perry-hir/src/walker/expr_ref.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 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 6.
Change-coupling hub: expr_mut.rs → exprs_more.rs, escape_check.rs, escape_news.rs, refs.rs, expr_ref.rs crates/perry-hir/src/walker/expr_mut.rs— `crates/perry-hir/src/walker/expr_mut.rs` changes together with 5 other files — `crates/perry-codegen-js/src/emit/exprs_more.rs`, `crates/perry-codegen/src/collectors/escape_check.rs`, `crates/perry-codegen/src/collectors/escape_news.rs`, `crates/perry-codegen/src/collectors/refs.rs`, `crates/perry-hir/src/walker/expr_ref.rs` — 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: exprs_more.rs → escape_check.rs, escape_news.rs, expr_ref.rs crates/perry-codegen-js/src/emit/exprs_more.rs— `crates/perry-codegen-js/src/emit/exprs_more.rs` changes together with 3 other files — `crates/perry-codegen/src/collectors/escape_check.rs`, `crates/perry-codegen/src/collectors/escape_news.rs`, `crates/perry-hir/src/walker/expr_ref.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: substitute_expr.rs → escape_check.rs, escape_news.rs, refs.rs, analysis.rs, expr.rs, expr_mut.rs, expr_ref.rs crates/perry-hir/src/monomorph/substitute_expr.rs— `crates/perry-hir/src/monomorph/substitute_expr.rs` changes together with 7 other files — `crates/perry-codegen/src/collectors/escape_check.rs`, `crates/perry-codegen/src/collectors/escape_news.rs`, `crates/perry-codegen/src/collectors/refs.rs`, `crates/perry-hir/src/analysis.rs`, `crates/perry-hir/src/stable_hash/expr.rs`, `crates/perry-hir/src/walker/expr_mut.rs`, `crates/perry-hir/src/walker/expr_ref.rs` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 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 7.
Change-coupling hub: refs.rs → escape_check.rs, escape_news.rs, analysis.rs crates/perry-codegen/src/collectors/refs.rs— `crates/perry-codegen/src/collectors/refs.rs` changes together with 3 other files — `crates/perry-codegen/src/collectors/escape_check.rs`, `crates/perry-codegen/src/collectors/escape_news.rs`, `crates/perry-hir/src/analysis.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: entries.rs → REDACTED, native_module.rs, native_module_dispatch.rs, stdlib_features.rs crates/perry-api-manifest/src/entries.rs— `crates/perry-api-manifest/src/entries.rs` changes together with 4 other files — `crates/perry-codegen/src/lower_call/native_table/mod.rs`, `crates/perry-runtime/src/object/native_module.rs`, `crates/perry-runtime/src/object/native_module_dispatch.rs`, `crates/perry/src/commands/stdlib_features.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.
Change-coupling hub: http_server.rs → ext_registry.rs, stdlib_ffi.rs, lib.rs, handle_dispatch.rs, dispatch.rs crates/perry-codegen/src/lower_call/native_table/http_server.rs— `crates/perry-codegen/src/lower_call/native_table/http_server.rs` changes together with 5 other files — `crates/perry-codegen/src/ext_registry.rs`, `crates/perry-codegen/src/runtime_decls/stdlib_ffi.rs`, `crates/perry-ext-http/src/lib.rs`, `crates/perry-ext-http/src/server/handle_dispatch.rs`, `crates/perry-stdlib/src/common/dispatch.rs` — 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: dispatch_a_c.rs → part_4.rs, module_static.rs, callable_export_check.rs, module_keys.rs crates/perry-runtime/src/object/native_module_dispatch/dispatch_a_c.rs— `crates/perry-runtime/src/object/native_module_dispatch/dispatch_a_c.rs` changes together with 4 other files — `crates/perry-api-manifest/src/entries/part_4.rs`, `crates/perry-hir/src/lower/expr_call/module_static.rs`, `crates/perry-runtime/src/object/native_module/callable_export_check.rs`, `crates/perry-runtime/src/object/native_module/module_keys.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.
Duplicated block (12–13 lines × 2) crates/perry-codegen/src/collectors/escape_arrays.rs:654— crates/perry-codegen/src/collectors/escape_arrays.rs:654-666 | crates/perry-codegen/src/collectors/escape_objects.rs:496-507 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_arrays.rs` and `crates/perry-codegen/src/collectors/escape_objects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) crates/perry-codegen/src/collectors/loop_bounded_i32.rs:146— crates/perry-codegen/src/collectors/loop_bounded_i32.rs:146-158 | crates/perry-codegen/src/collectors/loop_bounded_i32.rs:262-273 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/ptr_numarray.rs:704— crates/perry-codegen/src/collectors/ptr_numarray.rs:704-716 | crates/perry-codegen/src/collectors/ptr_numarray.rs:731-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 (12–13 lines × 2) crates/perry-codegen/src/expr/dyn_extern_i18n.rs:1072— crates/perry-codegen/src/expr/dyn_extern_i18n.rs:1072-1083 | crates/perry-codegen/src/expr/property_get.rs:1313-1325 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–13 lines × 2) crates/perry-codegen/src/expr/helpers.rs:19— crates/perry-codegen/src/expr/helpers.rs:19-31 | crates/perry-codegen/src/type_analysis/pod.rs:434-445 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12–13 lines × 2) crates/perry-codegen/src/lower_call/new_alloc.rs:720— crates/perry-codegen/src/lower_call/new_alloc.rs:720-732 | crates/perry-codegen/src/lower_call/scalar_method.rs:603-614 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–13 lines × 2) crates/perry-hir/src/lower/expr_function.rs:455— crates/perry-hir/src/lower/expr_function.rs:455-467 | crates/perry-hir/src/lower/expr_function.rs:1422-1433 — both copies are in the same file, so extract the block into 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) test-compat/npm-sweep/run.py:370— test-compat/npm-sweep/run.py:370-381 | test-compat/npm-sweep/run.py:389-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `test-compat/npm-sweep/run.py:389` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 4) crates/perry-codegen/src/collectors/escape_arrays.rs:161— crates/perry-codegen/src/collectors/escape_arrays.rs:161-170 | crates/perry-codegen/src/collectors/escape_arrays.rs:308-317 | crates/perry-codegen/src/collectors/hot_callees.rs:699-708 | crates/perry-codegen/src/collectors/not_bigint_locals.rs:384-393 — 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 (10 lines × 4) crates/perry-codegen/src/collectors/escape_check.rs:328— crates/perry-codegen/src/collectors/escape_check.rs:328-337 | crates/perry-codegen/src/collectors/escape_news.rs:277-286 | crates/perry-codegen/src/collectors/escape_objects.rs:448-457 | crates/perry-codegen/src/collectors/ptr_shape.rs:1493-1502 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/escape_news.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:392— crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:392-401 | crates/perry-codegen/src/collectors/spec_abi_sites.rs:1451-1460 | crates/perry-codegen/src/collectors/straight_line_stores.rs:99-108 | crates/perry-hir/src/enums.rs:134-143 — 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 (10 lines × 4) crates/perry-codegen/src/expr/logical_collections.rs:530— crates/perry-codegen/src/expr/logical_collections.rs:530-539 | crates/perry-codegen/src/expr/math_simple.rs:251-260 | crates/perry-codegen/src/expr/math_simple.rs:346-355 | crates/perry-codegen/src/expr/math_simple.rs:413-422 — before extracting anything, compare `crates/perry-codegen/src/expr/logical_collections.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1190— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1190-1199 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1205-1214 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1220-1229 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1236-1246 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) crates/perry-hir/src/audit.rs:67— crates/perry-hir/src/audit.rs:67-81 | crates/perry-hir/src/capability.rs:112-121 | crates/perry-hir/src/egress.rs:104-113 | crates/perry-hir/src/lockdown.rs:63-72 — before extracting anything, compare `crates/perry-hir/src/audit.rs` and `crates/perry-hir/src/capability.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/perry-hir/src/lower/module_decl.rs:225— crates/perry-hir/src/lower/module_decl.rs:225-234 | crates/perry-hir/src/lower/module_decl.rs:242-251 | crates/perry-hir/src/lower/module_decl.rs:1443-1452 | crates/perry-hir/src/lower/module_decl.rs:1565-1574 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) crates/perry-hir/src/monomorph/infer.rs:274— crates/perry-hir/src/monomorph/infer.rs:274-283 | crates/perry-hir/src/monomorph/infer.rs:383-392 | crates/perry-hir/src/monomorph/update_call_sites.rs:589-598 | crates/perry-hir/src/monomorph/update_call_sites.rs:647-656 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/perry-codegen/src/expr/array_push_own.rs:127— crates/perry-codegen/src/expr/array_push_own.rs:127-131 | crates/perry-codegen/src/expr/method_site.rs:138-142 | crates/perry-codegen/src/expr/method_site.rs:641-645 | crates/perry-codegen/src/expr/method_site.rs:965-969 | crates/perry-codegen/src/expr/typed_element.rs:412-416 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) crates/perry-codegen/src/expr/method_site.rs:136— crates/perry-codegen/src/expr/method_site.rs:136-140 | crates/perry-codegen/src/expr/method_site.rs:639-643 | crates/perry-codegen/src/expr/method_site.rs:963-967 | crates/perry-codegen/src/expr/typed_element.rs:410-414 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch_select.rs:113-117 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) crates/perry-hir/src/destructuring/var_decl_sources.rs:196— crates/perry-hir/src/destructuring/var_decl_sources.rs:196-200 | crates/perry-hir/src/destructuring/var_decl_sources.rs:243-247 | crates/perry-hir/src/destructuring/var_decl_sources.rs:292-296 | crates/perry-hir/src/lower/stmt.rs:340-344 | crates/perry-hir/src/lower_decl/class_decl.rs:1191-1195 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) crates/perry-hir/src/lower/builder_fold.rs:1255— crates/perry-hir/src/lower/builder_fold.rs:1255-1259 | crates/perry-hir/src/lower/builder_fold.rs:1290-1294 | crates/perry-hir/src/lower/builder_fold.rs:1296-1300 | crates/perry-hir/src/lower/builder_fold.rs:1452-1456 | crates/perry-hir/src/lower/builder_fold.rs:1463-1468 — 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/perry-codegen/src/expr/array_length.rs:31— crates/perry-codegen/src/expr/array_length.rs:31-36 | crates/perry-codegen/src/expr/dispatch.rs:789-794 | crates/perry-codegen/src/expr/inline_birth.rs:46-50 | crates/perry-codegen/src/expr/layout_read.rs:270-275 | crates/perry-codegen/src/expr/mod.rs:2694-2699 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (5 lines × 5) scripts/addr_class_inventory.py:333— scripts/addr_class_inventory.py:333-337 | scripts/addr_class_inventory.py:695-699 | scripts/gc_store_site_inventory.py:263-267 | scripts/sso_unbox_inventory.py:387-391 | scripts/string_payload_access_inventory.py:246-250 — 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. 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 × 5) scripts/compiler_output_harness/repsel_knob_isolation.py:540— scripts/compiler_output_harness/repsel_knob_isolation.py:540-544 | scripts/compiler_output_harness/repsel_knob_isolation.py:551-555 | scripts/compiler_output_harness/repsel_knob_isolation.py:560-564 | scripts/compiler_output_harness/repsel_knob_isolation.py:601-605 | scripts/compiler_output_harness/repsel_knob_isolation.py:608-612 — 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) docs/audits/gc-rss-instructions-2026-10-03/summarize-gc-comparison.py:30— docs/audits/gc-rss-instructions-2026-10-03/summarize-gc-comparison.py:30-34 | docs/audits/gc-rss-instructions-2026-10-03/verify-gc-final-instruction-profile-v1.py:15-19 | docs/audits/gc-rss-instructions-2026-10-03/verify-gc-paired-instruction-domains-v1.py:10-14 | docs/audits/gc-rss-instructions-2026-10-03/verify-gc-runtime-build.py:11-15 | docs/audits/gc-rss-instructions-2026-10-03/verify-gc-window-v6r1-inputs.py:9-13 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `docs/audits/gc-rss-instructions-2026-10-03/verify-gc-final-instruction-profile-v1.py:22` calls `require`, `ValueError` and `docs/audits/gc-rss-instructions-2026-10-03/verify-gc-window-v6r1-inputs.py:16` 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.
perry_gc_effects::graph::classify (cyclomatic 95) crates/perry-gc-effects/src/graph.rs:335— perry_gc_effects::graph::classify 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.
perry_gc_effects::archive::build_graph (cyclomatic 32) crates/perry-gc-effects/src/archive.rs:307— perry_gc_effects::archive::build_graph 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.
perry_gc_effects::instructions::analyze_node (cyclomatic 29) crates/perry-gc-effects/src/instructions.rs:618— perry_gc_effects::instructions::analyze_node 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.
perry_gc_effects::instructions::writes (cyclomatic 26) crates/perry-gc-effects/src/instructions.rs:127— perry_gc_effects::instructions::writes 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.
perry_gc_effects::instructions::idiom (cyclomatic 24) crates/perry-gc-effects/src/instructions.rs:539— perry_gc_effects::instructions::idiom 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.
perry_gc_effects::archive::parse_section (cyclomatic 17) crates/perry-gc-effects/src/archive.rs:150— perry_gc_effects::archive::parse_section 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.
perry_gc_effects::instructions::flow (cyclomatic 16) crates/perry-gc-effects/src/instructions.rs:281— perry_gc_effects::instructions::flow 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.
Build::expr (cyclomatic 92) crates/perry-codegen/src/codegen/source_need/flow.rs:888— Build::expr has cyclomatic complexity 92 (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.
Build::stmt (cyclomatic 28) crates/perry-codegen/src/codegen/source_need/flow.rs:553— Build::stmt 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: Reason::name (cyclomatic 33) 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.
Build::expr_kind (cyclomatic 26) crates/perry-codegen/src/codegen/reach_report.rs:314— Build::expr_kind 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.
Build::call (cyclomatic 25) crates/perry-codegen/src/codegen/source_need/flow.rs:772— Build::call has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Reason::name (cyclomatic 33) 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.
Build::class (cyclomatic 20) crates/perry-codegen/src/codegen/source_need/flow.rs:1360— Build::class has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Reason::name (cyclomatic 33) 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.
Build::solve (cyclomatic 19) crates/perry-codegen/src/codegen/source_need/flow.rs:1836— Build::solve 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. This is NOT this file's highest cyclomatic complexity: Reason::name (cyclomatic 33) 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.
Build::resolve_name (cyclomatic 16) crates/perry-codegen/src/codegen/source_need/flow.rs:402— Build::resolve_name 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: Reason::name (cyclomatic 33) 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.
perry_ui_gtk4::keyboard::gdk_name_to_keycode (cyclomatic 46) crates/perry-ui-gtk4/src/keyboard.rs:92— perry_ui_gtk4::keyboard::gdk_name_to_keycode has cyclomatic complexity 46 (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.
perry_ui_gtk4::app::app_run (cyclomatic 26) crates/perry-ui-gtk4/src/app.rs:144— perry_ui_gtk4::app::app_run 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.
perry_ui_gtk4::state::state_set (cyclomatic 24) crates/perry-ui-gtk4/src/state.rs:156— perry_ui_gtk4::state::state_set 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.
perry_ui_gtk4::camera::schedule_frame_processing (cyclomatic 22) crates/perry-ui-gtk4/src/camera.rs:128— perry_ui_gtk4::camera::schedule_frame_processing 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.
perry_ui_gtk4::widgets::canvas::create (cyclomatic 22) crates/perry-ui-gtk4/src/widgets/canvas.rs:120— perry_ui_gtk4::widgets::canvas::create 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.
perry_ui_gtk4::drag_drop::deliver_drop (cyclomatic 16) crates/perry-ui-gtk4/src/drag_drop.rs:157— perry_ui_gtk4::drag_drop::deliver_drop 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.
perry_ui_gtk4::widgets::webview::install_signal_handlers (cyclomatic 16) crates/perry-ui-gtk4/src/widgets/webview.rs:128— perry_ui_gtk4::widgets::webview::install_signal_handlers 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.
perry_ui_macos::app::app_run (cyclomatic 21) crates/perry-ui-macos/src/app.rs:395— perry_ui_macos::app::app_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.
perry_ui_macos::state::state_set (cyclomatic 21) crates/perry-ui-macos/src/state.rs:159— perry_ui_macos::state::state_set 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.
perry_ui_macos::audio_playback::perry_audio_load_sound (cyclomatic 20) crates/perry-ui-macos/src/audio_playback.rs:254— perry_ui_macos::audio_playback::perry_audio_load_sound 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.
perry_ui_macos::audio_playback::perry_audio_play (cyclomatic 18) crates/perry-ui-macos/src/audio_playback.rs:415— perry_ui_macos::audio_playback::perry_audio_play 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.
perry_ui_macos::app::register_global_hotkey (cyclomatic 17) crates/perry-ui-macos/src/app.rs:1060— perry_ui_macos::app::register_global_hotkey 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.
perry_ui_macos::pointer::handle_event (cyclomatic 17) crates/perry-ui-macos/src/pointer.rs:200— perry_ui_macos::pointer::handle_event 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.
perry_ui_macos::widgets::max_width::set_max_width (cyclomatic 17) crates/perry-ui-macos/src/widgets/max_width.rs:87— perry_ui_macos::widgets::max_width::set_max_width 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.
perry_wasi::filesystem::primitives::windows::fs::create_file_at_w::CreateFileAtW (cognitive 42) crates/perry-wasi/src/filesystem/primitives/windows/fs/create_file_at_w.rs:78— perry_wasi::filesystem::primitives::windows::fs::create_file_at_w::CreateFileAtW has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29 (36 pts), boolean chains 4, match/switch 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
perry_wasi::filesystem::primitives::windows::fs::open_unchecked::handle_open_result (cognitive 35) crates/perry-wasi/src/filesystem/primitives/windows/fs/open_unchecked.rs:140— perry_wasi::filesystem::primitives::windows::fs::open_unchecked::handle_open_result has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 3 (6 pts), boolean chains 2 (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.
perry_wasi::filesystem::primitives::manually::open::stat (cognitive 33) crates/perry-wasi/src/filesystem/primitives/manually/open.rs:432— perry_wasi::filesystem::primitives::manually::open::stat has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (29 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 19). 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.
perry_wasi::filesystem::primitives::windows::fs::open_unchecked::open_at (cognitive 22) crates/perry-wasi/src/filesystem/primitives/windows/fs/open_unchecked.rs:46— perry_wasi::filesystem::primitives::windows::fs::open_unchecked::open_at has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wasi::http::transport::connect (cognitive 21) crates/perry-wasi/src/http/transport.rs:237— perry_wasi::http::transport::connect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (4 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.
perry_wasi::http::server::wire::request (cognitive 20) crates/perry-wasi/src/http/server/wire.rs:104— perry_wasi::http::server::wire::request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 7, 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.
perry_wasi::http::server::wire::response (cognitive 16) crates/perry-wasi/src/http/server/wire.rs:229— perry_wasi::http::server::wire::response has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scan::walk_expr (cognitive 35) crates/perry-codegen/src/collectors/sealed_buffers.rs:567— Scan::walk_expr has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Scan::walk_stmt (cognitive 27) crates/perry-codegen/src/collectors/sealed_buffers.rs:452— Scan::walk_stmt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 1 (2 pts), 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.
Scan::visit_named_export (cognitive 22) crates/perry/src/commands/compile/cjs_wrap/family_syntax.rs:152— Scan::visit_named_export has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (6 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.
Scan::walk_module (cognitive 21) crates/perry-codegen/src/collectors/sealed_buffers.rs:394— Scan::walk_module has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 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.
Scan::visit_member_expr (cognitive 17) crates/perry-hir/src/lower/pre_scan/function_ctor_reach.rs:204— Scan::visit_member_expr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scan::visit_call_expr (cognitive 16) crates/perry-hir/src/dynamic_code.rs:296— Scan::visit_call_expr has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 3 (5 pts), boolean chains 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.
Scan::member (cognitive 16) crates/perry-hir/src/realm_reach.rs:374— Scan::member has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
Duplicated block (23 lines × 2) crates/perry-codegen/src/codegen/class_artifacts.rs:289— crates/perry-codegen/src/codegen/class_artifacts.rs:289-311 | crates/perry-codegen/src/codegen/class_artifacts.rs:420-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/perry-codegen/src/expr/this_super_call.rs:1747— crates/perry-codegen/src/expr/this_super_call.rs:1747-1769 | crates/perry-codegen/src/lower_call/new_error_init.rs:48-70 — before extracting anything, compare `crates/perry-codegen/src/expr/this_super_call.rs` and `crates/perry-codegen/src/lower_call/new_error_init.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/lower_call/scalar_method.rs:918— crates/perry-codegen/src/lower_call/scalar_method.rs:918-940 | crates/perry-codegen/src/lower_call/scalar_method.rs:1135-1157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/perry-codegen/src/lower_string_method.rs:566— crates/perry-codegen/src/lower_string_method.rs:566-588 | crates/perry-codegen/src/lower_string_method.rs:754-776 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_call/nested_namespace.rs:277— crates/perry-hir/src/lower/expr_call/nested_namespace.rs:277-299 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:352-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 (23 lines × 2) crates/perry-codegen/src/expr/property_get_names.rs:17— crates/perry-codegen/src/expr/property_get_names.rs:17-39 | crates/perry-hir/src/lower/expr_member/native_dispatch.rs:300-322 — 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 (23 lines × 2) crates/perry-ext-http/src/response_headers.rs:21— crates/perry-ext-http/src/response_headers.rs:21-43 | crates/perry-ext-http/src/server/request.rs:275-297 — 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 × 3) crates/perry-codegen/src/codegen/entry.rs:847— crates/perry-codegen/src/codegen/entry.rs:847-860 | crates/perry-codegen/src/codegen/entry/module_init.rs:327-340 | crates/perry-codegen/src/codegen/function.rs:1350-1363 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) crates/perry-codegen/src/codegen/mod.rs:1554— crates/perry-codegen/src/codegen/mod.rs:1554-1567 | crates/perry-codegen/src/codegen/mod.rs:1697-1710 | crates/perry-codegen/src/lower_call/new_alloc.rs:961-974 — 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 (14 lines × 3) crates/perry-codegen/src/expr/folded_builtin_override.rs:872— crates/perry-codegen/src/expr/folded_builtin_override.rs:872-885 | crates/perry-codegen/src/lower_call/property_get.rs:276-289 | crates/perry-codegen/src/lower_call/property_get/builtin_kind_guard.rs:465-478 — 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 (14 lines × 3) crates/perry-codegen/src/lower_call/early_branches.rs:799— crates/perry-codegen/src/lower_call/early_branches.rs:799-812 | crates/perry-codegen/src/lower_call/early_branches.rs:899-912 | crates/perry-codegen/src/lower_call/early_branches.rs:1001-1014 — 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/perry-codegen/src/lower_call/options/notification.rs:125— crates/perry-codegen/src/lower_call/options/notification.rs:125-138 | crates/perry-codegen/src/lower_call/options/notification.rs:164-177 | crates/perry-codegen/src/lower_call/options/notification.rs:206-219 — 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/perry-hir/src/lower/expr_call/array_only_methods.rs:1326— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1326-1339 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:271-284 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:200-213 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) crates/perry-codegen/src/stmt/let_stmt.rs:1435— crates/perry-codegen/src/stmt/let_stmt.rs:1435-1448 | crates/perry-codegen/src/stmt/let_stmt.rs:1456-1469 | crates/perry-codegen/src/stmt/let_stmt.rs:1473-1486 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 2) crates/perry-codegen/src/expr/array_literal.rs:689— crates/perry-codegen/src/expr/array_literal.rs:689-702 | crates/perry-codegen/src/expr/instance_misc1.rs:1607-1619 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/expr/instance_misc1.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) crates/perry-codegen/src/expr/index_set_packed_loop.rs:187— crates/perry-codegen/src/expr/index_set_packed_loop.rs:187-200 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:358-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 (13–14 lines × 2) crates/perry-codegen/src/expr/misc_methods.rs:399— crates/perry-codegen/src/expr/misc_methods.rs:399-411 | crates/perry-codegen/src/expr/misc_methods.rs:556-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/perry-hir/src/lower/lower_expr.rs:288— crates/perry-hir/src/lower/lower_expr.rs:288-301 | crates/perry-hir/src/lower/template.rs:27-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13–14 lines × 2) crates/perry-hir/src/lower_decl/fn_decl.rs:67— crates/perry-hir/src/lower_decl/fn_decl.rs:67-80 | crates/perry-hir/src/lower_decl/private_members.rs:89-101 — before extracting anything, compare `crates/perry-hir/src/lower_decl/fn_decl.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 3 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 (13–14 lines × 2) crates/perry-hir/src/monomorph/infer.rs:126— crates/perry-hir/src/monomorph/infer.rs:126-139 | crates/perry-hir/src/monomorph/update_call_sites.rs:760-772 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–14 lines × 2) scripts/thread_exit_address_globals.py:697— scripts/thread_exit_address_globals.py:697-710 | scripts/thread_exit_address_globals.py:718-730 — both copies are in the same file, so extract the block into 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 × 3) crates/perry-codegen/src/collectors/definite_init.rs:249— crates/perry-codegen/src/collectors/definite_init.rs:249-261 | crates/perry-codegen/src/stmt/class_first_loop.rs:432-444 | crates/perry-hir/src/iterator_record.rs:557-569 — 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/perry-codegen/src/expr/agent_ptr.rs:137— crates/perry-codegen/src/expr/agent_ptr.rs:137-149 | crates/perry-codegen/src/expr/agent_ptr.rs:181-193 | crates/perry-codegen/src/expr/agent_ptr.rs:291-303 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/perry-codegen/src/expr/js_runtime.rs:70— crates/perry-codegen/src/expr/js_runtime.rs:70-82 | crates/perry-codegen/src/expr/js_runtime.rs:102-114 | crates/perry-codegen/src/expr/js_runtime.rs:199-211 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/perry-codegen/src/lower_call/early_branches.rs:559— crates/perry-codegen/src/lower_call/early_branches.rs:559-571 | crates/perry-codegen/src/lower_call/early_branches.rs:1198-1212 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:182-194 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/property_get/imported_object.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) crates/perry-hir/src/lower_decl/class_members.rs:315— crates/perry-hir/src/lower_decl/class_members.rs:315-327 | crates/perry-hir/src/lower_decl/class_members.rs:1027-1039 | crates/perry-hir/src/lower_decl/private_members.rs:382-394 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) crates/perry-codegen/src/expr/bigint_set.rs:746— crates/perry-codegen/src/expr/bigint_set.rs:746-758 | crates/perry-codegen/src/expr/bigint_set.rs:770-782 | crates/perry-codegen/src/expr/bigint_set.rs:794-806 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) scripts/compiler_output_harness/verification.py:724— scripts/compiler_output_harness/verification.py:724-737 | scripts/compiler_output_harness/verification.py:826-838 | scripts/compiler_output_harness/verification.py:1080-1093 — 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 `scripts/compiler_output_harness/verification.py:724` 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 × 4) crates/perry-codegen/src/codegen/closure.rs:1375— crates/perry-codegen/src/codegen/closure.rs:1375-1385 | crates/perry-codegen/src/codegen/entry.rs:985-995 | crates/perry-codegen/src/codegen/entry/module_init.rs:465-475 | crates/perry-codegen/src/codegen/method_static.rs:441-451 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/perry-codegen/src/codegen/mod.rs:3572— crates/perry-codegen/src/codegen/mod.rs:3572-3582 | crates/perry-codegen/src/codegen/mod.rs:3602-3612 | crates/perry-codegen/src/codegen/mod.rs:3632-3642 | crates/perry-codegen/src/codegen/mod.rs:3664-3674 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 4) crates/perry-codegen/src/collectors/escape_check.rs:1060— crates/perry-codegen/src/collectors/escape_check.rs:1060-1070 | crates/perry-codegen/src/collectors/escape_check.rs:1073-1083 | crates/perry-codegen/src/collectors/escape_check.rs:1087-1097 | crates/perry-codegen/src/collectors/escape_check.rs:1103-1113 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 4) crates/perry-codegen/src/lower_call/early_branches.rs:805— crates/perry-codegen/src/lower_call/early_branches.rs:805-815 | crates/perry-codegen/src/lower_call/early_branches.rs:905-915 | crates/perry-codegen/src/lower_call/early_branches.rs:1007-1017 | crates/perry-codegen/src/lower_call/early_branches.rs:1115-1125 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 4) crates/perry-hir/src/lower/expr_function.rs:1391— crates/perry-hir/src/lower/expr_function.rs:1391-1401 | crates/perry-hir/src/lower/expr_object.rs:362-372 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:209-219 | crates/perry-hir/src/lower_decl/fn_decl.rs:319-329 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower/expr_object.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/perry-codegen/src/expr/misc_methods.rs:1056— crates/perry-codegen/src/expr/misc_methods.rs:1056-1066 | crates/perry-codegen/src/expr/misc_methods.rs:1085-1095 | crates/perry-codegen/src/expr/os_uri_dates.rs:224-234 | crates/perry-codegen/src/expr/os_uri_dates.rs:260-276 — before extracting anything, compare `crates/perry-codegen/src/expr/misc_methods.rs` and `crates/perry-codegen/src/expr/os_uri_dates.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) scripts/component_async_acceptance.py:61— scripts/component_async_acceptance.py:61-71 | scripts/component_persistent_acceptance.py:52-62 | scripts/component_producer_acceptance.py:64-74 | scripts/component_reader_acceptance.py:62-72 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 2) crates/perry-codegen/src/expr/array_pop.rs:64— crates/perry-codegen/src/expr/array_pop.rs:64-71 | crates/perry-codegen/src/expr/class_field_push.rs:33-39 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/class_field_push.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 (7–8 lines × 2) crates/perry-codegen/src/expr/arrays_finds.rs:178— crates/perry-codegen/src/expr/arrays_finds.rs:178-184 | crates/perry-codegen/src/expr/u8_buffer_read.rs:303-310 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) crates/perry-codegen/src/expr/index.rs:695— crates/perry-codegen/src/expr/index.rs:695-701 | crates/perry-codegen/src/expr/index.rs:721-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/perry-codegen/src/expr/index_set.rs:133— crates/perry-codegen/src/expr/index_set.rs:133-140 | crates/perry-codegen/src/expr/index_set.rs:159-165 — both copies are in the same file, so extract the block into 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/perry-ext-ads/src/ios_real.rs:90— crates/perry-ext-ads/src/ios_real.rs:90-97 | crates/perry-ext-ads/src/ios_real.rs:139-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.
Duplicated block (7–8 lines × 2) crates/perry-hir/src/lower/expr_member.rs:1064— crates/perry-hir/src/lower/expr_member.rs:1064-1071 | crates/perry-hir/src/lower/stmt.rs:523-529 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) scripts/gc_1090_evidence_report.py:1435— scripts/gc_1090_evidence_report.py:1435-1441 | scripts/perf_frontier_report.py:1009-1016 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `scripts/gc_1090_evidence_report.py:1435` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 6) crates/perry-codegen/src/expr/array_pop.rs:65— crates/perry-codegen/src/expr/array_pop.rs:65-71 | crates/perry-codegen/src/expr/class_field_push.rs:34-39 | crates/perry-codegen/src/expr/function_bind.rs:40-45 | crates/perry-codegen/src/expr/literals_vars.rs:76-81 | crates/perry-codegen/src/expr/method_site.rs:743-748 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:47-52 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/class_field_push.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 (6 lines × 6) crates/perry-codegen/src/expr/env_clones.rs:415— crates/perry-codegen/src/expr/env_clones.rs:415-420 | crates/perry-codegen/src/expr/math_simple.rs:464-469 | crates/perry-codegen/src/expr/math_simple.rs:1141-1146 | crates/perry-codegen/src/expr/misc_methods.rs:751-756 | crates/perry-codegen/src/expr/string_regex_proc.rs:168-173 | crates/perry-codegen/src/expr/string_regex_proc.rs:196-201 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) crates/perry-codegen/src/lower_call/native/mod.rs:407— crates/perry-codegen/src/lower_call/native/mod.rs:407-413 | crates/perry-codegen/src/lower_call/native/mod.rs:462-468 | crates/perry-codegen/src/lower_call/native/mod.rs:532-537 | crates/perry-codegen/src/lower_call/native/mod.rs:585-590 | crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:477-482 | crates/perry-codegen/src/lower_call/web_storage.rs:52-58 — before extracting anything, compare `crates/perry-codegen/src/lower_call/native/mod.rs` and `crates/perry-codegen/src/lower_call/web_storage.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 (6 lines × 6) crates/perry-codegen/src/expr/static_method.rs:210— crates/perry-codegen/src/expr/static_method.rs:210-215 | crates/perry-codegen/src/lower_call/options/fetch.rs:815-823 | crates/perry-codegen/src/lower_call/options/fetch.rs:1053-1061 | crates/perry-codegen/src/lower_call/options/fetch.rs:1093-1101 | crates/perry-codegen/src/lower_call/options/fetch.rs:1127-1135 | crates/perry-codegen/src/lower_call/options/fetch.rs:1146-1154 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 6) crates/perry-hir/src/lower/expr_call/globals.rs:757— crates/perry-hir/src/lower/expr_call/globals.rs:757-762 | crates/perry-hir/src/lower/expr_call/globals.rs:783-788 | crates/perry-hir/src/lower/expr_call/module_static.rs:334-339 | crates/perry-hir/src/lower/expr_call/module_static.rs:360-365 | crates/perry-hir/src/lower/expr_call/module_static.rs:709-714 | crates/perry-hir/src/lower/expr_call/module_static.rs:781-786 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v51-build.py:7— docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v51-build.py:7-12 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v59-build.py:7-12 | docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-base-v77-build.py:7-12 | docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-once-v74-build.py:7-12 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v68-build.py:7-12 | docs/audits/gc-rss-instructions-2026-10-03/primary-mark-frontier-mainad0-v85-build.py:7-12 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v51-build.py` and `docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v59-build.py` as WHOLE FILES: 82% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:72— docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:72-77 | docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:72-77 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:71-76 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:71-76 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:71-76 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:81-86 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py` and `docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py` as WHOLE FILES: this scan already matched 5 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 `docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:72` 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×7
Async function without AbortSignal: resolveRelease upstream/actions/jdx/mr-boxington-action/src/index.ts:138— `resolveRelease` 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: fetchManifestResponse upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:169— `fetchManifestResponse` 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: primary scripts/turnloop/apps/p9_thread_agent.ts:22— `primary` 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: doFetch scripts/turnloop/apps/p9_worker_agent_acceptance.ts:40— `doFetch` 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: doFetch scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:24— `doFetch` 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: checkForUpdate packages/perry-updater/src/index.ts:160— `checkForUpdate` 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: downloadAndVerify packages/perry-updater/src/index.ts:425— `downloadAndVerify` 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 })`.
WasmModuleEmitter::compile (cyclomatic 154) crates/perry-codegen-wasm/src/emit/compile.rs:9— WasmModuleEmitter::compile has cyclomatic complexity 154 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WasmModuleEmitter::collect_strings_in_expr (cyclomatic 124) crates/perry-codegen-wasm/src/emit/string_collection.rs:453— WasmModuleEmitter::collect_strings_in_expr has cyclomatic complexity 124 (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.
WasmModuleEmitter::emit_js_expr (cyclomatic 110) crates/perry-codegen-wasm/src/emit/js_fallback.rs:220— WasmModuleEmitter::emit_js_expr has cyclomatic complexity 110 (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.
WasmModuleEmitter::emit_js_stmt (cyclomatic 35) crates/perry-codegen-wasm/src/emit/js_fallback.rs:54— WasmModuleEmitter::emit_js_stmt has cyclomatic complexity 35 (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.
WasmModuleEmitter::collect_strings (cyclomatic 34) crates/perry-codegen-wasm/src/emit/string_collection.rs:10— WasmModuleEmitter::collect_strings 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.
WasmModuleEmitter::collect_strings_in_stmt (cyclomatic 23) crates/perry-codegen-wasm/src/emit/string_collection.rs:370— WasmModuleEmitter::collect_strings_in_stmt 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.
perry_ui_visionos::audio_playback::perry_audio_load_sound (cyclomatic 20) crates/perry-ui-visionos/src/audio_playback.rs:257— perry_ui_visionos::audio_playback::perry_audio_load_sound 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.
perry_ui_visionos::state::state_set (cyclomatic 20) crates/perry-ui-visionos/src/state.rs:128— perry_ui_visionos::state::state_set 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.
perry_ui_visionos::audio_playback::perry_audio_play (cyclomatic 18) crates/perry-ui-visionos/src/audio_playback.rs:418— perry_ui_visionos::audio_playback::perry_audio_play 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.
perry_ui_visionos::drag_drop::perform_drop_impl (cyclomatic 18) crates/perry-ui-visionos/src/drag_drop.rs:155— perry_ui_visionos::drag_drop::perform_drop_impl has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ui_visionos::widgets::alert::topmost_view_controller (cyclomatic 18) crates/perry-ui-visionos/src/widgets/alert.rs:37— perry_ui_visionos::widgets::alert::topmost_view_controller 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.
perry_ui_visionos::widgets::rich_tooltip::find_key_window (cyclomatic 16) crates/perry-ui-visionos/src/widgets/rich_tooltip.rs:263— perry_ui_visionos::widgets::rich_tooltip::find_key_window 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.
WasmModuleEmitter::compile (cognitive 377) crates/perry-codegen-wasm/src/emit/compile.rs:9— WasmModuleEmitter::compile has cognitive complexity 377 (threshold 15). Drivers by points: if/else 65 (189 pts), loops 92 (184 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 217). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WasmModuleEmitter::collect_strings_in_expr (cognitive 86) crates/perry-codegen-wasm/src/emit/string_collection.rs:453— WasmModuleEmitter::collect_strings_in_expr has cognitive complexity 86 (threshold 15). Drivers by points: loops 20 (40 pts), if/else 19 (38 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 43). 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.
WasmModuleEmitter::collect_strings (cognitive 80) crates/perry-codegen-wasm/src/emit/string_collection.rs:10— WasmModuleEmitter::collect_strings has cognitive complexity 80 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 19 (37 pts), match/switch 1 (3 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.
WasmModuleEmitter::emit_js_expr (cognitive 68) crates/perry-codegen-wasm/src/emit/js_fallback.rs:220— WasmModuleEmitter::emit_js_expr has cognitive complexity 68 (threshold 15). Drivers by points: if/else 22 (40 pts), match/switch 11 (23 pts), loops 2 (5 pts) (nesting depth added 33). 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.
WasmModuleEmitter::emit_js_stmt (cognitive 46) crates/perry-codegen-wasm/src/emit/js_fallback.rs:54— WasmModuleEmitter::emit_js_stmt has cognitive complexity 46 (threshold 15). Drivers by points: loops 10 (24 pts), if/else 11 (21 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.
WasmModuleEmitter::collect_strings_in_stmt (cognitive 20) crates/perry-codegen-wasm/src/emit/string_collection.rs:370— WasmModuleEmitter::collect_strings_in_stmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_better_sqlite3::js_sqlite_stmt_all (cognitive 51) crates/perry-ext-better-sqlite3/src/lib.rs:409— perry_ext_better_sqlite3::js_sqlite_stmt_all has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 3 (22 pts) (nesting depth added 39). 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.
perry_ext_better_sqlite3::js_sqlite_stmt_get (cognitive 43) crates/perry-ext-better-sqlite3/src/lib.rs:343— perry_ext_better_sqlite3::js_sqlite_stmt_get has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 2 (15 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ext_better_sqlite3::js_sqlite_stmt_run (cognitive 28) crates/perry-ext-better-sqlite3/src/lib.rs:293— perry_ext_better_sqlite3::js_sqlite_stmt_run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (6 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ext_better_sqlite3::js_sqlite_pragma (cognitive 28) crates/perry-ext-better-sqlite3/src/lib.rs:491— perry_ext_better_sqlite3::js_sqlite_pragma has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (28 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_ext_better_sqlite3::params_from_array (cognitive 23) crates/perry-ext-better-sqlite3/src/lib.rs:101— perry_ext_better_sqlite3::params_from_array has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, 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.
perry_ext_better_sqlite3::dispatch_ext::call (cognitive 22) crates/perry-ext-better-sqlite3/src/dispatch_ext.rs:83— perry_ext_better_sqlite3::dispatch_ext::call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (7 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.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/perry-codegen/src/codegen/closure.rs:474— crates/perry-codegen/src/codegen/closure.rs:474-1650 | crates/perry-codegen/src/codegen/entry.rs:133-1502 | crates/perry-codegen/src/codegen/entry/module_init.rs:33-709 | crates/perry-codegen/src/codegen/function.rs:634-1852 | crates/perry-codegen/src/codegen/method.rs:163-1755 | crates/perry-codegen/src/codegen/method_static.rs:34-586 — 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/perry-codegen/src/collectors/escape_arrays.rs:74— crates/perry-codegen/src/collectors/escape_arrays.rs:74-170 | crates/perry-codegen/src/collectors/escape_arrays.rs:219-317 | crates/perry-codegen/src/collectors/hot_callees.rs:358-434 | crates/perry-codegen/src/collectors/hot_callees.rs:625-708 | crates/perry-codegen/src/collectors/not_bigint_locals.rs:304-393 | crates/perry-codegen/src/layout_families.rs:325-400 — 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/perry-codegen/src/collectors/integer_locals.rs:595— crates/perry-codegen/src/collectors/integer_locals.rs:595-686 | crates/perry-codegen/src/collectors/proven_args.rs:224-311 | crates/perry-codegen/src/collectors/ptr_numarray.rs:585-673 | crates/perry-codegen/src/collectors/ptr_shape.rs:1202-1397 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:781-905 | crates/perry-codegen/src/collectors/sealed_buffers.rs:452-549 — 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/perry-codegen/src/expr/calls/crypto_hash.rs:350— crates/perry-codegen/src/expr/calls/crypto_hash.rs:350-378 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:180-225 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:456-495 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:502-548 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:594-621 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:682-708 — 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/perry-codegen/src/expr/calls/crypto_kdf.rs:14— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:14-32 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:64-94 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:180-225 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:269-301 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:308-338 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:628-646 — 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) scripts/component_async_acceptance.py:15— scripts/component_async_acceptance.py:15-83 | scripts/component_http_acceptance.py:25-160 | scripts/component_p3_command_acceptance.py:44-93 | scripts/component_persistent_acceptance.py:15-74 | scripts/component_producer_acceptance.py:15-86 | scripts/component_reader_acceptance.py:15-84 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (27 lines × 2) crates/perry-codegen/src/codegen/method_entries.rs:45— crates/perry-codegen/src/codegen/method_entries.rs:45-71 | crates/perry-codegen/src/codegen/method_entries.rs:145-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crates/perry-ext-http/src/server/handle_dispatch.rs:504— crates/perry-ext-http/src/server/handle_dispatch.rs:504-530 | crates/perry-ext-http/src/server/handle_dispatch.rs:535-561 — both copies are in the same file, so extract the block into 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/perry-ext-http/src/server/turnloop_serve/wire.rs:75— crates/perry-ext-http/src/server/turnloop_serve/wire.rs:75-101 | crates/perry-http-server/src/wire.rs:87-113 — before extracting anything, compare `crates/perry-ext-http/src/server/turnloop_serve/wire.rs` and `crates/perry-http-server/src/wire.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-hir/src/lower/expr_call/module_static.rs:165— crates/perry-hir/src/lower/expr_call/module_static.rs:165-191 | crates/perry-hir/src/lower/expr_call/module_static.rs:619-645 — both copies are in the same file, so extract the block into 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/perry-hir/src/lower/expr_call/stream.rs:18— crates/perry-hir/src/lower/expr_call/stream.rs:18-44 | crates/perry-hir/src/lower/expr_member/native_dispatch.rs:176-202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (27 lines × 2) crates/perry-hir/src/lower/lower_expr/reactive_text.rs:169— crates/perry-hir/src/lower/lower_expr/reactive_text.rs:169-195 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:247-273 — before extracting anything, compare `crates/perry-hir/src/lower/lower_expr/reactive_text.rs` and `crates/perry-hir/src/lower/widget_decl/reactive_animate.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen-arkts/src/mutations.rs:499— crates/perry-codegen-arkts/src/mutations.rs:499-523 | crates/perry-codegen-arkts/src/mutations.rs:530-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) crates/perry-codegen/src/collectors/i32_locals.rs:1438— crates/perry-codegen/src/collectors/i32_locals.rs:1438-1462 | crates/perry-codegen/src/collectors/refs.rs:410-434 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) crates/perry-codegen/src/collectors/ptr_numarray.rs:619— crates/perry-codegen/src/collectors/ptr_numarray.rs:619-643 | crates/perry-codegen/src/collectors/ptr_shape.rs:1343-1367 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) crates/perry-hir/src/lower/lower_expr/reactive_text.rs:210— crates/perry-hir/src/lower/lower_expr/reactive_text.rs:210-234 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:288-312 — before extracting anything, compare `crates/perry-hir/src/lower/lower_expr/reactive_text.rs` and `crates/perry-hir/src/lower/widget_decl/reactive_animate.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-codegen/src/codegen/string_pool.rs:1633— crates/perry-codegen/src/codegen/string_pool.rs:1633-1661 | crates/perry-codegen/src/codegen/string_pool.rs:1715-1739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) android-build/app/src/main/java/com/perry/app/PerryActivity.kt:100— android-build/app/src/main/java/com/perry/app/PerryActivity.kt:100-124 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryActivity.kt:145-169 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryActivity.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryActivity.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–22 lines × 2) crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:64— crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:64-85 | crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:203-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.
Duplicated block (21–22 lines × 2) crates/perry-codegen/src/type_analysis/strings.rs:366— crates/perry-codegen/src/type_analysis/strings.rs:366-387 | crates/perry-codegen/src/type_analysis/strings.rs:552-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/perry-hir/src/lower/module_decl.rs:726— crates/perry-hir/src/lower/module_decl.rs:726-746 | crates/perry-hir/src/lower/module_decl.rs:787-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.
Duplicated block (21–22 lines × 2) crates/perry-hir/src/walker/expr_mut.rs:1953— crates/perry-hir/src/walker/expr_mut.rs:1953-1974 | crates/perry-hir/src/walker/expr_ref.rs:1914-1934 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21–22 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1620— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1620-1641 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2192-2212 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1620` 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–22 lines × 2) scripts/shape_descriptor_census.py:1284— scripts/shape_descriptor_census.py:1284-1304 | scripts/shape_descriptor_census.py:1325-1346 — both copies are in the same file, so extract the 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, `scripts/shape_descriptor_census.py:1305` calls `function_body` and `scripts/shape_descriptor_census.py:1347` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19–20 lines × 2) crates/perry-codegen-glance/src/emit_glue.rs:144— crates/perry-codegen-glance/src/emit_glue.rs:144-163 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:87-105 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (19–20 lines × 2) crates/perry-hir/src/lower/expr_member/member_tail.rs:985— crates/perry-hir/src/lower/expr_member/member_tail.rs:985-1003 | crates/perry-hir/src/lower_patterns.rs:248-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19–20 lines × 2) crates/perry-hir/src/lower/expr_object.rs:298— crates/perry-hir/src/lower/expr_object.rs:298-316 | crates/perry-hir/src/lower_decl/fn_decl.rs:147-166 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/perry-hir/src/lower/stmt.rs:1615— crates/perry-hir/src/lower/stmt.rs:1615-1633 | crates/perry-hir/src/lower_decl/body_stmt.rs:1142-1161 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) scripts/gc_runtime_root_holders.py:1295— scripts/gc_runtime_root_holders.py:1295-1313 | scripts/gc_runtime_root_holders.py:1334-1353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/gc_runtime_root_holders.py:1295` 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–20 lines × 2) scripts/shape_descriptor_census.py:1347— scripts/shape_descriptor_census.py:1347-1366 | scripts/shape_descriptor_census.py:1367-1385 — both copies are in the same file, so extract the block into 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 × 3) crates/perry-codegen/src/codegen/static_fields.rs:479— crates/perry-codegen/src/codegen/static_fields.rs:479-493 | crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:68-82 | crates/perry-codegen/src/stmt/stable_packed_accumulator.rs:267-281 — 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 (15 lines × 3) crates/perry-codegen/src/collectors/param_ranges.rs:167— crates/perry-codegen/src/collectors/param_ranges.rs:167-181 | crates/perry-codegen/src/layout_families.rs:349-363 | crates/perry-hir/src/lower/type_widening.rs:172-186 — before extracting anything, compare `crates/perry-codegen/src/collectors/param_ranges.rs` and `crates/perry-codegen/src/layout_families.rs` as WHOLE FILES: this scan already matched 3 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 (15 lines × 3) crates/perry-codegen/src/collectors/sealed_buffers.rs:204— crates/perry-codegen/src/collectors/sealed_buffers.rs:204-218 | crates/perry-codegen/src/scope_env/pass.rs:226-240 | crates/perry-hir/src/lexical_frames.rs:364-378 — 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 (15 lines × 3) crates/perry-codegen/src/expr/url_main.rs:76— crates/perry-codegen/src/expr/url_main.rs:76-90 | crates/perry-codegen/src/expr/url_main.rs:237-251 | crates/perry-codegen/src/expr/url_main.rs:296-310 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) crates/perry-codegen/src/lower_call/property_get/number_string.rs:89— crates/perry-codegen/src/lower_call/property_get/number_string.rs:89-103 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:152-166 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:203-217 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:79— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:79-94 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:287-301 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:323-338 — 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 × 4) crates/perry-codegen/src/codegen/closure.rs:911— crates/perry-codegen/src/codegen/closure.rs:911-918 | crates/perry-codegen/src/codegen/function.rs:1004-1011 | crates/perry-codegen/src/codegen/method.rs:468-475 | crates/perry-codegen/src/codegen/method_static.rs:189-196 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) crates/perry-codegen/src/collectors/proven_args.rs:301— crates/perry-codegen/src/collectors/proven_args.rs:301-308 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:972-979 | crates/perry-codegen/src/collectors/scalar_methods.rs:486-493 | crates/perry-codegen/src/expr/slot_rep.rs:954-961 — 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/perry-codegen/src/expr/calls/fs.rs:238— crates/perry-codegen/src/expr/calls/fs.rs:238-245 | crates/perry-codegen/src/expr/calls/fs.rs:257-264 | crates/perry-codegen/src/expr/calls/fs.rs:276-283 | crates/perry-codegen/src/expr/calls/fs.rs:395-402 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) crates/perry-ext-http/src/client_events.rs:111— crates/perry-ext-http/src/client_events.rs:111-118 | crates/perry-ext-http/src/client_events.rs:373-380 | crates/perry-ext-http/src/client_events.rs:701-708 | crates/perry-ext-http/src/client_events.rs:867-874 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) crates/perry-hir/src/lower/closure_analysis.rs:270— crates/perry-hir/src/lower/closure_analysis.rs:270-277 | crates/perry-hir/src/lower/closure_analysis.rs:583-590 | crates/perry-hir/src/lower/closure_analysis.rs:869-876 | crates/perry-hir/src/lower/closure_analysis.rs:1319-1326 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) crates/perry-hir/src/lower/const_fold_fn.rs:643— crates/perry-hir/src/lower/const_fold_fn.rs:643-650 | crates/perry-hir/src/lower/const_fold_fn.rs:852-859 | crates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rs:143-150 | crates/perry-hir/src/lower/fn_ctor_env.rs:153-160 — before extracting anything, compare `crates/perry-hir/src/lower/const_fold_fn.rs` and `crates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
FnReader::typed (cyclomatic 82) crates/perry-codegen/src/dialect/mod.rs:1348— FnReader::typed has cyclomatic complexity 82 (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.
FnReader::binary_or_cast (cyclomatic 41) crates/perry-codegen/src/dialect/mod.rs:1097— FnReader::binary_or_cast has cyclomatic complexity 41 (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.
FnReader::call (cyclomatic 22) crates/perry-codegen/src/dialect/mod.rs:832— FnReader::call 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.
FnReader::value_inst (cyclomatic 18) crates/perry-codegen/src/dialect/mod.rs:532— FnReader::value_inst 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.
FnReader::call_asm (cyclomatic 16) crates/perry-codegen/src/dialect/mod.rs:989— FnReader::call_asm 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.
perry_component_host::task_exit::instrument::instrument (cyclomatic 56) crates/perry-component-host/src/task_exit/instrument.rs:21— perry_component_host::task_exit::instrument::instrument 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.
perry_component_host::sync_wasi::errors::code (cyclomatic 50) crates/perry-component-host/src/sync_wasi/errors.rs:46— perry_component_host::sync_wasi::errors::code has cyclomatic complexity 50 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
perry_component_host::driver::async_values::execute (cyclomatic 33) crates/perry-component-host/src/driver/async_values.rs:42— perry_component_host::driver::async_values::execute 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.
perry_component_host::driver::writers::execute (cyclomatic 28) crates/perry-component-host/src/driver/writers.rs:14— perry_component_host::driver::writers::execute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_component_host::async_values::reader_cleanup::visitors::emit (cyclomatic 16) crates/perry-component-host/src/async_values/reader_cleanup.rs:8— perry_component_host::async_values::reader_cleanup::visitors::emit 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.
perry_ui_android::system::preferences_get (cyclomatic 26) crates/perry-ui-android/src/system.rs:177— perry_ui_android::system::preferences_get 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.
perry_ui_android::widgets::canvas::repaint (cyclomatic 23) crates/perry-ui-android/src/widgets/canvas.rs:230— perry_ui_android::widgets::canvas::repaint 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.
perry_ui_android::state::state_set (cyclomatic 22) crates/perry-ui-android/src/state.rs:138— perry_ui_android::state::state_set 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.
perry_ui_android::widgets::add_child (cyclomatic 17) crates/perry-ui-android/src/widgets/mod.rs:191— perry_ui_android::widgets::add_child 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.
perry_ui_android::widgets::image::create_file (cyclomatic 16) crates/perry-ui-android/src/widgets/image.rs:11— perry_ui_android::widgets::image::create_file 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.
UseWalk::walk_expr (cognitive 128) crates/perry-codegen/src/collectors/ptr_shape.rs:1417— UseWalk::walk_expr has cognitive complexity 128 (threshold 15). Drivers by points: if/else 35 (100 pts), loops 6 (17 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 80). 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.
UseWalk::walk_stmt (cognitive 82) crates/perry-codegen/src/collectors/ptr_shape.rs:1202— UseWalk::walk_stmt has cognitive complexity 82 (threshold 15). Drivers by points: if/else 25 (66 pts), match/switch 3 (8 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UseWalk::walk_expr (cognitive 72) crates/perry-codegen/src/collectors/ptr_numarray.rs:675— UseWalk::walk_expr has cognitive complexity 72 (threshold 15). Drivers by points: if/else 25 (65 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 41). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
UseWalk::walk_stmt (cognitive 22) crates/perry-codegen/src/collectors/ptr_numarray.rs:585— UseWalk::walk_stmt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UseWalk::collect_candidates (cognitive 18) crates/perry-codegen/src/collectors/ptr_numarray.rs:432— UseWalk::collect_candidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, 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.
GcCycleState::step_reclaim (cognitive 53) crates/perry-runtime/src/gc/cycle.rs:1669— GcCycleState::step_reclaim has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
GcCycleState::step_atomic_finalize_current_subphase (cognitive 32) crates/perry-runtime/src/gc/cycle.rs:1233— GcCycleState::step_atomic_finalize_current_subphase has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (9 pts), match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GcCycleState::step_sweep (cognitive 28) crates/perry-runtime/src/gc/cycle.rs:1531— GcCycleState::step_sweep has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GcCycleState::step_weak_ephemerons (cognitive 22) crates/perry-runtime/src/gc/cycle/weak_ephemerons.rs:5— GcCycleState::step_weak_ephemerons has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 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.
GcCycleState::atomic_finalize_minor_prelude (cognitive 16) crates/perry-runtime/src/gc/cycle.rs:1416— GcCycleState::atomic_finalize_minor_prelude has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 1 (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.
Writer::array (cognitive 48) crates/perry-runtime/src/thread/clone_write.rs:598— Writer::array has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Writer::pointer (cognitive 26) crates/perry-runtime/src/thread/clone_write.rs:460— Writer::pointer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), match/switch 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.
Writer::plain_object (cognitive 20) crates/perry-runtime/src/thread/clone_write.rs:802— Writer::plain_object has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Writer::value (cognitive 19) crates/perry-runtime/src/thread/clone_write.rs:401— Writer::value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), 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.
Writer::descriptor_array (cognitive 17) crates/perry-runtime/src/thread/clone_write.rs:688— Writer::descriptor_array has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/perry-codegen/src/collectors/all_pointer_arrays.rs:199— crates/perry-codegen/src/collectors/all_pointer_arrays.rs:199-242 | crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:36-119 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:1262-1305 | crates/perry-codegen/src/collectors/ptr_shape_returns.rs:769-812 | crates/perry-codegen/src/layout_desc.rs:574-642 — 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/perry-codegen/src/lower_call/early_branches.rs:382— crates/perry-codegen/src/lower_call/early_branches.rs:382-1225 | crates/perry-codegen/src/lower_call/func_ref.rs:832-1472 | crates/perry-codegen/src/lower_call/method_override.rs:783-1914 | crates/perry-codegen/src/lower_call/scalar_method.rs:858-1003 | crates/perry-codegen/src/lower_call/scalar_method.rs:1009-1224 — 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/perry-codegen/src/lower_call/property_get.rs:58— crates/perry-codegen/src/lower_call/property_get.rs:58-148 | crates/perry-codegen/src/lower_call/property_get.rs:235-289 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:16-229 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:80-218 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:231-382 — 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/perry-hir/src/audit.rs:99— crates/perry-hir/src/audit.rs:99-188 | crates/perry-hir/src/capability.rs:138-226 | crates/perry-hir/src/egress.rs:130-218 | crates/perry-hir/src/lockdown.rs:87-175 | crates/perry-hir/src/lower/expr_function.rs:1653-1760 — 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) scripts/addr_class_inventory.py:324— scripts/addr_class_inventory.py:324-350 | scripts/addr_class_inventory.py:684-712 | scripts/gc_store_site_inventory.py:254-280 | scripts/sso_unbox_inventory.py:384-404 | scripts/string_payload_access_inventory.py:243-265 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (17–18 lines × 2) crates/perry-codegen-arkts/src/util.rs:46— crates/perry-codegen-arkts/src/util.rs:46-63 | crates/perry-codegen-arkts/src/widgets/image.rs:60-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–18 lines × 2) crates/perry-codegen-glance/src/emit_glue.rs:52— crates/perry-codegen-glance/src/emit_glue.rs:52-69 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:43-59 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (17–18 lines × 2) crates/perry-codegen/src/stmt/loops.rs:421— crates/perry-codegen/src/stmt/loops.rs:421-438 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:495-511 — before extracting anything, compare `crates/perry-codegen/src/stmt/loops.rs` and `crates/perry-codegen/src/stmt/stable_packed_loop.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) crates/perry-hir/src/lower/context.rs:1778— crates/perry-hir/src/lower/context.rs:1778-1795 | crates/perry-hir/src/lower/context.rs:1841-1857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) crates/perry-hir/src/lower/expr_assign.rs:1225— crates/perry-hir/src/lower/expr_assign.rs:1225-1241 | crates/perry-hir/src/lower/expr_assign.rs:1331-1348 — both copies are in the same file, so extract the block into 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/perry-codegen-wasm/src/emit/locals.rs:328— crates/perry-codegen-wasm/src/emit/locals.rs:328-345 | crates/perry-codegen-wasm/src/emit/locals.rs:452-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–18 lines × 2) crates/perry-codegen/src/expr/ta_element_read.rs:314— crates/perry-codegen/src/expr/ta_element_read.rs:314-331 | crates/perry-codegen/src/expr/typed_element.rs:392-407 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16–18 lines × 2) crates/perry-codegen/src/type_analysis/refine.rs:564— crates/perry-codegen/src/type_analysis/refine.rs:564-581 | crates/perry-codegen/src/type_analysis/strings.rs:776-791 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16–18 lines × 2) crates/perry-hir/src/destructuring/pattern_binding.rs:314— crates/perry-hir/src/destructuring/pattern_binding.rs:314-329 | crates/perry-hir/src/destructuring/pattern_binding.rs:596-613 — both copies are in the same file, so extract the block into 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/perry-hir/src/monomorph/infer.rs:41— crates/perry-hir/src/monomorph/infer.rs:41-58 | crates/perry-hir/src/monomorph/update_call_sites.rs:711-726 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–14 lines × 2) crates/perry-codegen/src/expr/misc_methods.rs:102— crates/perry-codegen/src/expr/misc_methods.rs:102-115 | crates/perry-codegen/src/lower_call/method_override.rs:56-66 — 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–14 lines × 2) crates/perry-ext-http/src/server/response_end.rs:47— crates/perry-ext-http/src/server/response_end.rs:47-57 | crates/perry-ext-http/src/server/response_end.rs:108-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.
Duplicated block (11–14 lines × 2) crates/perry-hir/src/lower/expr_member/member_tail.rs:709— crates/perry-hir/src/lower/expr_member/member_tail.rs:709-722 | crates/perry-hir/src/lower/expr_member/member_tail.rs:738-748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–14 lines × 2) crates/perry-hir/src/lower/stmt.rs:1343— crates/perry-hir/src/lower/stmt.rs:1343-1353 | crates/perry-hir/src/lower_decl/body_stmt.rs:875-888 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–14 lines × 2) crates/perry-hir/src/lower_patterns.rs:1180— crates/perry-hir/src/lower_patterns.rs:1180-1190 | crates/perry-hir/src/lower_patterns.rs:1255-1268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:583— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:583-593 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1897-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) crates/perry-codegen/src/lower_string_method/char_code_at.rs:250— crates/perry-codegen/src/lower_string_method/char_code_at.rs:250-262 | crates/perry-codegen/src/lower_string_method/char_code_at.rs:302-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) crates/perry-hir/src/lower/lower_module_fn.rs:1366— crates/perry-hir/src/lower/lower_module_fn.rs:1366-1378 | crates/perry-hir/src/lower/lower_module_fn.rs:1694-1704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1767— crates/perry-hir/src/lower/stmt_loops.rs:1767-1777 | crates/perry-hir/src/lower_decl/body_stmt.rs:2251-2263 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–13 lines × 2) scripts/sso_unbox_inventory.py:394— scripts/sso_unbox_inventory.py:394-404 | scripts/string_payload_access_inventory.py:253-265 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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–5 lines × 4) crates/perry-codegen/src/codegen/method_trampolines.rs:108— crates/perry-codegen/src/codegen/method_trampolines.rs:108-110 | crates/perry-codegen/src/codegen/method_trampolines.rs:154-158 | crates/perry-codegen/src/codegen/method_trampolines.rs:208-212 | crates/perry-codegen/src/codegen/method_trampolines.rs:411-415 — 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 (3–5 lines × 4) crates/perry-codegen/src/codegen/method_trampolines.rs:311— crates/perry-codegen/src/codegen/method_trampolines.rs:311-313 | crates/perry-codegen/src/expr/arrays_finds.rs:178-182 | crates/perry-codegen/src/expr/class_field_push.rs:74-80 | crates/perry-codegen/src/expr/u8_buffer_read.rs:303-308 — 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 (3–5 lines × 4) crates/perry-codegen/src/expr/static_method.rs:513— crates/perry-codegen/src/expr/static_method.rs:513-517 | crates/perry-codegen/src/lower_array_method.rs:1218-1222 | crates/perry-codegen/src/lower_call/console_promise.rs:788-790 | crates/perry-codegen/src/lower_call/property_get/builtin_kind_guard.rs:315-319 — 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 (3–5 lines × 4) crates/perry-codegen/src/expr/binary.rs:88— crates/perry-codegen/src/expr/binary.rs:88-92 | crates/perry-codegen/src/expr/binary.rs:101-105 | crates/perry-codegen/src/lower_call/buffer_intrinsic.rs:482-484 | crates/perry-codegen/src/stmt/loops.rs:6792-6796 — before extracting anything, compare `crates/perry-codegen/src/expr/binary.rs` and `crates/perry-codegen/src/stmt/loops.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (3–5 lines × 4) crates/perry-container-compose/src/backend/apple.rs:99— crates/perry-container-compose/src/backend/apple.rs:99-101 | crates/perry-container-compose/src/backend/apple.rs:162-164 | crates/perry-container-compose/src/backend/docker.rs:103-107 | crates/perry-container-compose/src/backend/docker.rs:171-175 — before extracting anything, compare `crates/perry-container-compose/src/backend/apple.rs` and `crates/perry-container-compose/src/backend/docker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Swallowed exception (caught, then discarded) upstream/actions/actions/checkout/src/git-source-provider.ts:345— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) upstream/actions/Swatinem/rust-cache/src/config.ts:202— `catch (_e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) scripts/ci_ext_link_scope.py:170— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) scripts/node_suite_run.py:106— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) scripts/node_suite_run.py:123— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
UseWalk::walk_expr (cyclomatic 63) crates/perry-codegen/src/collectors/ptr_shape.rs:1417— UseWalk::walk_expr 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.
UseWalk::walk_expr (cyclomatic 44) crates/perry-codegen/src/collectors/ptr_numarray.rs:675— UseWalk::walk_expr 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.
UseWalk::walk_stmt (cyclomatic 41) crates/perry-codegen/src/collectors/ptr_shape.rs:1202— UseWalk::walk_stmt 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.
UseWalk::walk_stmt (cyclomatic 22) crates/perry-codegen/src/collectors/ptr_numarray.rs:585— UseWalk::walk_stmt 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.
Walk::stmt (cyclomatic 37) crates/perry-codegen/src/collectors/read_before_write.rs:448— Walk::stmt 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.
Walk::seed_stmts (cyclomatic 24) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:155— Walk::seed_stmts 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.
Walk::judge_stmts (cyclomatic 21) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:259— Walk::judge_stmts 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.
Walk::visit (cyclomatic 19) crates/perry-codegen/src/providers.rs:157— Walk::visit 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.
DirectParser::parse_number (cyclomatic 37) crates/perry-runtime/src/json/parser.rs:1258— DirectParser::parse_number 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.
DirectParser::parse_object_untyped (cyclomatic 36) crates/perry-runtime/src/json/parser.rs:944— DirectParser::parse_object_untyped 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.
DirectParser::parse_string_bytes_slow (cyclomatic 25) crates/perry-runtime/src/json/parser.rs:725— DirectParser::parse_string_bytes_slow 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.
DirectParser::decode_chunk (cyclomatic 19) crates/perry-runtime/src/json/parser_escape_chunk.rs:10— DirectParser::decode_chunk 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.
perry_ui_tvos::audio_playback::perry_audio_load_sound (cyclomatic 20) crates/perry-ui-tvos/src/audio_playback.rs:257— perry_ui_tvos::audio_playback::perry_audio_load_sound 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.
perry_ui_tvos::state::state_set (cyclomatic 20) crates/perry-ui-tvos/src/state.rs:128— perry_ui_tvos::state::state_set 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.
perry_ui_tvos::audio_playback::perry_audio_play (cyclomatic 18) crates/perry-ui-tvos/src/audio_playback.rs:418— perry_ui_tvos::audio_playback::perry_audio_play 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.
perry_ui_tvos::widgets::alert::topmost_view_controller (cyclomatic 18) crates/perry-ui-tvos/src/widgets/alert.rs:37— perry_ui_tvos::widgets::alert::topmost_view_controller 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.
Census::compute (cognitive 218) crates/perry-codegen/src/codegen/reach_report.rs:424— Census::compute has cognitive complexity 218 (threshold 15). Drivers by points: if/else 33 (115 pts), loops 37 (83 pts), match/switch 3 (12 pts), boolean chains 8 (nesting depth added 137). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Census::capture (cognitive 43) crates/perry-codegen/src/codegen/reach_report.rs:886— Census::capture has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 7 (18 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.
Census::precise_nodes (cognitive 37) crates/perry-codegen/src/codegen/reach_report.rs:1002— Census::precise_nodes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 6 (12 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Census::body (cognitive 24) crates/perry-codegen/src/layout_families/late.rs:372— Census::body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 5 (11 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.
DirectParser::parse_object_untyped (cognitive 73) crates/perry-runtime/src/json/parser.rs:944— DirectParser::parse_object_untyped has cognitive complexity 73 (threshold 15). Drivers by points: if/else 29 (51 pts), boolean chains 13, match/switch 3 (8 pts), loops 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.
DirectParser::parse_number (cognitive 59) crates/perry-runtime/src/json/parser.rs:1258— DirectParser::parse_number has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 6 (15 pts), boolean chains 14, match/switch 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.
DirectParser::parse_string_bytes_slow (cognitive 41) crates/perry-runtime/src/json/parser.rs:725— DirectParser::parse_string_bytes_slow has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (30 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectParser::decode_chunk (cognitive 22) crates/perry-runtime/src/json/parser_escape_chunk.rs:10— DirectParser::decode_chunk has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (5 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.
perry_wasm_host::instantiate_with_import_callbacks (cognitive 73) crates/perry-wasm-host/src/lib.rs:374— perry_wasm_host::instantiate_with_import_callbacks has cognitive complexity 73 (threshold 15). Drivers by points: if/else 16 (53 pts), loops 4 (12 pts), match/switch 2 (8 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_wasm_host::tables::perry_wasm_host_instance_table_get (cognitive 23) crates/perry-wasm-host/src/tables.rs:37— perry_wasm_host::tables::perry_wasm_host_instance_table_get has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 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.
perry_wasm_host::finish_instance_call (cognitive 16) crates/perry-wasm-host/src/lib.rs:208— perry_wasm_host::finish_instance_call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_wasm_host::externals::perry_wasm_host_func_call (cognitive 16) crates/perry-wasm-host/src/externals.rs:293— perry_wasm_host::externals::perry_wasm_host_func_call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, match/switch 2 (3 pts), loops 2 (nesting depth added 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.
perry_container_compose::capabilities::required_features (cognitive 63) crates/perry-container-compose/src/capabilities.rs:502— perry_container_compose::capabilities::required_features has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 4 (9 pts), boolean chains 5 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_container_compose::capabilities::unsupported_feature_names (cognitive 20) crates/perry-container-compose/src/capabilities.rs:441— perry_container_compose::capabilities::unsupported_feature_names has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
perry_container_compose::compose::resolve_startup_order (cognitive 18) crates/perry-container-compose/src/compose.rs:1000— perry_container_compose::compose::resolve_startup_order has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 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.
perry_container_compose::cli::run (cognitive 17) crates/perry-container-compose/src/cli.rs:116— perry_container_compose::cli::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 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.
FnReader::typed (cognitive 59) crates/perry-codegen/src/dialect/mod.rs:1348— FnReader::typed has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (38 pts), match/switch 8 (15 pts), loops 3 (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.
FnReader::call (cognitive 26) crates/perry-codegen/src/dialect/mod.rs:832— FnReader::call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 7 (10 pts), loops 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.
FnReader::call_asm (cognitive 20) crates/perry-codegen/src/dialect/mod.rs:989— FnReader::call_asm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 4 (5 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.
FnReader::binary_or_cast (cognitive 20) crates/perry-codegen/src/dialect/mod.rs:1097— FnReader::binary_or_cast has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 3 (5 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.
Walk::stmt (cognitive 46) crates/perry-codegen/src/collectors/read_before_write.rs:448— Walk::stmt has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 4 (9 pts), match/switch 3 (5 pts), boolean chains 2 (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.
Walk::seed_stmts (cognitive 42) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:155— Walk::seed_stmts has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 2 (4 pts), match/switch 1 (2 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.
Walk::judge_stmts (cognitive 30) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:259— Walk::judge_stmts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (4 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.
Walk::visit (cognitive 25) crates/perry-codegen/src/providers.rs:157— Walk::visit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Fixer::find_issues_in_class (cognitive 45) crates/perry/src/commands/fixer.rs:322— Fixer::find_issues_in_class has cognitive complexity 45 (threshold 15). Drivers by points: if/else 7 (31 pts), loops 3 (8 pts), match/switch 2 (6 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.
Fixer::find_any_in_ts_type (cognitive 40) crates/perry/src/commands/fixer.rs:399— Fixer::find_any_in_ts_type has cognitive complexity 40 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 5 (14 pts), match/switch 3 (5 pts) (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Fixer::find_issues_in_expr (cognitive 32) crates/perry/src/commands/fixer.rs:477— Fixer::find_issues_in_expr has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 5 (11 pts), 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.
Fixer::collect_usages_in_expr (cognitive 24) crates/perry/src/commands/fixer.rs:154— Fixer::collect_usages_in_expr has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Generator::generate (cognitive 36) crates/perry-wit/src/guest_c.rs:180— Generator::generate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 9 (15 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.
Generator::function (cognitive 36) crates/perry-wit/src/guest_c.rs:317— Generator::function has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator::experimental_import (cognitive 21) crates/perry-wit/src/guest_c/asynchronous/imports.rs:7— Generator::experimental_import has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 3 (4 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.
Generator::experimental_export (cognitive 17) crates/perry-wit/src/guest_c/asynchronous.rs:54— Generator::experimental_export has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Duplicated block (46 lines × 2) crates/perry-codegen/src/codegen/entry.rs:835— crates/perry-codegen/src/codegen/entry.rs:835-880 | crates/perry-codegen/src/codegen/entry/module_init.rs:315-360 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (46 lines × 2) crates/perry-hir/src/lower/expr_call/globals.rs:695— crates/perry-hir/src/lower/expr_call/globals.rs:695-740 | crates/perry-hir/src/lower/expr_call/module_static.rs:268-313 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (46 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1052— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1052-1097 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1400-1445 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1052` 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 (46 lines × 2) scripts/gc_store_site_inventory.py:1269— scripts/gc_store_site_inventory.py:1269-1314 | scripts/gc_store_site_inventory.py:1335-1380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/gc_store_site_inventory.py:1269` 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 (33 lines × 2) crates/perry-codegen/src/boxed_vars.rs:1159— crates/perry-codegen/src/boxed_vars.rs:1159-1191 | crates/perry-codegen/src/boxed_vars.rs:1372-1404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) crates/perry-codegen/src/stmt/loops.rs:5211— crates/perry-codegen/src/stmt/loops.rs:5211-5243 | crates/perry-codegen/src/stmt/loops.rs:5263-5295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:276— crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:276-308 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:205-237 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:586— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:586-618 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:737-769 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (29 lines × 2) crates/perry-codegen/src/codegen/entry.rs:964— crates/perry-codegen/src/codegen/entry.rs:964-992 | crates/perry-codegen/src/codegen/entry/module_init.rs:444-472 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/expr/bigint_set.rs:988— crates/perry-codegen/src/expr/bigint_set.rs:988-1016 | crates/perry-codegen/src/expr/bigint_set.rs:1244-1272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/perry-codegen/src/expr/binary.rs:1114— crates/perry-codegen/src/expr/binary.rs:1114-1142 | crates/perry-codegen/src/expr/mod.rs:4039-4067 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (29 lines × 2) scripts/gc_store_site_inventory.py:1356— scripts/gc_store_site_inventory.py:1356-1384 | scripts/gc_store_site_inventory.py:1459-1487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/gc_store_site_inventory.py:1356` 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 (24 lines × 2) crates/perry-codegen/src/stmt/loops.rs:8346— crates/perry-codegen/src/stmt/loops.rs:8346-8369 | crates/perry-codegen/src/stmt/loops.rs:8433-8456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) crates/perry-codegen/src/stmt/loops.rs:9545— crates/perry-codegen/src/stmt/loops.rs:9545-9568 | crates/perry-codegen/src/type_analysis/pod.rs:666-689 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24 lines × 2) android-build/app/src/main/java/com/perry/app/PerryActivity.kt:140— android-build/app/src/main/java/com/perry/app/PerryActivity.kt:140-163 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryActivity.kt:201-224 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryActivity.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryActivity.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (24 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1028— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1028-1051 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1376-1399 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1028` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–20 lines × 2) crates/perry-codegen/src/codegen/string_pool.rs:1099— crates/perry-codegen/src/codegen/string_pool.rs:1099-1118 | crates/perry-codegen/src/codegen/string_pool.rs:1176-1192 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/perry-codegen/src/expr/v8_interop.rs:109— crates/perry-codegen/src/expr/v8_interop.rs:109-128 | crates/perry-codegen/src/expr/v8_interop.rs:212-228 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/perry-ext-pdf/src/lib.rs:581— crates/perry-ext-pdf/src/lib.rs:581-600 | crates/perry-ext-pdf/src/lib.rs:601-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–20 lines × 2) crates/perry-hir/src/lower_decl/class_members.rs:699— crates/perry-hir/src/lower_decl/class_members.rs:699-718 | crates/perry-hir/src/lower_decl/private_members.rs:224-240 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–17 lines × 2) crates/perry-codegen/src/expr/folded_builtin_override.rs:716— crates/perry-codegen/src/expr/folded_builtin_override.rs:716-728 | crates/perry-codegen/src/lower_call/property_get/own_override_guard.rs:331-347 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–17 lines × 2) crates/perry-container-compose/src/compose.rs:1134— crates/perry-container-compose/src/compose.rs:1134-1150 | crates/perry-container-compose/src/compose.rs:1189-1201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–17 lines × 2) crates/perry-ext-net/src/payload_closed.rs:132— crates/perry-ext-net/src/payload_closed.rs:132-144 | crates/perry-ext-net/src/payload_server.rs:705-721 — before extracting anything, compare `crates/perry-ext-net/src/payload_closed.rs` and `crates/perry-ext-net/src/payload_server.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.
Duplicated block (13–17 lines × 2) crates/perry-hir/src/js_transform/local_natives.rs:108— crates/perry-hir/src/js_transform/local_natives.rs:108-124 | crates/perry-hir/src/js_transform/local_natives.rs:130-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 4) crates/perry-codegen/src/codegen/closure.rs:1367— crates/perry-codegen/src/codegen/closure.rs:1367-1381 | crates/perry-codegen/src/codegen/function.rs:1476-1490 | crates/perry-codegen/src/codegen/method.rs:758-772 | crates/perry-codegen/src/codegen/method_static.rs:433-447 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) crates/perry-codegen/src/expr/bigint_set.rs:240— crates/perry-codegen/src/expr/bigint_set.rs:240-254 | crates/perry-codegen/src/expr/bigint_set.rs:309-323 | crates/perry-codegen/src/expr/logical_collections.rs:532-546 | crates/perry-codegen/src/expr/math_simple.rs:415-429 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) crates/perry-codegen/src/expr/property_get.rs:968— crates/perry-codegen/src/expr/property_get.rs:968-982 | crates/perry-codegen/src/expr/property_get.rs:1058-1072 | crates/perry-codegen/src/expr/property_set.rs:651-665 | crates/perry-codegen/src/expr/property_set.rs:788-802 — before extracting anything, compare `crates/perry-codegen/src/expr/property_get.rs` and `crates/perry-codegen/src/expr/property_set.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) crates/perry-container-compose/src/backend/apple.rs:110— crates/perry-container-compose/src/backend/apple.rs:110-124 | crates/perry-container-compose/src/backend/apple.rs:169-183 | crates/perry-container-compose/src/backend/docker.rs:130-144 | crates/perry-container-compose/src/backend/docker.rs:183-197 — before extracting anything, compare `crates/perry-container-compose/src/backend/apple.rs` and `crates/perry-container-compose/src/backend/docker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) crates/perry-codegen/src/codegen/function.rs:1366— crates/perry-codegen/src/codegen/function.rs:1366-1379 | crates/perry-codegen/src/codegen/method_static.rs:325-339 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 268 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) crates/perry-codegen/src/expr/misc_methods.rs:666— crates/perry-codegen/src/expr/misc_methods.rs:666-679 | crates/perry-codegen/src/expr/misc_methods.rs:702-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/perry-codegen/src/loop_purity.rs:142— crates/perry-codegen/src/loop_purity.rs:142-155 | crates/perry-codegen/src/loop_purity.rs:697-711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/perry-codegen/src/stmt/loops.rs:3381— crates/perry-codegen/src/stmt/loops.rs:3381-3394 | crates/perry-codegen/src/stmt/loops.rs:3489-3503 — both copies are in the same file, so extract the block into 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/perry-codegen/src/collectors/segview.rs:1295— crates/perry-codegen/src/collectors/segview.rs:1295-1307 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1487-1501 — before extracting anything, compare `crates/perry-codegen/src/collectors/segview.rs` and `crates/perry-hir/src/lower/shared_mutable_capture.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–15 lines × 2) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:506— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:506-518 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1850-1864 — both copies are in the same file, so extract the block into 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/perry-codegen/src/stmt/class_first_loop.rs:472— crates/perry-codegen/src/stmt/class_first_loop.rs:472-486 | crates/perry-hir/src/lower/shared_mutable_capture.rs:799-811 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–15 lines × 2) crates/perry-ext-http/src/client_events.rs:315— crates/perry-ext-http/src/client_events.rs:315-329 | crates/perry-ext-http/src/client_events.rs:548-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.
Duplicated block (12 lines × 4) crates/perry-codegen-arkts/src/mutations.rs:1015— crates/perry-codegen-arkts/src/mutations.rs:1015-1026 | crates/perry-codegen-arkts/src/widgets/scroll.rs:138-149 | crates/perry-codegen-arkts/src/widgets/scroll.rs:292-303 | crates/perry-codegen-arkts/src/widgets/stack.rs:121-132 — 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 (12 lines × 4) crates/perry-codegen/src/collectors/escape_check.rs:492— crates/perry-codegen/src/collectors/escape_check.rs:492-503 | crates/perry-codegen/src/collectors/escape_news.rs:328-339 | crates/perry-codegen/src/collectors/i32_locals.rs:1292-1303 | crates/perry-codegen/src/collectors/refs.rs:255-266 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/escape_news.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) crates/perry-codegen/src/lower_call/method_override.rs:1316— crates/perry-codegen/src/lower_call/method_override.rs:1316-1327 | crates/perry-codegen/src/lower_call/method_override.rs:1400-1411 | crates/perry-codegen/src/lower_call/method_override.rs:1486-1497 | crates/perry-codegen/src/lower_call/method_override.rs:1573-1584 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:84— crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:84-95 | crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs:109-120 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:84-95 | crates/perry-hir/src/lower_decl/body_stmt/detect.rs:109-120 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops/for_await_targets.rs` and `crates/perry-hir/src/lower_decl/body_stmt/detect.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-codegen/src/codegen/closure.rs:88— crates/perry-codegen/src/codegen/closure.rs:88-98 | crates/perry-codegen/src/codegen/function.rs:265-274 | crates/perry-codegen/src/codegen/method_trampolines.rs:64-73 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–11 lines × 3) crates/perry-codegen/src/codegen/function.rs:1315— crates/perry-codegen/src/codegen/function.rs:1315-1324 | crates/perry-codegen/src/codegen/method.rs:602-612 | crates/perry-codegen/src/codegen/method_static.rs:274-283 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–11 lines × 3) crates/perry-codegen/src/collectors/hir_facts.rs:1274— crates/perry-codegen/src/collectors/hir_facts.rs:1274-1283 | crates/perry-codegen/src/collectors/shadow_slots.rs:146-156 | crates/perry-hir/src/lower/lower_module_fn.rs:152-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10–11 lines × 3) crates/perry-hir/src/lower/expr_object.rs:368— crates/perry-hir/src/lower/expr_object.rs:368-377 | crates/perry-hir/src/lower/expr_object.rs:595-604 | crates/perry-hir/src/lower_decl/class_members.rs:295-305 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/class_members.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 2) crates/perry-codegen/src/codegen/spec_return_proof.rs:56— crates/perry-codegen/src/codegen/spec_return_proof.rs:56-65 | crates/perry-codegen/src/lower_call/func_ref.rs:410-417 — before extracting anything, compare `crates/perry-codegen/src/codegen/spec_return_proof.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 2) crates/perry-codegen/src/expr/class_env.rs:157— crates/perry-codegen/src/expr/class_env.rs:157-166 | crates/perry-codegen/src/expr/wpfacts_access.rs:224-231 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–10 lines × 2) crates/perry-codegen/src/expr/property_get.rs:702— crates/perry-codegen/src/expr/property_get.rs:702-711 | crates/perry-codegen/src/expr/property_get.rs:715-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) crates/perry-codegen/src/lower_conditional.rs:364— crates/perry-codegen/src/lower_conditional.rs:364-371 | crates/perry-codegen/src/stmt/if_stmt.rs:183-192 — before extracting anything, compare `crates/perry-codegen/src/lower_conditional.rs` and `crates/perry-codegen/src/stmt/if_stmt.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-codegen/src/codegen/artifacts.rs:486— crates/perry-codegen/src/codegen/artifacts.rs:486-493 | crates/perry-codegen/src/codegen/artifacts.rs:510-516 | crates/perry-codegen/src/codegen/artifacts.rs:534-540 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) crates/perry-codegen/src/expr/index_get/guarded_array.rs:666— crates/perry-codegen/src/expr/index_get/guarded_array.rs:666-673 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch_select.rs:111-117 | crates/perry-codegen/src/lower_string_method.rs:331-337 — 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–8 lines × 3) crates/perry-hir/src/js_transform/imports.rs:556— crates/perry-hir/src/js_transform/imports.rs:556-563 | crates/perry-hir/src/js_transform/imports.rs:595-602 | crates/perry-hir/src/js_transform/imports.rs:632-638 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) crates/perry-hir/src/lower_decl/class_members.rs:104— crates/perry-hir/src/lower_decl/class_members.rs:104-111 | crates/perry-hir/src/lower_decl/class_members.rs:529-535 | crates/perry-hir/src/lower_decl/private_members.rs:118-124 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 5) crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:24— crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:24-29 | crates/perry-codegen/src/expr/typed_feedback.rs:208-213 | crates/perry-codegen/src/module.rs:902-907 | crates/perry-codegen/src/module.rs:951-956 | crates/perry-codegen/src/strings.rs:334-339 — 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 (6 lines × 5) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:15— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:15-20 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:65-70 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:181-186 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:270-275 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:309-314 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) crates/perry-codegen/src/expr/js_runtime.rs:53— crates/perry-codegen/src/expr/js_runtime.rs:53-58 | crates/perry-codegen/src/expr/js_runtime.rs:76-81 | crates/perry-codegen/src/expr/js_runtime.rs:108-113 | crates/perry-codegen/src/expr/js_runtime.rs:152-157 | crates/perry-codegen/src/expr/js_runtime.rs:205-210 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) crates/perry-codegen/src/expr/misc_methods.rs:342— crates/perry-codegen/src/expr/misc_methods.rs:342-347 | crates/perry-codegen/src/expr/misc_methods.rs:408-413 | crates/perry-codegen/src/expr/misc_methods.rs:469-474 | crates/perry-codegen/src/expr/misc_methods.rs:566-571 | crates/perry-codegen/src/expr/misc_methods.rs:608-613 — 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 (3–6 lines × 5) crates/perry-codegen/src/expr/this_super_call.rs:695— crates/perry-codegen/src/expr/this_super_call.rs:695-700 | crates/perry-codegen/src/expr/this_super_call.rs:1162-1164 | crates/perry-codegen/src/expr/this_super_call.rs:1211-1216 | crates/perry-codegen/src/expr/this_super_call.rs:1245-1250 | crates/perry-codegen/src/expr/this_super_call.rs:1278-1283 — 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 (3–6 lines × 5) crates/perry-codegen/src/codegen/method.rs:1435— crates/perry-codegen/src/codegen/method.rs:1435-1440 | crates/perry-codegen/src/expr/array_literal.rs:256-258 | crates/perry-codegen/src/expr/this_super_call.rs:1346-1351 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:27-29 | crates/perry-codegen/src/lower_call/scalar_method.rs:830-834 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (3–6 lines × 5) crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:714— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:714-719 | crates/perry-codegen/src/expr/private_resume_frame.rs:33-35 | crates/perry-codegen/src/expr/private_resume_frame.rs:203-206 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1067-1072 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1096-1098 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs` and `crates/perry-codegen/src/stmt/stable_packed_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (3–6 lines × 5) crates/perry-codegen/src/stmt/loops.rs:3727— crates/perry-codegen/src/stmt/loops.rs:3727-3732 | crates/perry-codegen/src/stmt/loops.rs:7329-7332 | crates/perry-codegen/src/stmt/loops.rs:7406-7408 | crates/perry-codegen/src/stmt/masked_window_region.rs:781-783 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1559-1564 — before extracting anything, compare `crates/perry-codegen/src/stmt/loops.rs` and `crates/perry-codegen/src/stmt/masked_window_region.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 (4–6 lines × 3) crates/perry-codegen/src/codegen/method.rs:1101— crates/perry-codegen/src/codegen/method.rs:1101-1106 | crates/perry-codegen/src/expr/this_super_call.rs:1163-1166 | crates/perry-codegen/src/expr/write_barrier.rs:1137-1143 — 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 (4–6 lines × 3) crates/perry-codegen/src/expr/calls/crypto_hash.rs:356— crates/perry-codegen/src/expr/calls/crypto_hash.rs:356-361 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:600-605 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:688-691 — 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 (4–6 lines × 3) crates/perry-ext-http/src/response_headers.rs:68— crates/perry-ext-http/src/response_headers.rs:68-71 | crates/perry-ext-http/src/response_headers.rs:76-81 | crates/perry-ext-http/src/response_headers.rs:100-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.
Duplicated block (4–6 lines × 3) scripts/buffer_b1_validate.py:179— scripts/buffer_b1_validate.py:179-184 | scripts/buffer_b4_validate.py:191-196 | scripts/buffer_b5_validate.py:44-47 — before extracting anything, compare `scripts/buffer_b1_validate.py` and `scripts/buffer_b4_validate.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (5 lines × 6) scripts/compiler_output_harness/repsel_knob_isolation.py:540— scripts/compiler_output_harness/repsel_knob_isolation.py:540-544 | scripts/compiler_output_harness/repsel_knob_isolation.py:551-555 | scripts/compiler_output_harness/repsel_knob_isolation.py:560-564 | scripts/compiler_output_harness/repsel_knob_isolation.py:569-573 | scripts/compiler_output_harness/repsel_knob_isolation.py:583-587 | scripts/compiler_output_harness/repsel_knob_isolation.py:608-612 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/compiler_output_harness/repsel_knob_isolation.py:588` calls `arm` and `scripts/compiler_output_harness/repsel_knob_isolation.py:545` 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 × 6) scripts/component_async_acceptance.py:17— scripts/component_async_acceptance.py:17-21 | scripts/component_http_acceptance.py:27-31 | scripts/component_p3_command_acceptance.py:46-50 | scripts/component_persistent_acceptance.py:17-21 | scripts/component_producer_acceptance.py:17-21 | scripts/component_reader_acceptance.py:17-21 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) scripts/component_async_acceptance.py:49— scripts/component_async_acceptance.py:49-53 | scripts/component_async_guest_exports_acceptance.py:39-44 | scripts/component_persistent_acceptance.py:40-44 | scripts/component_producer_acceptance.py:49-53 | scripts/component_reader_acceptance.py:47-51 | scripts/component_scheduler_wake_acceptance.py:34-39 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/component_async_acceptance.py:49` 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 × 6) docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:54— docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:54-58 | docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:54-58 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:53-57 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:53-57 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:53-57 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:63-67 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py` and `docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py` as WHOLE FILES: this scan already matched 5 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:1910— crates/perry-codegen-js/src/web_runtime.js:1910 · crates/perry-codegen-wasm/src/wasm_runtime.js:3742 — 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 (18 lines × 2 locations) packages/perry-styling/src/color.ts:60— packages/perry-styling/src/color.ts:60 · packages/perry-styling/src/color.ts:84 — 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 (18 lines × 2 locations) scripts/publish/release.mts:276— scripts/publish/release.mts:276 · scripts/publish/release.mts:306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2 locations) scripts/turnloop/apps/db_thread_census.ts:105— scripts/turnloop/apps/db_thread_census.ts:105 · scripts/turnloop/apps/db_thread_census.ts:128 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (17 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:1242— crates/perry-codegen-js/src/web_runtime.js:1242 · crates/perry-codegen-wasm/src/wasm_runtime.js:3107 — 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 (17 lines × 2 locations) scripts/turnloop/apps/_helpers/tokio_worker_agent_census_worker.ts:7— scripts/turnloop/apps/_helpers/tokio_worker_agent_census_worker.ts:7 · scripts/turnloop/apps/tokio_worker_agent_census.ts:28 — 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 (17 lines × 2 locations) scripts/turnloop/apps/db_thread_census.ts:33— scripts/turnloop/apps/db_thread_census.ts:33 · scripts/turnloop/apps/pg_thread_census.ts:32 — 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 (17 lines × 2 locations) scripts/turnloop/apps/pg_parity.ts:38— scripts/turnloop/apps/pg_parity.ts:38 · scripts/turnloop/apps/pg_tls_parity.ts:27 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Census::compute (cyclomatic 85) crates/perry-codegen/src/codegen/reach_report.rs:424— Census::compute has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Census::body (cyclomatic 24) crates/perry-codegen/src/layout_families/late.rs:372— Census::body 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.
Census::precise_nodes (cyclomatic 16) crates/perry-codegen/src/codegen/reach_report.rs:1002— Census::precise_nodes 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.
perry_runtime_manifest::realm_json::parse (cyclomatic 48) crates/perry-runtime-manifest/src/realm_json.rs:90— perry_runtime_manifest::realm_json::parse 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.
perry_runtime_manifest::realm_source::declarations (cyclomatic 41) crates/perry-runtime-manifest/src/realm_source.rs:150— perry_runtime_manifest::realm_source::declarations 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.
perry_runtime_manifest::realm_source::tokens (cyclomatic 32) crates/perry-runtime-manifest/src/realm_source.rs:18— perry_runtime_manifest::realm_source::tokens 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.
perry_parser::normalize_unicode_identifier_escapes_with_metadata (cyclomatic 46) crates/perry-parser/src/lib.rs:442— perry_parser::normalize_unicode_identifier_escapes_with_metadata has cyclomatic complexity 46 (threshold 15). Of this number, 33 points are the body's own statements and 13 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.
perry_parser::normalize_swc_class_syntax_with_metadata (cyclomatic 22) crates/perry-parser/src/lib.rs:786— perry_parser::normalize_swc_class_syntax_with_metadata 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.
perry_parser::strip_comments_and_strings (cyclomatic 20) crates/perry-parser/src/lib.rs:237— perry_parser::strip_comments_and_strings 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.
perry_ext_zlib::js_ext_zlib_native_dispatch (cyclomatic 40) crates/perry-ext-zlib/src/lib.rs:427— perry_ext_zlib::js_ext_zlib_native_dispatch has cyclomatic complexity 40 (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.
perry_ext_zlib::stream::create_stream (cyclomatic 34) crates/perry-ext-zlib/src/stream.rs:762— perry_ext_zlib::stream::create_stream has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
perry_ext_zlib::stream::one_shot_callback::run (cyclomatic 29) crates/perry-ext-zlib/src/stream/one_shot_callback.rs:174— perry_ext_zlib::stream::one_shot_callback::run 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.
Emitter::lower_inner (cyclomatic 39) crates/perry-wit/src/guest_c/values.rs:320— Emitter::lower_inner 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.
Emitter::lift (cyclomatic 30) crates/perry-wit/src/guest_c/values.rs:147— Emitter::lift 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.
Emitter::discard_owned (cyclomatic 17) crates/perry-wit/src/guest_c/values/discard.rs:32— Emitter::discard_owned 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.
perry_perex::tooling::dialect::translate (cyclomatic 31) crates/perry-perex/src/tooling/dialect.rs:80— perry_perex::tooling::dialect::translate 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.
perry_perex::tooling::dialect::common_escape (cyclomatic 23) crates/perry-perex/src/tooling/dialect.rs:212— perry_perex::tooling::dialect::common_escape 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.
perry_perex::tooling::dialect::class (cyclomatic 17) crates/perry-perex/src/tooling/dialect.rs:289— perry_perex::tooling::dialect::class 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.
Fixer::find_issues_in_expr (cyclomatic 23) crates/perry/src/commands/fixer.rs:477— Fixer::find_issues_in_expr has cyclomatic complexity 23 (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.
Fixer::find_any_in_ts_type (cyclomatic 19) crates/perry/src/commands/fixer.rs:399— Fixer::find_any_in_ts_type 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.
Fixer::collect_usages_in_expr (cyclomatic 16) crates/perry/src/commands/fixer.rs:154— Fixer::collect_usages_in_expr has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GcCycleState::step_reclaim (cyclomatic 23) crates/perry-runtime/src/gc/cycle.rs:1669— GcCycleState::step_reclaim 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.
GcCycleState::step_atomic_finalize_current_subphase (cyclomatic 22) crates/perry-runtime/src/gc/cycle.rs:1233— GcCycleState::step_atomic_finalize_current_subphase 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.
GcCycleState::step_sweep (cyclomatic 18) crates/perry-runtime/src/gc/cycle.rs:1531— GcCycleState::step_sweep 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.
perry_wasm_host::instantiate_with_import_callbacks (cyclomatic 22) crates/perry-wasm-host/src/lib.rs:374— perry_wasm_host::instantiate_with_import_callbacks 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.
perry_wasm_host::externals::perry_wasm_host_func_call (cyclomatic 18) crates/perry-wasm-host/src/externals.rs:293— perry_wasm_host::externals::perry_wasm_host_func_call has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
perry_wasm_host::tables::perry_wasm_host_instance_table_get (cyclomatic 18) crates/perry-wasm-host/src/tables.rs:37— perry_wasm_host::tables::perry_wasm_host_instance_table_get 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.
LlFunction::proof_dominates_block_end (cyclomatic 21) crates/perry-codegen/src/function/proof_dominance.rs:13— LlFunction::proof_dominates_block_end 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.
LlFunction::define_header_with_size_attrs (cyclomatic 19) crates/perry-codegen/src/function.rs:1058— LlFunction::define_header_with_size_attrs 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.
LlFunction::for_each_final_item (cyclomatic 17) crates/perry-codegen/src/function.rs:1292— LlFunction::for_each_final_item 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.
perry_ui_watchos::audio_playback::perry_audio_load_sound (cyclomatic 20) crates/perry-ui-watchos/src/audio_playback.rs:257— perry_ui_watchos::audio_playback::perry_audio_load_sound 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.
perry_ui_watchos::audio_playback::perry_audio_play (cyclomatic 18) crates/perry-ui-watchos/src/audio_playback.rs:418— perry_ui_watchos::audio_playback::perry_audio_play 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.
perry_ui_watchos::state::state_set (cyclomatic 17) crates/perry-ui-watchos/src/state.rs:174— perry_ui_watchos::state::state_set 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.
perry_ext_ws::js_ws_process_pending (cognitive 136) crates/perry-ext-ws/src/lib.rs:1548— perry_ext_ws::js_ws_process_pending has cognitive complexity 136 (threshold 15). Drivers by points: if/else 26 (89 pts), loops 13 (45 pts), match/switch 1 (2 pts) (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_ws::scan_ws_roots (cognitive 24) crates/perry-ext-ws/src/lib.rs:431— perry_ext_ws::scan_ws_roots has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 5 (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.
perry_ext_ws::js_ws_on (cognitive 17) crates/perry-ext-ws/src/lib.rs:1273— perry_ext_ws::js_ws_on has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_runtime_manifest::realm_source::declarations (cognitive 122) crates/perry-runtime-manifest/src/realm_source.rs:150— perry_runtime_manifest::realm_source::declarations has cognitive complexity 122 (threshold 15). Drivers by points: if/else 28 (91 pts), loops 6 (22 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 80). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
perry_runtime_manifest::realm_json::parse (cognitive 72) crates/perry-runtime-manifest/src/realm_json.rs:90— perry_runtime_manifest::realm_json::parse has cognitive complexity 72 (threshold 15). Drivers by points: if/else 23 (55 pts), loops 5 (10 pts), match/switch 3 (6 pts), boolean chains 1 (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.
perry_runtime_manifest::realm_source::tokens (cognitive 65) crates/perry-runtime-manifest/src/realm_source.rs:18— perry_runtime_manifest::realm_source::tokens has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (46 pts), loops 5 (12 pts), boolean chains 7 (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.
LlModule::layout_codegen_units (cognitive 100) crates/perry-codegen/src/module.rs:1269— LlModule::layout_codegen_units has cognitive complexity 100 (threshold 15). Drivers by points: if/else 25 (60 pts), loops 20 (32 pts), boolean chains 8 (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.
LlModule::prune_private_capabilities (cognitive 19) crates/perry-codegen/src/module.rs:614— LlModule::prune_private_capabilities has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlModule::push_referenced_metadata_ids (cognitive 18) crates/perry-codegen/src/module.rs:1122— LlModule::push_referenced_metadata_ids has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_codegen_js::minify::minify_js (cognitive 86) crates/perry-codegen-js/src/minify.rs:10— perry_codegen_js::minify::minify_js has cognitive complexity 86 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 8 (24 pts), boolean chains 14, match/switch 1 (2 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.
perry_codegen_js::compile_modules_to_html_with_metadata (cognitive 31) crates/perry-codegen-js/src/lib.rs:82— perry_codegen_js::compile_modules_to_html_with_metadata has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (8 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.
perry_codegen_js::minify::copy_template_literal (cognitive 30) crates/perry-codegen-js/src/minify.rs:149— perry_codegen_js::minify::copy_template_literal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (9 pts), boolean chains 4, match/switch 1 (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.
perry_parser::normalize_unicode_identifier_escapes_with_metadata (cognitive 81) crates/perry-parser/src/lib.rs:442— perry_parser::normalize_unicode_identifier_escapes_with_metadata has cognitive complexity 81 (threshold 15). Drivers by points: if/else 28 (58 pts), boolean chains 10, loops 4 (9 pts), match/switch 3 (4 pts) (nesting depth added 36). Of this number, 65 points are the body's own statements and 16 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.
perry_parser::strip_comments_and_strings (cognitive 49) crates/perry-parser/src/lib.rs:237— perry_parser::strip_comments_and_strings has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
perry_parser::normalize_swc_class_syntax_with_metadata (cognitive 28) crates/perry-parser/src/lib.rs:786— perry_parser::normalize_swc_class_syntax_with_metadata has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, loops 5 (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.
Scanner::summary (cognitive 70) crates/perry/src/commands/compile/collect_modules/reexport_prune/scan.rs:42— Scanner::summary has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (45 pts), match/switch 3 (12 pts), loops 3 (11 pts), boolean chains 2 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Scanner::visit_call_expr (cognitive 19) crates/perry-hir/src/patched_builtins.rs:416— Scanner::visit_call_expr has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 5 (6 pts), loops 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::can_drop_tree (cognitive 18) crates/perry/src/commands/compile/collect_modules/reexport_prune/scan.rs:228— Scanner::can_drop_tree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 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.
Cfg::pinned (cognitive 61) crates/perry-gc-effects/src/instructions.rs:400— Cfg::pinned has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (51 pts), boolean chains 5, 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.
Cfg::slot_pinned (cognitive 42) crates/perry-gc-effects/src/instructions.rs:478— Cfg::slot_pinned has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 3 (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.
Cfg::new (cognitive 18) crates/perry-gc-effects/src/instructions.rs:339— Cfg::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4, 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.
ArrayWalk::walk_stmt (cognitive 59) crates/perry-codegen/src/collectors/ptr_shape_elements.rs:781— ArrayWalk::walk_stmt has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (53 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArrayWalk::walk_expr (cognitive 58) crates/perry-codegen/src/collectors/ptr_shape_elements.rs:967— ArrayWalk::walk_expr has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (50 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 34). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ArrayWalk::walk_terminal_array_iteration_guard (cognitive 16) crates/perry-codegen/src/collectors/ptr_shape_elements.rs:698— ArrayWalk::walk_terminal_array_iteration_guard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), boolean chains 2, 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.
SolidJsx::native_parts (cognitive 55) crates/perry-hir/src/solid_jsx/native.rs:57— SolidJsx::native_parts has cognitive complexity 55 (threshold 15). Drivers by points: if/else 26 (47 pts), match/switch 3 (5 pts), loops 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.
SolidJsx::element (cognitive 27) crates/perry-hir/src/solid_jsx.rs:522— SolidJsx::element has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 2 (5 pts), boolean chains 3, 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.
SolidJsx::child (cognitive 16) crates/perry-hir/src/solid_jsx.rs:484— SolidJsx::child has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Session::finish (cognitive 44) crates/perry/src/commands/compile/reach_report.rs:139— Session::finish has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 6 (7 pts), boolean chains 5 (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.
Session::finish (cognitive 39) crates/perry/src/commands/compile/source_need.rs:181— Session::finish has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 8 (15 pts), match/switch 3 (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.
Session::finish (cognitive 18) crates/perry-codegen/src/typed_feedback_profile.rs:141— Session::finish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (6 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.
LlFunction::proof_dominates_block_end (cognitive 43) crates/perry-codegen/src/function/proof_dominance.rs:13— LlFunction::proof_dominates_block_end has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 5 (13 pts), boolean chains 3, match/switch 1 (3 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.
LlFunction::for_each_final_item (cognitive 43) crates/perry-codegen/src/function.rs:1292— LlFunction::for_each_final_item has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 5 (13 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.
LlFunction::define_header_with_size_attrs (cognitive 25) crates/perry-codegen/src/function.rs:1058— LlFunction::define_header_with_size_attrs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 6, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Emitter::lower_inner (cognitive 39) crates/perry-wit/src/guest_c/values.rs:320— Emitter::lower_inner has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 6 (12 pts), match/switch 4 (6 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.
Emitter::lift (cognitive 24) crates/perry-wit/src/guest_c/values.rs:147— Emitter::lift has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 7 (9 pts), match/switch 3 (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.
Emitter::discard_owned (cognitive 16) crates/perry-wit/src/guest_c/values/discard.rs:32— Emitter::discard_owned has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 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.
ValidPointerSetBuilder::walk_census_block (cognitive 37) crates/perry-runtime/src/gc/trace.rs:1105— ValidPointerSetBuilder::walk_census_block has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValidPointerSetBuilder::step (cognitive 32) crates/perry-runtime/src/gc/trace.rs:921— ValidPointerSetBuilder::step has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 1 (2 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.
ValidPointerSetBuilder::step_arena_walk (cognitive 17) crates/perry-runtime/src/gc/trace.rs:993— ValidPointerSetBuilder::step_arena_walk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 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.
perry_ext_cheerio::js_cheerio_selection_children (cognitive 36) crates/perry-ext-cheerio/src/lib.rs:210— perry_ext_cheerio::js_cheerio_selection_children has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (29 pts), loops 2 (7 pts) (nesting depth added 28). 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.
perry_ext_cheerio::js_cheerio_selection_has_class (cognitive 16) crates/perry-ext-cheerio/src/lib.rs:268— perry_ext_cheerio::js_cheerio_selection_has_class has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 10). 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.
perry_ext_cheerio::js_cheerio_selection_is (cognitive 16) crates/perry-ext-cheerio/src/lib.rs:294— perry_ext_cheerio::js_cheerio_selection_is has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 1 (4 pts), match/switch 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.
Graph::components (cognitive 32) crates/perry-codegen/src/layout_desc/array_families.rs:372— Graph::components has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Graph::new (cognitive 25) crates/perry-gc-effects/src/graph.rs:92— Graph::new has cognitive complexity 25 (threshold 15). Drivers by points: loops 9 (13 pts), if/else 4 (12 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.
Graph::propagate (cognitive 23) crates/perry-codegen/src/layout_desc/array_families.rs:427— Graph::propagate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 6 (11 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.
perry_audio_miniaudio::reapply_solo_state (cognitive 30) crates/perry-audio-miniaudio/src/lib.rs:1036— perry_audio_miniaudio::reapply_solo_state has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (10 pts), loops 3 (6 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.
perry_audio_miniaudio::perry_audio_play (cognitive 22) crates/perry-audio-miniaudio/src/lib.rs:518— perry_audio_miniaudio::perry_audio_play has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 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, 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.
perry_audio_miniaudio::drain_pending_callbacks (cognitive 16) crates/perry-audio-miniaudio/src/lib.rs:353— perry_audio_miniaudio::drain_pending_callbacks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 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.
Parents::new (cognitive 26) crates/perry-codegen/src/layout_families/parents.rs:164— Parents::new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (8 pts), match/switch 1 (4 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.
Parents::exported_inner (cognitive 26) crates/perry-codegen/src/layout_families/parents.rs:256— Parents::exported_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (6 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.
Parents::parent (cognitive 17) crates/perry-codegen/src/layout_families/parents.rs:359— Parents::parent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 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.
CopyingNurseryCollector::move_young (cognitive 23) crates/perry-runtime/src/gc/copying.rs:487— CopyingNurseryCollector::move_young has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, 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.
CopyingNurseryCollector::finish_ephemerons (cognitive 22) crates/perry-runtime/src/gc/ephemeron.rs:251— CopyingNurseryCollector::finish_ephemerons has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 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.
CopyingNurseryCollector::drain (cognitive 16) crates/perry-runtime/src/gc/copying.rs:655— CopyingNurseryCollector::drain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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.
Duplicated block (40 lines × 2) crates/perry-codegen/src/collectors/param_ranges.rs:152— crates/perry-codegen/src/collectors/param_ranges.rs:152-191 | crates/perry-codegen/src/layout_families.rs:334-373 — before extracting anything, compare `crates/perry-codegen/src/collectors/param_ranges.rs` and `crates/perry-codegen/src/layout_families.rs` as WHOLE FILES: this scan already matched 3 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 (40 lines × 2) crates/perry-codegen/src/collectors/sealed_buffers.rs:189— crates/perry-codegen/src/collectors/sealed_buffers.rs:189-228 | crates/perry-hir/src/lexical_frames.rs:349-388 — 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 (40 lines × 2) crates/perry-ext-http/src/server/turnloop_serve/wire.rs:149— crates/perry-ext-http/src/server/turnloop_serve/wire.rs:149-188 | crates/perry-http-server/src/wire.rs:155-194 — before extracting anything, compare `crates/perry-ext-http/src/server/turnloop_serve/wire.rs` and `crates/perry-http-server/src/wire.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–23 lines × 2) crates/perry-codegen/src/expr/this_super_call.rs:484— crates/perry-codegen/src/expr/this_super_call.rs:484-506 | crates/perry-codegen/src/expr/this_super_call.rs:517-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–23 lines × 2) crates/perry-hir/src/lower/expr_call/globals.rs:744— crates/perry-hir/src/lower/expr_call/globals.rs:744-762 | crates/perry-hir/src/lower/expr_call/module_static.rs:317-339 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–23 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBackgroundWorker.kt:26— android-build/app/src/main/java/com/perry/app/PerryBackgroundWorker.kt:26-44 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBackgroundWorker.kt:26-48 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBackgroundWorker.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBackgroundWorker.kt` 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. 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–19 lines × 2) crates/perry-codegen/src/codegen/function.rs:1263— crates/perry-codegen/src/codegen/function.rs:1263-1281 | crates/perry-codegen/src/codegen/method_static.rs:229-245 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 268 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–19 lines × 2) crates/perry-codegen/src/stmt/loops.rs:7668— crates/perry-codegen/src/stmt/loops.rs:7668-7686 | crates/perry-codegen/src/stmt/loops.rs:9931-9947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–19 lines × 2) scripts/copied_minor_fallback_report.py:805— scripts/copied_minor_fallback_report.py:805-823 | scripts/copied_minor_fallback_report.py:869-885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) crates/perry-api-manifest/src/entries.rs:540— crates/perry-api-manifest/src/entries.rs:540-553 | crates/perry-codegen/src/lower_call/native_table/node_core.rs:45-60 — 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–16 lines × 2) crates/perry-codegen-arkts/src/widgets/inputs.rs:175— crates/perry-codegen-arkts/src/widgets/inputs.rs:175-190 | crates/perry-codegen-arkts/src/widgets/inputs.rs:201-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.
Duplicated block (14–16 lines × 2) scripts/sso_unbox_inventory.py:607— scripts/sso_unbox_inventory.py:607-620 | scripts/string_payload_access_inventory.py:448-463 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `scripts/string_payload_access_inventory.py:448` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–16 lines × 2) crates/perry-codegen/src/codegen/string_pool.rs:1474— crates/perry-codegen/src/codegen/string_pool.rs:1474-1486 | crates/perry-codegen/src/codegen/string_pool.rs:1554-1569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–16 lines × 2) crates/perry-codegen/src/module.rs:329— crates/perry-codegen/src/module.rs:329-344 | crates/perry-codegen/src/module.rs:386-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–16 lines × 2) crates/perry-container-compose/src/compose.rs:156— crates/perry-container-compose/src/compose.rs:156-171 | crates/perry-container-compose/src/compose.rs:178-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.
Duplicated block (13–15 lines × 3) crates/perry-codegen/src/collectors/byte_read_key.rs:105— crates/perry-codegen/src/collectors/byte_read_key.rs:105-117 | crates/perry-codegen/src/collectors/loop_bounded_i32.rs:441-455 | crates/perry-codegen/src/expr/closure.rs:52-64 — 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–15 lines × 3) crates/perry-codegen/src/collectors/hot_callees.rs:401— crates/perry-codegen/src/collectors/hot_callees.rs:401-415 | crates/perry-codegen/src/collectors/loop_bounded_i32.rs:899-913 | crates/perry-hir/src/analysis/fn_infer.rs:798-810 — before extracting anything, compare `crates/perry-codegen/src/collectors/hot_callees.rs` and `crates/perry-codegen/src/collectors/loop_bounded_i32.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–15 lines × 3) crates/perry-hir/src/lower/expr_object.rs:363— crates/perry-hir/src/lower/expr_object.rs:363-375 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:210-222 | crates/perry-hir/src/lower_decl/fn_decl.rs:320-334 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) crates/perry-codegen/src/collectors/typed_locals.rs:761— crates/perry-codegen/src/collectors/typed_locals.rs:761-774 | crates/perry-codegen/src/collectors/typed_locals.rs:788-801 | crates/perry-codegen/src/collectors/typed_locals.rs:820-833 | crates/perry-codegen/src/collectors/typed_locals.rs:859-872 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 4) crates/perry-hir/src/lower/lower_expr/reactive_text.rs:164— crates/perry-hir/src/lower/lower_expr/reactive_text.rs:164-177 | crates/perry-hir/src/lower/lower_expr/reactive_text.rs:205-218 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:242-255 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:283-296 — before extracting anything, compare `crates/perry-hir/src/lower/lower_expr/reactive_text.rs` and `crates/perry-hir/src/lower/widget_decl/reactive_animate.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) crates/perry-codegen/src/stmt/let_stmt.rs:1435— crates/perry-codegen/src/stmt/let_stmt.rs:1435-1448 | crates/perry-codegen/src/stmt/let_stmt.rs:1456-1469 | crates/perry-codegen/src/stmt/let_stmt.rs:1473-1486 | crates/perry-codegen/src/stmt/let_stmt.rs:1492-1505 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–13 lines × 2) crates/perry-codegen/src/expr/instance_misc1.rs:1005— crates/perry-codegen/src/expr/instance_misc1.rs:1005-1017 | crates/perry-codegen/src/expr/logical_collections.rs:1331-1340 — before extracting anything, compare `crates/perry-codegen/src/expr/instance_misc1.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–13 lines × 2) crates/perry-hir/src/lower/stmt.rs:1673— crates/perry-hir/src/lower/stmt.rs:1673-1682 | crates/perry-hir/src/lower_decl/body_stmt.rs:1202-1214 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–13 lines × 2) scripts/compiler_output_harness/repsel_knob_isolation.py:564— scripts/compiler_output_harness/repsel_knob_isolation.py:564-573 | scripts/compiler_output_harness/repsel_knob_isolation.py:575-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/compiler_output_harness/repsel_knob_isolation.py:564` 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, `scripts/compiler_output_harness/repsel_knob_isolation.py:574` calls `arm`, `_capture` and `scripts/compiler_output_harness/repsel_knob_isolation.py:564` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1263— crates/perry-codegen/src/codegen/closure.rs:1263-1274 | crates/perry-codegen/src/codegen/entry.rs:870-881 | crates/perry-codegen/src/codegen/entry/module_init.rs:350-361 | crates/perry-codegen/src/codegen/function.rs:1369-1380 | crates/perry-codegen/src/codegen/method.rs:654-665 | crates/perry-codegen/src/codegen/method_static.rs:329-340 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) crates/perry-codegen/src/collectors/integer_locals.rs:662— crates/perry-codegen/src/collectors/integer_locals.rs:662-673 | crates/perry-codegen/src/collectors/proven_args.rs:282-293 | crates/perry-codegen/src/collectors/ptr_numarray.rs:646-657 | crates/perry-codegen/src/collectors/ptr_shape.rs:1370-1381 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:878-889 | crates/perry-codegen/src/collectors/sealed_buffers.rs:530-541 — before extracting anything, compare `crates/perry-codegen/src/collectors/integer_locals.rs` and `crates/perry-codegen/src/collectors/ptr_numarray.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) crates/perry-hir/src/lower/expr_call/globals.rs:275— crates/perry-hir/src/lower/expr_call/globals.rs:275-286 | crates/perry-hir/src/lower/expr_call/globals.rs:378-389 | crates/perry-hir/src/lower/expr_call/globals.rs:415-426 | crates/perry-hir/src/lower/expr_call/globals.rs:433-444 | crates/perry-hir/src/lower/expr_call/globals.rs:455-466 | crates/perry-hir/src/lower/expr_call/globals.rs:480-491 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 4) crates/perry-hir/src/lower/expr_object.rs:332— crates/perry-hir/src/lower/expr_object.rs:332-342 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:173-183 | crates/perry-hir/src/lower_decl/class_members.rs:615-626 | crates/perry-hir/src/lower_decl/fn_decl.rs:290-300 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 4) crates/perry-codegen/src/lower_call/func_ref.rs:1065— crates/perry-codegen/src/lower_call/func_ref.rs:1065-1076 | crates/perry-codegen/src/lower_call/func_ref.rs:1078-1089 | crates/perry-codegen/src/lower_call/func_ref.rs:1091-1102 | crates/perry-codegen/src/lower_call/func_ref.rs:1103-1113 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 4) scripts/compiler_output_harness/verification.py:728— scripts/compiler_output_harness/verification.py:728-739 | scripts/compiler_output_harness/verification.py:754-764 | scripts/compiler_output_harness/verification.py:829-840 | scripts/compiler_output_harness/verification.py:1084-1095 — 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 `scripts/compiler_output_harness/verification.py:728` 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/perry-codegen-glance/src/emit.rs:54— crates/perry-codegen-glance/src/emit.rs:54-63 | crates/perry-codegen-wear-tiles/src/emit.rs:59-70 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 2) crates/perry-codegen/src/expr/ic_fast_split.rs:39— crates/perry-codegen/src/expr/ic_fast_split.rs:39-48 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:899-910 — 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/perry-codegen/src/expr/method_site.rs:131— crates/perry-codegen/src/expr/method_site.rs:131-140 | crates/perry-codegen/src/expr/method_site.rs:632-643 — both copies are in the same file, so extract the block into 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–11 lines × 2) crates/perry-codegen-arkts/src/widgets/inputs.rs:121— crates/perry-codegen-arkts/src/widgets/inputs.rs:121-126 | crates/perry-codegen-arkts/src/widgets/inputs.rs:281-291 — both copies are in the same file, so extract the block into 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–11 lines × 2) crates/perry-codegen/src/expr/this_super_call.rs:635— crates/perry-codegen/src/expr/this_super_call.rs:635-640 | crates/perry-codegen/src/lower_call/new.rs:1538-1548 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6–11 lines × 2) crates/perry-hir/src/lower_decl/block.rs:159— crates/perry-hir/src/lower_decl/block.rs:159-169 | crates/perry-hir/src/lower_decl/block.rs:329-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) crates/perry-codegen/src/expr/index_set_guarded.rs:306— crates/perry-codegen/src/expr/index_set_guarded.rs:306-316 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:196-204 — 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–11 lines × 2) crates/perry-codegen/src/expr/literals_vars.rs:132— crates/perry-codegen/src/expr/literals_vars.rs:132-142 | crates/perry-codegen/src/scope_env/access.rs:86-94 — 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–11 lines × 2) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:531— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:531-541 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:575-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 3) crates/perry-codegen/src/stmt/loops.rs:4038— crates/perry-codegen/src/stmt/loops.rs:4038-4046 | crates/perry-codegen/src/stmt/loops.rs:4084-4091 | crates/perry-codegen/src/stmt/loops.rs:4140-4149 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 3) crates/perry-ext-net/src/payload_tls.rs:215— crates/perry-ext-net/src/payload_tls.rs:215-224 | crates/perry-ext-net/src/payload_tls.rs:291-298 | crates/perry-ext-net/src/payload_tls.rs:329-336 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 3) crates/perry-hir/src/lower/expr_call/intrinsics/require.rs:39— crates/perry-hir/src/lower/expr_call/intrinsics/require.rs:39-48 | crates/perry-hir/src/lower/expr_call/intrinsics/require.rs:133-142 | crates/perry-hir/src/lower/expr_call/native_module.rs:81-88 — 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–10 lines × 2) crates/perry-codegen/src/collectors/escape_check.rs:599— crates/perry-codegen/src/collectors/escape_check.rs:599-605 | crates/perry-codegen/src/collectors/escape_objects.rs:591-600 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/escape_objects.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–10 lines × 2) crates/perry-codegen/src/stmt/versioned_indexed_loop.rs:273— crates/perry-codegen/src/stmt/versioned_indexed_loop.rs:273-282 | crates/perry-codegen/src/stmt/versioned_indexed_loop.rs:302-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–10 lines × 2) crates/perry-hir/src/js_transform/local_natives.rs:71— crates/perry-hir/src/js_transform/local_natives.rs:71-77 | crates/perry-hir/src/js_transform/local_natives.rs:93-102 — both copies are in the same file, so extract the block into 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 × 9) crates/perry-hir/src/lower/expr_function.rs:674— crates/perry-hir/src/lower/expr_function.rs:674-682 | crates/perry-hir/src/lower/expr_object.rs:273-281 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:115-123 | crates/perry-hir/src/lower_decl/class_members.rs:118-126 | crates/perry-hir/src/lower_decl/class_members.rs:545-553 | crates/perry-hir/src/lower_decl/class_members.rs:953-961 | crates/perry-hir/src/lower_decl/fn_decl.rs:135-143 | crates/perry-hir/src/lower_decl/private_members.rs:132-140 | crates/perry-hir/src/lower_decl/private_members.rs:346-354 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower/expr_object.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 9) crates/perry-hir/src/lower/expr_new/member.rs:152— crates/perry-hir/src/lower/expr_new/member.rs:152-160 | crates/perry-hir/src/lower/expr_new/member.rs:191-199 | crates/perry-hir/src/lower/expr_new/member.rs:293-301 | crates/perry-hir/src/lower/expr_new/member.rs:319-327 | crates/perry-hir/src/lower/expr_new/member.rs:352-360 | crates/perry-hir/src/lower/expr_new/member.rs:371-379 | crates/perry-hir/src/lower/expr_new/member.rs:394-402 | crates/perry-hir/src/lower/expr_new/member.rs:420-428 | crates/perry-hir/src/lower/expr_new/member.rs:520-528 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 9) crates/perry-ext-net/src/payload_abi.rs:560— crates/perry-ext-net/src/payload_abi.rs:560-568 | crates/perry-ext-net/src/payload_abi.rs:650-658 | crates/perry-ext-net/src/payload_abi.rs:666-674 | crates/perry-ext-net/src/payload_abi.rs:682-690 | crates/perry-ext-net/src/payload_abi.rs:797-805 | crates/perry-ext-net/src/payload_abi.rs:843-851 | crates/perry-ext-net/src/payload_abi.rs:859-867 | crates/perry-ext-net/src/payload_abi.rs:1006-1014 | crates/perry-ext-net/src/payload_abi.rs:1104-1112 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 7) crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:25— crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:25-33 | crates/perry-codegen/src/expr/strings.rs:27-35 | crates/perry-codegen/src/expr/typed_feedback.rs:209-217 | crates/perry-codegen/src/expr/v8_interop.rs:78-86 | crates/perry-codegen/src/expr/v8_interop.rs:172-180 | crates/perry-codegen/src/module.rs:952-960 | crates/perry-codegen/src/strings.rs:335-343 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 7) crates/perry-codegen/src/expr/bigint_set.rs:86— crates/perry-codegen/src/expr/bigint_set.rs:86-94 | crates/perry-codegen/src/expr/bigint_set.rs:198-206 | crates/perry-codegen/src/expr/bigint_set.rs:265-273 | crates/perry-codegen/src/expr/logical_collections.rs:488-496 | crates/perry-codegen/src/expr/math_simple.rs:209-217 | crates/perry-codegen/src/expr/math_simple.rs:304-312 | crates/perry-codegen/src/expr/math_simple.rs:373-381 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:120— crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:120-128 | crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:199-207 | crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:231-239 | crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:338-346 | crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:354-362 | crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:368-376 | crates/perry-hir/src/lower/expr_call/native_module/object_statics.rs:382-390 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 6) crates/perry-codegen/src/collectors/escape_arrays.rs:161— crates/perry-codegen/src/collectors/escape_arrays.rs:161-169 | crates/perry-codegen/src/collectors/escape_arrays.rs:308-316 | crates/perry-codegen/src/collectors/hot_callees.rs:426-434 | crates/perry-codegen/src/collectors/hot_callees.rs:699-707 | crates/perry-codegen/src/collectors/not_bigint_locals.rs:384-392 | crates/perry-codegen/src/layout_families.rs:392-400 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 6) crates/perry-ext-http/src/server/http2_server/pump.rs:70— crates/perry-ext-http/src/server/http2_server/pump.rs:70-78 | crates/perry-ext-http/src/server/http2_server/pump.rs:94-103 | crates/perry-ext-http/src/server/https_server.rs:464-473 | crates/perry-ext-http/src/server/https_server.rs:492-500 | crates/perry-ext-http/src/server/server.rs:1308-1317 | crates/perry-ext-http/src/server/server.rs:1354-1362 — before extracting anything, compare `crates/perry-ext-http/src/server/http2_server/pump.rs` and `crates/perry-ext-http/src/server/https_server.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 6) crates/perry-hir/src/js_transform/local_natives.rs:945— crates/perry-hir/src/js_transform/local_natives.rs:945-953 | crates/perry-hir/src/js_transform/local_natives.rs:976-984 | crates/perry-hir/src/js_transform/local_natives.rs:1001-1009 | crates/perry-hir/src/js_transform/local_natives.rs:1047-1055 | crates/perry-hir/src/js_transform/local_natives.rs:1095-1103 | crates/perry-hir/src/js_transform/local_natives.rs:1120-1128 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 5) crates/perry-codegen/src/codegen/entry.rs:892— crates/perry-codegen/src/codegen/entry.rs:892-900 | crates/perry-codegen/src/codegen/entry/module_init.rs:372-380 | crates/perry-codegen/src/codegen/function.rs:1391-1399 | crates/perry-codegen/src/codegen/method.rs:676-684 | crates/perry-codegen/src/codegen/method_static.rs:351-359 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 5) crates/perry-codegen/src/expr/array_methods.rs:135— crates/perry-codegen/src/expr/array_methods.rs:135-150 | crates/perry-codegen/src/expr/instance_misc1.rs:1002-1013 | crates/perry-codegen/src/expr/instance_misc1.rs:1321-1329 | crates/perry-codegen/src/expr/url_main.rs:501-525 | crates/perry-codegen/src/expr/url_main.rs:595-606 — before extracting anything, compare `crates/perry-codegen/src/expr/array_methods.rs` and `crates/perry-codegen/src/expr/instance_misc1.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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 × 5) crates/perry-hir/src/lower/expr_object.rs:1346— crates/perry-hir/src/lower/expr_object.rs:1346-1354 | crates/perry-hir/src/lower/expr_object.rs:1369-1377 | crates/perry-hir/src/lower/expr_object.rs:1397-1405 | crates/perry-hir/src/lower/expr_object.rs:1609-1617 | crates/perry-hir/src/lower/expr_object.rs:1632-1640 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 3) crates/perry-codegen/src/expr/class_env.rs:163— crates/perry-codegen/src/expr/class_env.rs:163-171 | crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs:59-65 | crates/perry-codegen/src/lower_string_method.rs:435-442 — before extracting anything, compare `crates/perry-codegen/src/expr/class_env.rs` and `crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–9 lines × 3) crates/perry-codegen/src/expr/method_site.rs:132— crates/perry-codegen/src/expr/method_site.rs:132-138 | crates/perry-codegen/src/expr/method_site.rs:634-641 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1891-1899 — 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–9 lines × 3) crates/perry-codegen/src/lower_call/property_get/number_string.rs:32— crates/perry-codegen/src/lower_call/property_get/number_string.rs:32-38 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:44-52 | crates/perry-codegen/src/lower_call/property_get/number_string.rs:60-68 — 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 × 5) crates/perry-codegen/src/codegen/function.rs:197— crates/perry-codegen/src/codegen/function.rs:197-204 | crates/perry-codegen/src/codegen/method_typed.rs:33-40 | crates/perry-codegen/src/codegen/method_typed.rs:120-127 | crates/perry-codegen/src/codegen/method_typed.rs:166-173 | crates/perry-codegen/src/codegen/method_typed.rs:212-219 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_typed.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) crates/perry-codegen/src/lower_call/options/fetch.rs:815— crates/perry-codegen/src/lower_call/options/fetch.rs:815-822 | crates/perry-codegen/src/lower_call/options/fetch.rs:1053-1060 | crates/perry-codegen/src/lower_call/options/fetch.rs:1093-1100 | crates/perry-codegen/src/lower_call/options/fetch.rs:1127-1134 | crates/perry-codegen/src/lower_call/options/fetch.rs:1146-1153 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) scripts/component_async_acceptance.py:15— scripts/component_async_acceptance.py:15-22 | scripts/component_http_acceptance.py:25-32 | scripts/component_persistent_acceptance.py:15-22 | scripts/component_producer_acceptance.py:15-22 | scripts/component_reader_acceptance.py:15-22 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) crates/perry-codegen/src/codegen/method.rs:1095— crates/perry-codegen/src/codegen/method.rs:1095-1100 | crates/perry-codegen/src/codegen/method.rs:1190-1196 | crates/perry-codegen/src/codegen/method.rs:1284-1289 — 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/perry-codegen/src/expr/call_spread_short.rs:421— crates/perry-codegen/src/expr/call_spread_short.rs:421-427 | crates/perry-codegen/src/expr/method_site.rs:135-140 | crates/perry-codegen/src/expr/method_site.rs:637-643 — 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–7 lines × 3) crates/perry-codegen/src/expr/this_super_call.rs:813— crates/perry-codegen/src/expr/this_super_call.rs:813-819 | crates/perry-codegen/src/lower_call/method_override.rs:694-699 | crates/perry-codegen/src/lower_call/new_helpers.rs:259-264 — 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 × 10) crates/perry-codegen/src/lower_call/early_branches.rs:558— crates/perry-codegen/src/lower_call/early_branches.rs:558-563 | crates/perry-codegen/src/lower_call/early_branches.rs:1197-1202 | crates/perry-codegen/src/lower_call/func_ref.rs:236-241 | crates/perry-codegen/src/lower_call/func_ref.rs:1153-1158 | crates/perry-codegen/src/lower_call/func_ref.rs:1160-1165 | crates/perry-codegen/src/lower_call/func_ref.rs:1228-1233 | crates/perry-codegen/src/lower_call/func_ref.rs:1235-1240 | crates/perry-codegen/src/lower_call/func_ref.rs:1313-1318 | crates/perry-codegen/src/lower_call/func_ref.rs:1397-1402 | crates/perry-codegen/src/lower_call/func_ref.rs:1404-1409 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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 (6 lines × 10) crates/perry-codegen/src/lower_call/early_branches.rs:767— crates/perry-codegen/src/lower_call/early_branches.rs:767-772 | crates/perry-codegen/src/lower_call/early_branches.rs:867-872 | crates/perry-codegen/src/lower_call/early_branches.rs:969-974 | crates/perry-codegen/src/lower_call/func_ref.rs:1120-1125 | crates/perry-codegen/src/lower_call/func_ref.rs:1194-1199 | crates/perry-codegen/src/lower_call/func_ref.rs:1270-1275 | crates/perry-codegen/src/lower_call/method_override.rs:1328-1333 | crates/perry-codegen/src/lower_call/method_override.rs:1412-1417 | crates/perry-codegen/src/lower_call/method_override.rs:1498-1503 | crates/perry-codegen/src/lower_call/method_override.rs:1585-1590 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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 (6 lines × 10) crates/perry-codegen/src/expr/bigint_set.rs:86— crates/perry-codegen/src/expr/bigint_set.rs:86-92 | crates/perry-codegen/src/expr/bigint_set.rs:198-204 | crates/perry-codegen/src/expr/bigint_set.rs:265-271 | crates/perry-codegen/src/expr/dispatch.rs:790-795 | crates/perry-codegen/src/expr/instance_misc1.rs:286-293 | crates/perry-codegen/src/expr/logical_collections.rs:488-494 | crates/perry-codegen/src/expr/math_simple.rs:209-215 | crates/perry-codegen/src/expr/math_simple.rs:304-310 | crates/perry-codegen/src/expr/math_simple.rs:373-379 | crates/perry-codegen/src/native_value/materialize.rs:489-495 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/instance_misc1.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–6 lines × 3) crates/perry-codegen/src/codegen/split_regions_facts.rs:550— crates/perry-codegen/src/codegen/split_regions_facts.rs:550-552 | crates/perry-codegen/src/collectors/definite_init.rs:562-567 | crates/perry-codegen/src/collectors/segview.rs:1410-1415 — 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 (3–6 lines × 3) crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:200— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:200-202 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:688-693 | crates/perry-codegen/src/expr/property_get.rs:541-546 — 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 (3–6 lines × 3) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:290— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:290-292 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:640-645 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:821-826 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 3) crates/perry-codegen/src/expr/compare.rs:1000— crates/perry-codegen/src/expr/compare.rs:1000-1004 | crates/perry-codegen/src/expr/compare.rs:1018-1022 | crates/perry-codegen/src/expr/compare.rs:1036-1038 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 3) crates/perry-hir/src/lower_decl/class_field_assign.rs:173— crates/perry-hir/src/lower_decl/class_field_assign.rs:173-175 | crates/perry-hir/src/lower_decl/class_validation.rs:56-60 | crates/perry-hir/src/lower_types/extract.rs:654-658 — 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 (3–5 lines × 3) scripts/component_command_acceptance.py:81— scripts/component_command_acceptance.py:81-83 | scripts/component_guest_acceptance.py:98-102 | scripts/component_host_acceptance.py:71-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/component_guest_acceptance.py:102` calls `round`, `monotonic`, `str` and `scripts/component_command_acceptance.py:83` 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 (14 lines × 2 locations) crates/perry-codegen-wasm/src/wasm_runtime.js:658— crates/perry-codegen-wasm/src/wasm_runtime.js:658 · crates/perry-codegen-wasm/src/wasm_runtime.js:1916 — 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 (14 lines × 2 locations) crates/perry-codegen-wasm/src/wasm_runtime.js:681— crates/perry-codegen-wasm/src/wasm_runtime.js:681 · crates/perry-codegen-wasm/src/wasm_runtime.js:1935 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) crates/perry-codegen-wasm/src/wasm_runtime.js:779— crates/perry-codegen-wasm/src/wasm_runtime.js:779 · crates/perry-codegen-wasm/src/wasm_runtime.js:2005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
perry_ui_geisterhand::server::run_server (cyclomatic 85) crates/perry-ui-geisterhand/src/server.rs:219— perry_ui_geisterhand::server::run_server has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ui_geisterhand::chaos::start (cyclomatic 17) crates/perry-ui-geisterhand/src/chaos.rs:27— perry_ui_geisterhand::chaos::start 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.
ArrayFactCollector::collect_expr (cyclomatic 60) crates/perry-codegen/src/collectors/hir_facts.rs:1534— ArrayFactCollector::collect_expr has cyclomatic complexity 60 (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.
ArrayFactCollector::collect_stmt (cyclomatic 19) crates/perry-codegen/src/collectors/hir_facts.rs:1444— ArrayFactCollector::collect_stmt 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.
ComposeEngine::up (cyclomatic 56) crates/perry-container-compose/src/compose.rs:228— ComposeEngine::up 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.
ComposeEngine::down (cyclomatic 18) crates/perry-container-compose/src/compose.rs:776— ComposeEngine::down 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.
Planner::expr (cyclomatic 50) crates/perry-codegen/src/stmt/region_loop/plan.rs:334— Planner::expr 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.
Planner::stmt (cyclomatic 18) crates/perry-codegen/src/stmt/region_loop/plan.rs:600— Planner::stmt 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.
perry_diagnostics::compat_report::redact_snippet (cyclomatic 45) crates/perry-diagnostics/src/compat_report.rs:326— perry_diagnostics::compat_report::redact_snippet 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.
perry_diagnostics::compat_report::verify_redaction_invariants (cyclomatic 18) crates/perry-diagnostics/src/compat_report.rs:505— perry_diagnostics::compat_report::verify_redaction_invariants 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.
perry_codegen_js::minify::minify_js (cyclomatic 43) crates/perry-codegen-js/src/minify.rs:10— perry_codegen_js::minify::minify_js 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.
perry_codegen_js::minify::copy_template_literal (cyclomatic 17) crates/perry-codegen-js/src/minify.rs:149— perry_codegen_js::minify::copy_template_literal 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.
ArrayWalk::walk_expr (cyclomatic 40) crates/perry-codegen/src/collectors/ptr_shape_elements.rs:967— ArrayWalk::walk_expr 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.
ArrayWalk::walk_stmt (cyclomatic 35) crates/perry-codegen/src/collectors/ptr_shape_elements.rs:781— ArrayWalk::walk_stmt 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.
ThisFlowAnalysis::expr_this_safe (cyclomatic 40) crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:310— ThisFlowAnalysis::expr_this_safe 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.
ThisFlowAnalysis::stmt_this_safe (cyclomatic 18) crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:216— ThisFlowAnalysis::stmt_this_safe 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.
perry_wasi::filesystem::primitives::windows::fs::create_file_at_w::CreateFileAtW (cyclomatic 35) crates/perry-wasi/src/filesystem/primitives/windows/fs/create_file_at_w.rs:78— perry_wasi::filesystem::primitives::windows::fs::create_file_at_w::CreateFileAtW 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.
perry_wasi::http::server::wire::request (cyclomatic 20) crates/perry-wasi/src/http/server/wire.rs:104— perry_wasi::http::server::wire::request 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.
Flow::expression (cyclomatic 31) crates/perry-codegen/src/layout_desc/array_families.rs:64— Flow::expression 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.
Flow::statements (cyclomatic 21) crates/perry-codegen/src/layout_desc/array_families.rs:225— Flow::statements has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Scan::walk_expr (cyclomatic 30) crates/perry-codegen/src/collectors/sealed_buffers.rs:567— Scan::walk_expr 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.
Scan::walk_stmt (cyclomatic 22) crates/perry-codegen/src/collectors/sealed_buffers.rs:452— Scan::walk_stmt 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.
perry_codegen_swiftui::emit::emit_modifiers (cyclomatic 30) crates/perry-codegen-swiftui/src/emit.rs:1120— perry_codegen_swiftui::emit::emit_modifiers 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.
perry_codegen_swiftui::emit::emit_node (cyclomatic 22) crates/perry-codegen-swiftui/src/emit.rs:840— perry_codegen_swiftui::emit::emit_node 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.
perry_container_compose::capabilities::required_features (cyclomatic 29) crates/perry-container-compose/src/capabilities.rs:502— perry_container_compose::capabilities::required_features 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.
perry_container_compose::capabilities::unsupported_feature_names (cyclomatic 21) crates/perry-container-compose/src/capabilities.rs:441— perry_container_compose::capabilities::unsupported_feature_names 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. This is NOT this file's highest cyclomatic complexity: perry_container_compose::capabilities::feature_satisfies (cyclomatic 25) 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.
HirTypeEnv::from_module (cyclomatic 28) crates/perry-hir/src/analysis/value_types.rs:222— HirTypeEnv::from_module 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.
HirTypeEnv::collect_stmt_declarations (cyclomatic 19) crates/perry-hir/src/analysis/value_types.rs:438— HirTypeEnv::collect_stmt_declarations 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.
Session::finish (cyclomatic 27) crates/perry/src/commands/compile/reach_report.rs:139— Session::finish 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.
Session::finish (cyclomatic 22) crates/perry/src/commands/compile/source_need.rs:181— Session::finish 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.
Writer::pointer (cyclomatic 26) crates/perry-runtime/src/thread/clone_write.rs:460— Writer::pointer 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.
Writer::array (cyclomatic 20) crates/perry-runtime/src/thread/clone_write.rs:598— Writer::array 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.
Cfg::pinned (cyclomatic 25) crates/perry-gc-effects/src/instructions.rs:400— Cfg::pinned 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.
Cfg::slot_pinned (cyclomatic 17) crates/perry-gc-effects/src/instructions.rs:478— Cfg::slot_pinned 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.
perry_tls_session::session::step (cyclomatic 25) crates/perry-tls-session/src/session.rs:394— perry_tls_session::session::step 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.
perry_tls_session::step (cyclomatic 24) crates/perry-tls-session/src/lib.rs:268— perry_tls_session::step 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.
perry_ext_pdf::serde_json_lite::parse_value (cyclomatic 24) crates/perry-ext-pdf/src/lib.rs:542— perry_ext_pdf::serde_json_lite::parse_value 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.
perry_ext_pdf::serde_json_lite::parse_string (cyclomatic 18) crates/perry-ext-pdf/src/lib.rs:485— perry_ext_pdf::serde_json_lite::parse_string 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.
CensusScanner::visit_call_expr (cyclomatic 21) crates/perry-hir/src/proto_census.rs:610— CensusScanner::visit_call_expr has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CensusScanner::visit_class (cyclomatic 18) crates/perry-hir/src/proto_census.rs:546— CensusScanner::visit_class 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.
Plan::body (cyclomatic 20) crates/perry-codegen/src/stmt/indexed_owner_loop.rs:206— Plan::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.
Plan::expression (cyclomatic 19) crates/perry-codegen/src/stmt/indexed_owner_loop.rs:111— Plan::expression 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.
DockerProtocol::run_args (cyclomatic 20) crates/perry-container-compose/src/backend/docker.rs:88— DockerProtocol::run_args 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.
DockerProtocol::create_args (cyclomatic 17) crates/perry-container-compose/src/backend/docker.rs:156— DockerProtocol::create_args 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.
AppleContainerProtocol::run_args (cyclomatic 19) crates/perry-container-compose/src/backend/apple.rs:63— AppleContainerProtocol::run_args 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.
AppleContainerProtocol::create_args (cyclomatic 18) crates/perry-container-compose/src/backend/apple.rs:138— AppleContainerProtocol::create_args 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.
Encoder::step (cyclomatic 19) crates/perry-ext-zlib/src/stream/driver.rs:743— Encoder::step 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.
Encoder::step (cyclomatic 19) crates/perry-ext-zlib/src/stream/zlib_encoder.rs:141— Encoder::step 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.
Generator::generate (cyclomatic 19) crates/perry-wit/src/guest_c.rs:180— Generator::generate 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.
Generator::function (cyclomatic 19) crates/perry-wit/src/guest_c.rs:317— Generator::function 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.
ValidPointerSetBuilder::walk_census_block (cyclomatic 18) crates/perry-runtime/src/gc/trace.rs:1105— ValidPointerSetBuilder::walk_census_block 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.
ValidPointerSetBuilder::step (cyclomatic 17) crates/perry-runtime/src/gc/trace.rs:921— ValidPointerSetBuilder::step 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.
FixmeComment crates/perry-wasi/src/p2/filesystem.rs:283— // FIXME: configurable? determine from how much space left in file? — 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.
FixmeComment crates/perry-wasi/src/filesystem/primitives/tests/sys_common/symlink_junction.rs:109— // FIXME: this conversion is very hacky — 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.
perry_ui_geisterhand::server::run_server (cognitive 232) crates/perry-ui-geisterhand/src/server.rs:219— perry_ui_geisterhand::server::run_server has cognitive complexity 232 (threshold 15). Drivers by points: if/else 48 (152 pts), match/switch 25 (64 pts), loops 3 (11 pts), boolean chains 5 (nesting depth added 151). 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.
perry_ui_geisterhand::chaos::start (cognitive 26) crates/perry-ui-geisterhand/src/chaos.rs:27— perry_ui_geisterhand::chaos::start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 2 (5 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.
GuardState::matches (cognitive 150) crates/perry-runtime/src/param_type_guard.rs:509— GuardState::matches has cognitive complexity 150 (threshold 15). Drivers by points: if/else 50 (107 pts), boolean chains 27, loops 6 (12 pts), match/switch 2 (4 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuardState::own_data_field (cognitive 22) crates/perry-runtime/src/param_type_guard.rs:453— GuardState::own_data_field has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 1, 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.
ComposeEngine::up (cognitive 131) crates/perry-container-compose/src/compose.rs:228— ComposeEngine::up has cognitive complexity 131 (threshold 15). Drivers by points: if/else 34 (81 pts), match/switch 11 (26 pts), loops 7 (23 pts), boolean chains 1 (nesting depth added 78). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ComposeEngine::down (cognitive 38) crates/perry-container-compose/src/compose.rs:776— ComposeEngine::down has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (11 pts), match/switch 1 (2 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.
perry_diagnostics::compat_report::redact_snippet (cognitive 92) crates/perry-diagnostics/src/compat_report.rs:326— perry_diagnostics::compat_report::redact_snippet has cognitive complexity 92 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 8 (20 pts), boolean chains 18 (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.
perry_diagnostics::compat_report::verify_redaction_invariants (cognitive 44) crates/perry-diagnostics/src/compat_report.rs:505— perry_diagnostics::compat_report::verify_redaction_invariants has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Proof::expr (cognitive 90) crates/perry-hir/src/analysis/numeric_order.rs:315— Proof::expr has cognitive complexity 90 (threshold 15). Drivers by points: if/else 36 (66 pts), match/switch 9 (20 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 42). 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.
Proof::block (cognitive 25) crates/perry-hir/src/analysis/numeric_order.rs:254— Proof::block has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 2 (7 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.
ArrayFactCollector::collect_expr (cognitive 65) crates/perry-codegen/src/collectors/hir_facts.rs:1534— ArrayFactCollector::collect_expr has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 11 (22 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ArrayFactCollector::collect_stmt (cognitive 21) crates/perry-codegen/src/collectors/hir_facts.rs:1444— ArrayFactCollector::collect_stmt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_zlib::stream::create_stream (cognitive 54) crates/perry-ext-zlib/src/stream.rs:762— perry_ext_zlib::stream::create_stream has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38 (46 pts), match/switch 3 (5 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
perry_ext_zlib::stream::one_shot_callback::run (cognitive 32) crates/perry-ext-zlib/src/stream/one_shot_callback.rs:174— perry_ext_zlib::stream::one_shot_callback::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HirTypeEnv::from_module (cognitive 54) crates/perry-hir/src/analysis/value_types.rs:222— HirTypeEnv::from_module has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 14 (23 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.
HirTypeEnv::collect_stmt_declarations (cognitive 18) crates/perry-hir/src/analysis/value_types.rs:438— HirTypeEnv::collect_stmt_declarations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThisFlowAnalysis::expr_this_safe (cognitive 48) crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:310— ThisFlowAnalysis::expr_this_safe has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 6, match/switch 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.
ThisFlowAnalysis::ctor_chain_safe (cognitive 16) crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:139— ThisFlowAnalysis::ctor_chain_safe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 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.
CensusScanner::visit_class (cognitive 45) crates/perry-hir/src/proto_census.rs:546— CensusScanner::visit_class has cognitive complexity 45 (threshold 15). Drivers by points: if/else 7 (23 pts), match/switch 5 (18 pts), loops 2 (4 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.
CensusScanner::visit_call_expr (cognitive 17) crates/perry-hir/src/proto_census.rs:610— CensusScanner::visit_call_expr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 5 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_cli_support::dotenv::parse_record (cognitive 44) crates/perry-cli-support/src/dotenv.rs:66— perry_cli_support::dotenv::parse_record has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 11, loops 2 (4 pts), 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.
perry_cli_support::dotenv::records (cognitive 19) crates/perry-cli-support/src/dotenv.rs:28— perry_cli_support::dotenv::records 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.
perry_ext_pdf::serde_json_lite::parse_value (cognitive 44) crates/perry-ext-pdf/src/lib.rs:542— perry_ext_pdf::serde_json_lite::parse_value has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 5 (10 pts), boolean chains 1, 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.
perry_ext_pdf::serde_json_lite::parse_string (cognitive 16) crates/perry-ext-pdf/src/lib.rs:485— perry_ext_pdf::serde_json_lite::parse_string has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 2 (5 pts), if/else 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Plan::body (cognitive 43) crates/perry-codegen/src/stmt/indexed_owner_loop.rs:206— Plan::body has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (37 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Plan::expression (cognitive 21) crates/perry-codegen/src/stmt/indexed_owner_loop.rs:111— Plan::expression has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, 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.
Registry::dispatch (cognitive 41) crates/perry-db-turnloop/src/lib.rs:813— Registry::dispatch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 3 (5 pts), boolean chains 3 (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.
Registry::flush (cognitive 21) crates/perry-db-turnloop/src/lib.rs:467— Registry::flush has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (8 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.
WalkerImage::decode_row (cognitive 41) crates/perry-runtime/src/eh_walker.rs:916— WalkerImage::decode_row has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (12 pts), match/switch 1 (2 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.
WalkerImage::lsda_for (cognitive 18) crates/perry-runtime/src/eh_walker.rs:1249— WalkerImage::lsda_for has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3, 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.
Host::new_prepared (cognitive 38) crates/perry-component-host/src/lib.rs:191— Host::new_prepared has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 7 (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.
Host::handle_http_async_with_retirement (cognitive 16) crates/perry-component-host/src/http/p3.rs:49— Host::handle_http_async_with_retirement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 4 (5 pts), boolean chains 3 (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.
perry_perex::tooling::dialect::common_escape (cognitive 35) crates/perry-perex/src/tooling/dialect.rs:212— perry_perex::tooling::dialect::common_escape has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 5 (15 pts), loops 3 (9 pts), if/else 4 (8 pts), boolean chains 3 (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.
perry_perex::tooling::dialect::translate (cognitive 30) crates/perry-perex/src/tooling/dialect.rs:80— perry_perex::tooling::dialect::translate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_tls_session::step (cognitive 35) crates/perry-tls-session/src/lib.rs:268— perry_tls_session::step has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 5 (12 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.
perry_tls_session::session::step (cognitive 35) crates/perry-tls-session/src/session.rs:394— perry_tls_session::session::step has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 5 (12 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.
Flow::statements (cognitive 31) crates/perry-codegen/src/layout_desc/array_families.rs:225— Flow::statements has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (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.
Flow::expression (cognitive 22) crates/perry-codegen/src/layout_desc/array_families.rs:64— Flow::expression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 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.
Facts::expr (cognitive 30) crates/perry-codegen/src/codegen/opts/computed_names.rs:104— Facts::expr has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (27 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.
Facts::bindings_stmts (cognitive 21) crates/perry-codegen/src/codegen/opts/computed_names.rs:20— Facts::bindings_stmts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (5 pts), loops 2 (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.
WorkerPaths::resolve (cognitive 30) crates/perry-hir/src/dynamic_import/worker_paths.rs:133— WorkerPaths::resolve has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WorkerPaths::call (cognitive 16) crates/perry-hir/src/dynamic_import/worker_paths.rs:330— WorkerPaths::call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3, boolean chains 2, 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.
ArenaSweepObjectsState::apply_block_skip (cognitive 29) crates/perry-runtime/src/gc/oldgen/sweep_objects.rs:134— ArenaSweepObjectsState::apply_block_skip has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, 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.
ArenaSweepObjectsState::sweep_whole_block (cognitive 22) crates/perry-runtime/src/gc/oldgen/sweep_objects.rs:333— ArenaSweepObjectsState::sweep_whole_block has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, 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.
WorkloadGraphEngine::run (cognitive 27) crates/perry-container-compose/src/workload.rs:264— WorkloadGraphEngine::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (7 pts), match/switch 2 (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.
WorkloadGraphEngine::ps (cognitive 16) crates/perry-container-compose/src/workload.rs:525— WorkloadGraphEngine::ps has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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.
perry_ext_sharp::js_sharp_composite (cognitive 25) crates/perry-ext-sharp/src/lib.rs:626— perry_ext_sharp::js_sharp_composite has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (10 pts), loops 1 (4 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.
perry_ext_sharp::js_sharp_trim (cognitive 16) crates/perry-ext-sharp/src/lib.rs:584— perry_ext_sharp::js_sharp_trim has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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.
Encoder::step (cognitive 25) crates/perry-ext-zlib/src/stream/driver.rs:743— Encoder::step has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, 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.
Encoder::step (cognitive 21) crates/perry-ext-zlib/src/stream/zlib_encoder.rs:141— Encoder::step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 3 (4 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.
Connection::fill_from_socket (cognitive 25) crates/perry-http-client/src/transport.rs:327— Connection::fill_from_socket has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), match/switch 1 (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.
Connection::write_raw (cognitive 25) crates/perry-http-client/src/transport.rs:417— Connection::write_raw has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), match/switch 1 (4 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.
perry_component_io::embedding::option (cognitive 23) crates/perry-component-io/src/embedding.rs:554— perry_component_io::embedding::option has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (6 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.
perry_component_io::embedding::submit (cognitive 16) crates/perry-component-io/src/embedding.rs:207— perry_component_io::embedding::submit 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.
Api::inventory_with_clock (cognitive 23) crates/perry-runtime/src/tls/roots/macos.rs:349— Api::inventory_with_clock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 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.
Api::dictionary_trust (cognitive 17) crates/perry-runtime/src/tls/roots/macos.rs:254— Api::dictionary_trust has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 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.
Rewriter::stmts (cognitive 23) crates/perry-transform/src/crypto_hash_chain.rs:937— Rewriter::stmts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 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.
Rewriter::stmt (cognitive 20) crates/perry-transform/src/crypto_hash_chain.rs:828— Rewriter::stmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (perry_transform::crypto_hash_chain::for_each_stmt_expr, perry_transform::crypto_hash_chain::rewrite_refs_stmt) 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.
DockerProtocol::run_args (cognitive 22) crates/perry-container-compose/src/backend/docker.rs:88— DockerProtocol::run_args has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, loops 8 (11 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.
DockerProtocol::create_args (cognitive 18) crates/perry-container-compose/src/backend/docker.rs:156— DockerProtocol::create_args has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 7 (9 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CanonicalTable::free_nodes (cognitive 22) crates/perry-runtime/src/object/canonical_keys.rs:557— CanonicalTable::free_nodes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanonicalTable::retire_dead (cognitive 18) crates/perry-runtime/src/object/canonical_keys.rs:490— CanonicalTable::retire_dead has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), boolean chains 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.
ShapeSlab::for_each (cognitive 22) crates/perry-runtime/src/object/shapes_store/slab.rs:344— ShapeSlab::for_each has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (10 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.
ShapeSlab::release_empty_chunks (cognitive 21) crates/perry-runtime/src/object/shapes_store/slab.rs:378— ShapeSlab::release_empty_chunks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (9 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.
AppleContainerProtocol::run_args (cognitive 21) crates/perry-container-compose/src/backend/apple.rs:63— AppleContainerProtocol::run_args has cognitive complexity 21 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 10 (nesting depth added 3). 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.
AppleContainerProtocol::create_args (cognitive 20) crates/perry-container-compose/src/backend/apple.rs:138— AppleContainerProtocol::create_args has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 9 (nesting depth added 3). 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.
WebSocket::read_message (cognitive 21) crates/perry-http-client/src/ws/mod.rs:182— WebSocket::read_message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (8 pts), 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.
WebSocket::connect (cognitive 17) crates/perry-http-client/src/ws/mod.rs:41— WebSocket::connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (5 pts), loops 2 (3 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.
Rewrite::stmt (cognitive 20) crates/perry-codegen/src/scope_env/pass.rs:198— Rewrite::stmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rewrite::list (cognitive 16) crates/perry-codegen/src/scope_env/pass.rs:163— Rewrite::list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 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.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/perry-codegen/src/codegen/entry_outline.rs:748— crates/perry-codegen/src/codegen/entry_outline.rs:748-857 | crates/perry-codegen/src/codegen/fresh_class_templates.rs:70-119 | crates/perry-codegen/src/codegen/function_source_header.rs:217-247 | crates/perry-codegen/src/codegen/split_regions_facts.rs:359-380 | crates/perry-codegen/src/collectors/cjs_scaffolding.rs:192-226 | crates/perry-codegen/src/collectors/cjs_scaffolding.rs:425-458 | crates/perry-codegen/src/collectors/ptr_shape_returns.rs:393-426 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:394-505 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:510-669 | crates/perry-codegen/src/scope_env/mod.rs:223-265 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/perry-ext-net/src/payload_abi.rs:474— crates/perry-ext-net/src/payload_abi.rs:474-486 | crates/perry-ext-net/src/payload_abi.rs:496-508 | crates/perry-ext-net/src/payload_abi.rs:518-530 | crates/perry-ext-net/src/payload_abi.rs:540-552 | crates/perry-ext-net/src/payload_abi.rs:711-723 | crates/perry-ext-net/src/payload_abi.rs:733-745 | crates/perry-ext-net/src/payload_abi.rs:755-767 | crates/perry-ext-net/src/payload_abi.rs:777-789 | crates/perry-ext-net/src/payload_abi.rs:1059-1071 | crates/perry-ext-net/src/payload_abi.rs:1081-1093 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/perry-ext-net/src/payload_abi.rs:558— crates/perry-ext-net/src/payload_abi.rs:558-568 | crates/perry-ext-net/src/payload_abi.rs:648-658 | crates/perry-ext-net/src/payload_abi.rs:664-674 | crates/perry-ext-net/src/payload_abi.rs:680-690 | crates/perry-ext-net/src/payload_abi.rs:795-805 | crates/perry-ext-net/src/payload_abi.rs:841-851 | crates/perry-ext-net/src/payload_abi.rs:857-867 | crates/perry-ext-net/src/payload_abi.rs:1004-1014 | crates/perry-ext-net/src/payload_abi.rs:1102-1112 — 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/perry-hir/src/lower/expr_function.rs:594— crates/perry-hir/src/lower/expr_function.rs:594-1442 | crates/perry-hir/src/lower/expr_object.rs:171-499 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:22-346 | crates/perry-hir/src/lower_decl/class_members.rs:73-327 | crates/perry-hir/src/lower_decl/class_members.rs:482-725 | crates/perry-hir/src/lower_decl/class_members.rs:888-1039 | crates/perry-hir/src/lower_decl/fn_decl.rs:27-404 | crates/perry-hir/src/lower_decl/private_members.rs:85-247 | crates/perry-hir/src/lower_decl/private_members.rs:321-394 — 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/perry-codegen/src/codegen/split_regions_facts.rs:473— crates/perry-codegen/src/codegen/split_regions_facts.rs:473-568 | crates/perry-codegen/src/collectors/definite_init.rs:481-661 | crates/perry-codegen/src/collectors/segview.rs:1369-1425 | crates/perry-hir/src/dynamic_import.rs:303-376 | crates/perry-hir/src/dynamic_import.rs:381-426 | crates/perry-hir/src/dynamic_import.rs:440-537 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1128-1137 — 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) scripts/component_async_acceptance.py:15— scripts/component_async_acceptance.py:15-83 | scripts/component_async_guest_cancellation_acceptance.py:15-77 | scripts/component_async_guest_exports_acceptance.py:14-107 | scripts/component_persistent_acceptance.py:15-74 | scripts/component_producer_acceptance.py:15-86 | scripts/component_reader_acceptance.py:15-84 | scripts/component_scheduler_wake_acceptance.py:13-70 — 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.
Duplicated block (73 lines × 2) crates/perry-hir/src/walker/expr_mut.rs:583— crates/perry-hir/src/walker/expr_mut.rs:583-655 | crates/perry-hir/src/walker/expr_ref.rs:584-656 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (73 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:953— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:953-1025 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1301-1373 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (64 lines × 2) crates/perry-codegen-js/src/minify.rs:150— crates/perry-codegen-js/src/minify.rs:150-213 | crates/perry-codegen-wasm/src/minify.rs:146-209 — before extracting anything, compare `crates/perry-codegen-js/src/minify.rs` and `crates/perry-codegen-wasm/src/minify.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:56— android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:56-119 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/HoneEditorView.kt:56-119 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/HoneEditorView.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/HoneEditorView.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (49 lines × 2) crates/perry-hir/src/lower/expr_call/crypto.rs:42— crates/perry-hir/src/lower/expr_call/crypto.rs:42-90 | crates/perry-hir/src/lower/expr_call/crypto.rs:161-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (49 lines × 2) crates/perry-codegen-arkts/src/set_hidden.rs:188— crates/perry-codegen-arkts/src/set_hidden.rs:188-236 | crates/perry-codegen-arkts/src/view_builders.rs:254-302 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (35 lines × 2) crates/perry-hir/src/monomorph/infer.rs:265— crates/perry-hir/src/monomorph/infer.rs:265-299 | crates/perry-hir/src/monomorph/infer.rs:374-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:680— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:680-714 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1025-1059 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (31–32 lines × 2) crates/perry-hir/src/lower/stmt.rs:1394— crates/perry-hir/src/lower/stmt.rs:1394-1424 | crates/perry-hir/src/lower_decl/body_stmt.rs:928-959 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (31–32 lines × 2) crates/perry-hir/src/lower_decl/class_members.rs:949— crates/perry-hir/src/lower_decl/class_members.rs:949-980 | crates/perry-hir/src/lower_decl/private_members.rs:342-372 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29–31 lines × 2) crates/perry-ext-http/src/client_events.rs:370— crates/perry-ext-http/src/client_events.rs:370-400 | crates/perry-ext-http/src/client_events.rs:698-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.
Duplicated block (29–31 lines × 2) scripts/gc_store_site_inventory.py:1291— scripts/gc_store_site_inventory.py:1291-1319 | scripts/gc_store_site_inventory.py:1480-1510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/gc_store_site_inventory.py:1291` 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 (30 lines × 2) crates/perry-codegen/src/codegen/class_artifacts.rs:313— crates/perry-codegen/src/codegen/class_artifacts.rs:313-342 | crates/perry-codegen/src/codegen/class_artifacts.rs:444-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:460— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:460-489 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:611-640 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (22–28 lines × 2) crates/perry-codegen/src/collectors/hot_callees.rs:126— crates/perry-codegen/src/collectors/hot_callees.rs:126-153 | crates/perry-codegen/src/collectors/hot_callees.rs:225-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 (22–28 lines × 2) crates/perry-hir/src/lower/module_decl.rs:672— crates/perry-hir/src/lower/module_decl.rs:672-699 | crates/perry-hir/src/lower/module_decl.rs:751-772 — both copies are in the same file, so extract the block into 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–26 lines × 2) crates/perry-codegen-glance/src/emit.rs:552— crates/perry-codegen-glance/src/emit.rs:552-577 | crates/perry-codegen-wear-tiles/src/emit.rs:374-397 — before extracting anything, compare `crates/perry-codegen-glance/src/emit.rs` and `crates/perry-codegen-wear-tiles/src/emit.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–26 lines × 2) crates/perry-hir/src/destructuring/assignment_expr.rs:108— crates/perry-hir/src/destructuring/assignment_expr.rs:108-133 | crates/perry-hir/src/destructuring/assignment_expr.rs:203-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–25 lines × 2) crates/perry-codegen/src/stmt/loops.rs:5518— crates/perry-codegen/src/stmt/loops.rs:5518-5538 | crates/perry-codegen/src/stmt/loops.rs:5590-5614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–25 lines × 2) crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:146— crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:146-170 | crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:468-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23–24 lines × 2) crates/perry-codegen/src/codegen/method.rs:365— crates/perry-codegen/src/codegen/method.rs:365-388 | crates/perry-codegen/src/codegen/method_static.rs:82-104 — before extracting anything, compare `crates/perry-codegen/src/codegen/method.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23–24 lines × 2) crates/perry-codegen/src/type_analysis/strings.rs:390— crates/perry-codegen/src/type_analysis/strings.rs:390-413 | crates/perry-codegen/src/type_analysis/strings.rs:578-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 (23 lines × 3) crates/perry-codegen/src/codegen/entry.rs:820— crates/perry-codegen/src/codegen/entry.rs:820-842 | crates/perry-codegen/src/codegen/entry/module_init.rs:300-322 | crates/perry-codegen/src/codegen/method_static.rs:279-301 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:155— crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:155-177 | crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:243-265 | crates/perry-codegen/src/codegen/ordinary_method_artifacts.rs:329-351 — 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 (22–23 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1140— crates/perry-codegen/src/dialect/mod.rs:1140-1161 | crates/perry-codegen/src/dialect/mod.rs:1686-1708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–23 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:803— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:803-824 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1148-1170 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt: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.
Duplicated block (22 lines × 4) crates/perry-codegen/src/codegen/typed_abi.rs:946— crates/perry-codegen/src/codegen/typed_abi.rs:946-967 | crates/perry-codegen/src/codegen/typed_abi.rs:1012-1033 | crates/perry-codegen/src/codegen/typed_abi.rs:1070-1091 | crates/perry-codegen/src/codegen/typed_abi.rs:1141-1162 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 4) crates/perry-codegen/src/collectors/integer_locals.rs:623— crates/perry-codegen/src/collectors/integer_locals.rs:623-644 | crates/perry-codegen/src/collectors/ptr_numarray.rs:607-628 | crates/perry-codegen/src/collectors/ptr_shape.rs:1331-1352 | crates/perry-codegen/src/collectors/sealed_buffers.rs:487-508 — before extracting anything, compare `crates/perry-codegen/src/collectors/integer_locals.rs` and `crates/perry-codegen/src/collectors/ptr_numarray.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–21 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1181— crates/perry-codegen/src/dialect/mod.rs:1181-1201 | crates/perry-codegen/src/dialect/mod.rs:1508-1526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–21 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:909— crates/perry-hir/src/lower/stmt_loops.rs:909-929 | crates/perry-hir/src/lower_decl/body_stmt.rs:1625-1643 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–21 lines × 2) crates/perry-codegen/src/lower_call/new.rs:1660— crates/perry-codegen/src/lower_call/new.rs:1660-1680 | crates/perry-codegen/src/lower_call/new.rs:1702-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 (18–21 lines × 2) crates/perry-hir/src/lower/expr_call/module_static.rs:1284— crates/perry-hir/src/lower/expr_call/module_static.rs:1284-1304 | crates/perry-hir/src/lower/expr_call/native_module/buffer_statics.rs:144-161 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/module_static.rs` and `crates/perry-hir/src/lower/expr_call/native_module/buffer_statics.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 (20–21 lines × 2) crates/perry-codegen/src/type_analysis/strings.rs:380— crates/perry-codegen/src/type_analysis/strings.rs:380-400 | crates/perry-codegen/src/type_analysis/strings.rs:747-766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:709— crates/perry-hir/src/lower_decl/class_decl.rs:709-729 | crates/perry-hir/src/lower_decl/class_decl.rs:1086-1105 — both copies are in the same file, so extract the block into 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/perry-codegen-arkts/src/widgets/scroll.rs:38— crates/perry-codegen-arkts/src/widgets/scroll.rs:38-56 | crates/perry-codegen-arkts/src/widgets/scroll.rs:269-287 | crates/perry-codegen-arkts/src/widgets/structure.rs:32-50 — 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 (19 lines × 3) crates/perry-hir/src/capability.rs:111— crates/perry-hir/src/capability.rs:111-129 | crates/perry-hir/src/egress.rs:103-121 | crates/perry-hir/src/lockdown.rs:62-80 — before extracting anything, compare `crates/perry-hir/src/capability.rs` and `crates/perry-hir/src/egress.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–19 lines × 3) crates/perry-hir/src/lower/module_decl.rs:593— crates/perry-hir/src/lower/module_decl.rs:593-607 | crates/perry-hir/src/lower/module_decl.rs:1715-1733 | crates/perry-hir/src/lower/module_decl.rs:1794-1812 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–19 lines × 3) crates/perry-hir/src/monomorph/infer.rs:254— crates/perry-hir/src/monomorph/infer.rs:254-272 | crates/perry-hir/src/monomorph/infer.rs:364-381 | crates/perry-hir/src/monomorph/update_call_sites.rs:573-587 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) crates/perry-hir/src/lower/lower_expr/arm_optchain.rs:230— crates/perry-hir/src/lower/lower_expr/arm_optchain.rs:230-247 | crates/perry-hir/src/lower/lower_expr/arm_optchain.rs:361-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) scripts/shape_descriptor_census.py:1149— scripts/shape_descriptor_census.py:1149-1167 | scripts/shape_descriptor_census.py:1218-1235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/shape_descriptor_census.py:1149` 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 × 3) crates/perry-codegen/src/codegen/closure.rs:1365— crates/perry-codegen/src/codegen/closure.rs:1365-1381 | crates/perry-codegen/src/codegen/method.rs:756-772 | crates/perry-codegen/src/codegen/method_static.rs:431-447 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/method.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) crates/perry-hir/src/destructuring/var_decl_sources.rs:189— crates/perry-hir/src/destructuring/var_decl_sources.rs:189-205 | crates/perry-hir/src/destructuring/var_decl_sources.rs:236-252 | crates/perry-hir/src/destructuring/var_decl_sources.rs:285-301 — 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–17 lines × 3) crates/perry-codegen/src/codegen/entry.rs:961— crates/perry-codegen/src/codegen/entry.rs:961-977 | crates/perry-codegen/src/codegen/entry/module_init.rs:441-457 | crates/perry-codegen/src/codegen/method_static.rs:424-433 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–17 lines × 3) crates/perry-codegen/src/stmt/loops.rs:7699— crates/perry-codegen/src/stmt/loops.rs:7699-7715 | crates/perry-codegen/src/stmt/loops.rs:9877-9886 | crates/perry-codegen/src/stmt/loops.rs:9948-9957 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–17 lines × 2) crates/perry-codegen/src/stmt/loops.rs:4074— crates/perry-codegen/src/stmt/loops.rs:4074-4089 | crates/perry-codegen/src/stmt/loops.rs:4130-4146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) scripts/check_gate_freshness.py:795— scripts/check_gate_freshness.py:795-810 | scripts/check_gate_freshness.py:901-917 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/check_gate_freshness.py:795` it does not close everything it opens, so those exact lines 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/perry-hir/src/lower/expr_call/local_array_methods.rs:635— crates/perry-hir/src/lower/expr_call/local_array_methods.rs:635-651 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:820-833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–17 lines × 2) crates/perry-hir/src/lower_patterns.rs:1057— crates/perry-hir/src/lower_patterns.rs:1057-1073 | crates/perry-hir/src/lower_patterns.rs:1288-1301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 3) crates/perry-codegen-arkts/src/widgets/scroll.rs:136— crates/perry-codegen-arkts/src/widgets/scroll.rs:136-151 | crates/perry-codegen-arkts/src/widgets/scroll.rs:290-304 | crates/perry-codegen-arkts/src/widgets/stack.rs:119-134 — 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 (15–16 lines × 3) crates/perry-codegen/src/codegen/closure.rs:1276— crates/perry-codegen/src/codegen/closure.rs:1276-1290 | crates/perry-codegen/src/codegen/function.rs:1381-1396 | crates/perry-codegen/src/codegen/method.rs:667-681 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:421— crates/perry-codegen/src/collectors/int_valued_i64_locals.rs:421-436 | crates/perry-codegen/src/scope_env/pass.rs:201-216 | crates/perry-hir/src/lexical_frames.rs:339-354 — 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 (16 lines × 3) crates/perry-codegen/src/expr/js_runtime.rs:84— crates/perry-codegen/src/expr/js_runtime.rs:84-99 | crates/perry-codegen/src/expr/js_runtime.rs:115-130 | crates/perry-codegen/src/expr/js_runtime.rs:213-228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–16 lines × 2) crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:47— crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:47-61 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:417-432 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/local_array_methods.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1319— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1319-1334 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1898-1912 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1319` it does not close everything it opens, so those exact lines 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–16 lines × 2) crates/perry-hir/src/lower_types.rs:484— crates/perry-hir/src/lower_types.rs:484-495 | crates/perry-hir/src/lower_types.rs:499-514 — both copies are in the same file, so extract the block into 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–16 lines × 2) scripts/gc_root_dominance_check.py:5495— scripts/gc_root_dominance_check.py:5495-5506 | scripts/gc_root_dominance_check.py:8479-8494 — both copies are in the same file, so extract the block into 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 × 5) crates/perry-codegen/src/lower_call/func_ref.rs:237— crates/perry-codegen/src/lower_call/func_ref.rs:237-251 | crates/perry-codegen/src/lower_call/func_ref.rs:1161-1175 | crates/perry-codegen/src/lower_call/func_ref.rs:1236-1250 | crates/perry-codegen/src/lower_call/func_ref.rs:1314-1328 | crates/perry-codegen/src/lower_call/func_ref.rs:1405-1419 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 5) crates/perry-hir/src/audit.rs:132— crates/perry-hir/src/audit.rs:132-146 | crates/perry-hir/src/capability.rs:171-185 | crates/perry-hir/src/egress.rs:163-177 | crates/perry-hir/src/lockdown.rs:120-134 | crates/perry-hir/src/lower/expr_function.rs:1710-1724 — before extracting anything, compare `crates/perry-hir/src/audit.rs` and `crates/perry-hir/src/capability.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–15 lines × 2) crates/perry-codegen/src/expr/array_methods.rs:137— crates/perry-codegen/src/expr/array_methods.rs:137-151 | crates/perry-codegen/src/expr/instance_misc1.rs:1323-1330 — before extracting anything, compare `crates/perry-codegen/src/expr/array_methods.rs` and `crates/perry-codegen/src/expr/instance_misc1.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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–15 lines × 2) scripts/test262_subset.py:498— scripts/test262_subset.py:498-505 | scripts/test262_subset.py:530-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) crates/perry-codegen/src/lower_call/property_get/completed_object.rs:49— crates/perry-codegen/src/lower_call/property_get/completed_object.rs:49-60 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:145-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) crates/perry-hir/src/monomorph/infer.rs:23— crates/perry-hir/src/monomorph/infer.rs:23-37 | crates/perry-hir/src/monomorph/update_call_sites.rs:698-709 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1178— crates/perry-codegen/src/codegen/closure.rs:1178-1191 | crates/perry-codegen/src/codegen/entry.rs:826-839 | crates/perry-codegen/src/codegen/entry/module_init.rs:306-319 | crates/perry-codegen/src/codegen/function.rs:1326-1339 | crates/perry-codegen/src/codegen/method.rs:614-627 | crates/perry-codegen/src/codegen/method_static.rs:285-298 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1471— crates/perry-codegen/src/codegen/closure.rs:1471-1484 | crates/perry-codegen/src/codegen/entry.rs:1076-1089 | crates/perry-codegen/src/codegen/entry/module_init.rs:556-569 | crates/perry-codegen/src/codegen/function.rs:1573-1586 | crates/perry-codegen/src/codegen/method.rs:866-879 | crates/perry-codegen/src/codegen/method_static.rs:530-543 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–14 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:606— crates/perry-hir/src/lower_decl/class_decl.rs:606-619 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:301-310 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–14 lines × 2) crates/perry-hir/src/monomorph/infer.rs:87— crates/perry-hir/src/monomorph/infer.rs:87-100 | crates/perry-hir/src/monomorph/update_call_sites.rs:742-751 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) crates/perry-codegen/src/codegen/closure.rs:42— crates/perry-codegen/src/codegen/closure.rs:42-54 | crates/perry-codegen/src/codegen/closure.rs:59-71 | crates/perry-codegen/src/codegen/closure.rs:76-88 | crates/perry-codegen/src/codegen/closure.rs:94-106 — 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 (13 lines × 4) crates/perry-codegen/src/collectors/param_ranges.rs:144— crates/perry-codegen/src/collectors/param_ranges.rs:144-156 | crates/perry-codegen/src/collectors/pointer_locals.rs:510-522 | crates/perry-codegen/src/collectors/pointer_locals.rs:737-749 | crates/perry-hir/src/analysis/value_types.rs:449-461 — before extracting anything, compare `crates/perry-codegen/src/collectors/pointer_locals.rs` and `crates/perry-hir/src/analysis/value_types.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–13 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1130— crates/perry-codegen/src/dialect/mod.rs:1130-1138 | crates/perry-codegen/src/dialect/mod.rs:1672-1684 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–13 lines × 2) crates/perry-codegen/src/expr/index_get.rs:89— crates/perry-codegen/src/expr/index_get.rs:89-101 | crates/perry-codegen/src/expr/index_set.rs:130-138 — before extracting anything, compare `crates/perry-codegen/src/expr/index_get.rs` and `crates/perry-codegen/src/expr/index_set.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–12 lines × 2) crates/perry-ext-better-sqlite3/src/lib.rs:367— crates/perry-ext-better-sqlite3/src/lib.rs:367-374 | crates/perry-ext-better-sqlite3/src/lib.rs:441-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–12 lines × 2) crates/perry-hir/src/destructuring/pattern_binding.rs:579— crates/perry-hir/src/destructuring/pattern_binding.rs:579-590 | crates/perry-hir/src/lower/stmt.rs:357-364 — before extracting anything, compare `crates/perry-hir/src/destructuring/pattern_binding.rs` and `crates/perry-hir/src/lower/stmt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 2) crates/perry-codegen/src/codegen/mod.rs:1537— crates/perry-codegen/src/codegen/mod.rs:1537-1543 | crates/perry-codegen/src/codegen/mod.rs:1674-1684 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–11 lines × 2) crates/perry-hir/src/lower_decl/block.rs:162— crates/perry-hir/src/lower_decl/block.rs:162-172 | crates/perry-hir/src/lower_decl/block.rs:358-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–11 lines × 2) crates/perry-codegen/src/lower_call/extern_timers.rs:138— crates/perry-codegen/src/lower_call/extern_timers.rs:138-145 | crates/perry-codegen/src/lower_call/namespace_call.rs:190-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–11 lines × 2) crates/perry-hir/src/lower/stmt.rs:1454— crates/perry-hir/src/lower/stmt.rs:1454-1461 | crates/perry-hir/src/lower/stmt.rs:1500-1510 — both copies are in the same file, so extract the block into 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 × 8) crates/perry-codegen/src/codegen/function.rs:228— crates/perry-codegen/src/codegen/function.rs:228-237 | crates/perry-codegen/src/codegen/function.rs:241-250 | crates/perry-codegen/src/codegen/function.rs:255-264 | crates/perry-codegen/src/codegen/function.rs:270-279 | crates/perry-codegen/src/codegen/method_trampolines.rs:27-36 | crates/perry-codegen/src/codegen/method_trampolines.rs:40-49 | crates/perry-codegen/src/codegen/method_trampolines.rs:54-63 | crates/perry-codegen/src/codegen/method_trampolines.rs:69-78 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_trampolines.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 8) crates/perry-codegen/src/codegen/typed_abi.rs:862— crates/perry-codegen/src/codegen/typed_abi.rs:862-871 | crates/perry-codegen/src/codegen/typed_abi.rs:974-983 | crates/perry-codegen/src/codegen/typed_abi.rs:1040-1049 | crates/perry-codegen/src/codegen/typed_abi.rs:1101-1110 | crates/perry-codegen/src/codegen/typed_abi.rs:1169-1178 | crates/perry-codegen/src/codegen/typed_abi.rs:1212-1221 | crates/perry-codegen/src/codegen/typed_abi.rs:1245-1254 | crates/perry-codegen/src/codegen/typed_abi.rs:1276-1285 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1350— crates/perry-codegen/src/codegen/closure.rs:1350-1359 | crates/perry-codegen/src/codegen/entry.rs:953-962 | crates/perry-codegen/src/codegen/entry/module_init.rs:433-442 | crates/perry-codegen/src/codegen/function.rs:1454-1463 | crates/perry-codegen/src/codegen/method.rs:741-750 | crates/perry-codegen/src/codegen/method_static.rs:416-425 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) crates/perry-codegen/src/codegen/closure.rs:1456— crates/perry-codegen/src/codegen/closure.rs:1456-1465 | crates/perry-codegen/src/codegen/entry.rs:1061-1070 | crates/perry-codegen/src/codegen/entry/module_init.rs:541-550 | crates/perry-codegen/src/codegen/function.rs:1558-1567 | crates/perry-codegen/src/codegen/method.rs:851-860 | crates/perry-codegen/src/codegen/method_static.rs:515-524 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–10 lines × 3) crates/perry-codegen/src/codegen/closure.rs:71— crates/perry-codegen/src/codegen/closure.rs:71-80 | crates/perry-codegen/src/codegen/function.rs:251-259 | crates/perry-codegen/src/codegen/method_trampolines.rs:50-58 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–10 lines × 3) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1133— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1133-1142 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:215-223 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:144-152 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 3) crates/perry-codegen/src/expr/array_pop.rs:78— crates/perry-codegen/src/expr/array_pop.rs:78-86 | crates/perry-codegen/src/expr/class_field_push.rs:50-57 | crates/perry-codegen/src/stmt/loops.rs:3316-3323 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/class_field_push.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–9 lines × 3) crates/perry-codegen/src/lower_call/new.rs:1523— crates/perry-codegen/src/lower_call/new.rs:1523-1530 | crates/perry-codegen/src/lower_call/new.rs:1543-1551 | crates/perry-codegen/src/lower_call/new.rs:1566-1574 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–9 lines × 3) crates/perry-codegen/src/lower_call/direct_method_guard.rs:69— crates/perry-codegen/src/lower_call/direct_method_guard.rs:69-77 | crates/perry-codegen/src/lower_call/method_override.rs:288-291 | crates/perry-codegen/src/lower_call/method_override.rs:406-414 — before extracting anything, compare `crates/perry-codegen/src/lower_call/direct_method_guard.rs` and `crates/perry-codegen/src/lower_call/method_override.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. If that is what happened, the fix is to keep one copy and have the 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 (4–9 lines × 3) crates/perry-hir/src/lower/const_fold_fn.rs:549— crates/perry-hir/src/lower/const_fold_fn.rs:549-557 | crates/perry-hir/src/lower/expr_new/helpers.rs:109-112 | crates/perry-hir/src/lower/fn_ctor_env.rs:514-522 — before extracting anything, compare `crates/perry-hir/src/lower/const_fold_fn.rs` and `crates/perry-hir/src/lower/fn_ctor_env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1145— crates/perry-codegen/src/codegen/closure.rs:1145-1152 | crates/perry-codegen/src/codegen/entry.rs:790-797 | crates/perry-codegen/src/codegen/entry/module_init.rs:273-280 | crates/perry-codegen/src/codegen/function.rs:1291-1298 | crates/perry-codegen/src/codegen/method.rs:575-582 | crates/perry-codegen/src/codegen/method_static.rs:247-254 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 6) crates/perry-codegen/src/expr/env_clones.rs:285— crates/perry-codegen/src/expr/env_clones.rs:285-292 | crates/perry-codegen/src/expr/misc_methods.rs:661-668 | crates/perry-codegen/src/expr/misc_methods.rs:697-704 | crates/perry-codegen/src/expr/misc_methods.rs:1121-1128 | crates/perry-codegen/src/expr/static_field_meta.rs:564-571 | crates/perry-codegen/src/expr/static_field_meta.rs:828-835 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–8 lines × 2) crates/perry-codegen/src/expr/agent_ptr.rs:155— crates/perry-codegen/src/expr/agent_ptr.rs:155-160 | crates/perry-codegen/src/expr/agent_ptr.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.
Duplicated block (6–8 lines × 2) crates/perry-ext-http/src/server/response.rs:409— crates/perry-ext-http/src/server/response.rs:409-416 | crates/perry-ext-http/src/server/response.rs:532-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 8) crates/perry-codegen/src/expr/env_clones.rs:286— crates/perry-codegen/src/expr/env_clones.rs:286-292 | crates/perry-codegen/src/expr/misc_methods.rs:662-668 | crates/perry-codegen/src/expr/misc_methods.rs:698-704 | crates/perry-codegen/src/expr/misc_methods.rs:1048-1054 | crates/perry-codegen/src/expr/misc_methods.rs:1077-1083 | crates/perry-codegen/src/expr/misc_methods.rs:1122-1128 | crates/perry-codegen/src/expr/static_field_meta.rs:565-571 | crates/perry-codegen/src/expr/static_field_meta.rs:829-835 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 8) crates/perry-codegen/src/expr/calls/fs.rs:66— crates/perry-codegen/src/expr/calls/fs.rs:66-72 | crates/perry-codegen/src/expr/calls/fs.rs:174-180 | crates/perry-codegen/src/expr/calls/fs.rs:191-197 | crates/perry-codegen/src/expr/calls/fs.rs:308-314 | crates/perry-codegen/src/expr/calls/fs.rs:325-331 | crates/perry-codegen/src/expr/calls/fs.rs:342-348 | crates/perry-codegen/src/expr/calls/fs.rs:382-393 | crates/perry-codegen/src/expr/calls/fs.rs:422-428 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 7) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:276— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:276-282 | crates/perry-codegen/src/expr/calls/fs.rs:38-44 | crates/perry-codegen/src/expr/calls/fs.rs:56-62 | crates/perry-codegen/src/expr/calls/fs.rs:237-243 | crates/perry-codegen/src/expr/calls/fs.rs:256-262 | crates/perry-codegen/src/expr/calls/fs.rs:275-281 | crates/perry-codegen/src/expr/calls/fs.rs:367-373 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 7) crates/perry-hir/src/lower/expr_object.rs:1346— crates/perry-hir/src/lower/expr_object.rs:1346-1352 | crates/perry-hir/src/lower/expr_object.rs:1356-1362 | crates/perry-hir/src/lower/expr_object.rs:1369-1375 | crates/perry-hir/src/lower/expr_object.rs:1397-1403 | crates/perry-hir/src/lower/expr_object.rs:1609-1615 | crates/perry-hir/src/lower/expr_object.rs:1619-1625 | crates/perry-hir/src/lower/expr_object.rs:1632-1638 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 6) crates/perry-codegen/src/lower_call/early_branches.rs:816— crates/perry-codegen/src/lower_call/early_branches.rs:816-822 | crates/perry-codegen/src/lower_call/func_ref.rs:1152-1158 | crates/perry-codegen/src/lower_call/func_ref.rs:1159-1165 | crates/perry-codegen/src/lower_call/func_ref.rs:1234-1240 | crates/perry-codegen/src/lower_call/func_ref.rs:1312-1318 | crates/perry-codegen/src/lower_call/func_ref.rs:1403-1409 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 6) crates/perry-hir/src/lower/expr_member.rs:1343— crates/perry-hir/src/lower/expr_member.rs:1343-1364 | crates/perry-hir/src/lower/expr_member.rs:1374-1385 | crates/perry-hir/src/lower/expr_member.rs:1542-1557 | crates/perry-hir/src/lower/expr_member.rs:1571-1577 | crates/perry-hir/src/lower/expr_member.rs:1581-1587 | crates/perry-hir/src/lower/expr_member.rs:1591-1597 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) crates/perry-codegen/src/expr/array_pop.rs:82— crates/perry-codegen/src/expr/array_pop.rs:82-91 | crates/perry-codegen/src/expr/array_pop.rs:141-148 | crates/perry-codegen/src/expr/arrays_finds.rs:152-160 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:247-254 | crates/perry-codegen/src/stmt/loops.rs:3320-3326 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.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.
Duplicated block (7 lines × 5) crates/perry-hir/src/lower/expr_call/nested_namespace.rs:147— crates/perry-hir/src/lower/expr_call/nested_namespace.rs:147-153 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:171-177 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:197-203 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:208-214 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:219-225 — 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–7 lines × 2) crates/perry-codegen/src/codegen/artifact_source_text.rs:225— crates/perry-codegen/src/codegen/artifact_source_text.rs:225-231 | crates/perry-codegen/src/codegen/artifacts.rs:1027-1031 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–7 lines × 2) scripts/check_gc_scanner_latches.py:170— scripts/check_gc_scanner_latches.py:170-174 | scripts/check_gc_scanner_latches.py:217-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 `scripts/check_gc_scanner_latches.py:170` it does not close everything it opens, so those 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–7 lines × 3) crates/perry-codegen/src/stmt/loops.rs:7584— crates/perry-codegen/src/stmt/loops.rs:7584-7590 | crates/perry-codegen/src/stmt/loops.rs:7602-7608 | crates/perry-codegen/src/stmt/loops.rs:7636-7638 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–7 lines × 3) scripts/component_command_acceptance.py:84— scripts/component_command_acceptance.py:84-90 | scripts/component_guest_acceptance.py:103-105 | scripts/component_host_acceptance.py:77-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 8) crates/perry-codegen/src/codegen/function.rs:93— crates/perry-codegen/src/codegen/function.rs:93-98 | crates/perry-codegen/src/codegen/function.rs:127-132 | crates/perry-codegen/src/codegen/function.rs:162-167 | crates/perry-codegen/src/codegen/function.rs:200-205 | crates/perry-codegen/src/codegen/method_typed.rs:36-41 | crates/perry-codegen/src/codegen/method_typed.rs:123-128 | crates/perry-codegen/src/codegen/method_typed.rs:169-174 | crates/perry-codegen/src/codegen/method_typed.rs:215-220 — before extracting anything, compare `crates/perry-codegen/src/codegen/function.rs` and `crates/perry-codegen/src/codegen/method_typed.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 8) crates/perry-codegen/src/expr/calls/fs.rs:31— crates/perry-codegen/src/expr/calls/fs.rs:31-37 | crates/perry-codegen/src/expr/calls/fs.rs:49-55 | crates/perry-codegen/src/expr/calls/fs.rs:219-224 | crates/perry-codegen/src/expr/calls/fs.rs:231-236 | crates/perry-codegen/src/expr/calls/fs.rs:250-255 | crates/perry-codegen/src/expr/calls/fs.rs:269-274 | crates/perry-codegen/src/expr/calls/fs.rs:360-366 | crates/perry-codegen/src/expr/calls/fs.rs:462-468 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 7) crates/perry-codegen/src/expr/arrays_finds.rs:1420— crates/perry-codegen/src/expr/arrays_finds.rs:1420-1425 | crates/perry-codegen/src/expr/bigint_set.rs:563-568 | crates/perry-codegen/src/expr/misc_methods.rs:733-738 | crates/perry-codegen/src/expr/misc_methods.rs:1052-1057 | crates/perry-codegen/src/expr/misc_methods.rs:1081-1086 | crates/perry-codegen/src/expr/os_uri_dates.rs:380-385 | crates/perry-codegen/src/expr/string_regex_proc.rs:324-329 — before extracting anything, compare `crates/perry-codegen/src/expr/arrays_finds.rs` and `crates/perry-codegen/src/expr/string_regex_proc.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 7) crates/perry-hir/src/lower/expr_member.rs:1228— crates/perry-hir/src/lower/expr_member.rs:1228-1233 | crates/perry-hir/src/lower/expr_member.rs:1280-1285 | crates/perry-hir/src/lower/expr_member.rs:1430-1435 | crates/perry-hir/src/lower/expr_member.rs:1517-1525 | crates/perry-hir/src/lower/expr_member.rs:1571-1576 | crates/perry-hir/src/lower/expr_member.rs:1581-1586 | crates/perry-hir/src/lower/expr_member.rs:1591-1596 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–6 lines × 4) crates/perry-hir/src/lower/expr_new/helpers.rs:82— crates/perry-hir/src/lower/expr_new/helpers.rs:82-85 | crates/perry-hir/src/lower/widget_decl.rs:877-880 | crates/perry-hir/src/lower/widget_decl.rs:1126-1131 | crates/perry-hir/src/lower/widget_decl.rs:1203-1208 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (4–6 lines × 4) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1569— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1569-1574 | android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1588-1591 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2142-2147 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2160-2163 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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. 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/perry-codegen/src/codegen/entry_outline.rs:816— crates/perry-codegen/src/codegen/entry_outline.rs:816-820 | crates/perry-codegen/src/codegen/fresh_class_templates.rs:103-107 | crates/perry-codegen/src/codegen/function_source_header.rs:227-231 | crates/perry-codegen/src/codegen/split_regions_facts.rs:368-372 | crates/perry-codegen/src/collectors/cjs_scaffolding.rs:202-206 | crates/perry-codegen/src/collectors/cjs_scaffolding.rs:435-439 | crates/perry-codegen/src/collectors/ptr_shape_returns.rs:404-408 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:493-497 | crates/perry-codegen/src/collectors/scalar_method_dispatch.rs:547-551 | crates/perry-codegen/src/scope_env/mod.rs:231-235 — there are 10 copies across 8 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 10 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 10) crates/perry-hir/src/lower/expr_call/nested_namespace.rs:117— crates/perry-hir/src/lower/expr_call/nested_namespace.rs:117-121 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:141-145 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:152-156 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:165-169 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:176-180 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:191-195 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:202-206 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:213-217 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:224-228 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:237-241 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 9) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:71— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:71-75 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:109-113 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:240-244 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:315-319 | crates/perry-codegen/src/expr/misc_methods.rs:341-345 | crates/perry-codegen/src/expr/misc_methods.rs:407-411 | crates/perry-codegen/src/expr/misc_methods.rs:468-472 | crates/perry-codegen/src/expr/misc_methods.rs:565-569 | crates/perry-codegen/src/expr/misc_methods.rs:607-611 — 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 (5 lines × 9) crates/perry-codegen/src/expr/array_methods.rs:347— crates/perry-codegen/src/expr/array_methods.rs:347-351 | crates/perry-codegen/src/expr/arrays_finds.rs:814-818 | crates/perry-codegen/src/expr/instance_misc1.rs:1049-1054 | crates/perry-codegen/src/expr/instance_misc1.rs:1056-1060 | crates/perry-codegen/src/expr/logical_collections.rs:1102-1109 | crates/perry-codegen/src/expr/logical_collections.rs:1116-1120 | crates/perry-codegen/src/expr/misc_methods.rs:163-167 | crates/perry-codegen/src/expr/misc_methods.rs:287-291 | crates/perry-codegen/src/expr/string_regex_proc.rs:546-550 — before extracting anything, compare `crates/perry-codegen/src/expr/array_methods.rs` and `crates/perry-codegen/src/expr/instance_misc1.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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 × 8) crates/perry-codegen/src/expr/array_literal.rs:487— crates/perry-codegen/src/expr/array_literal.rs:487-492 | crates/perry-codegen/src/expr/byte_cell.rs:542-546 | crates/perry-codegen/src/expr/index_get/symbol_ic.rs:107-111 | crates/perry-codegen/src/expr/literals_vars.rs:132-137 | crates/perry-codegen/src/expr/mod.rs:2761-2766 | crates/perry-codegen/src/expr/static_method.rs:347-351 | crates/perry-codegen/src/scope_env/access.rs:86-91 | crates/perry-codegen/src/stmt/region_loop/guard.rs:630-635 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/expr/index_get/symbol_ic.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 8) crates/perry-codegen/src/lower_call/func_ref.rs:1147— crates/perry-codegen/src/lower_call/func_ref.rs:1147-1151 | crates/perry-codegen/src/lower_call/func_ref.rs:1221-1225 | crates/perry-codegen/src/lower_call/func_ref.rs:1297-1301 | crates/perry-codegen/src/lower_call/func_ref.rs:1389-1393 | crates/perry-codegen/src/lower_call/method_override.rs:1356-1360 | crates/perry-codegen/src/lower_call/method_override.rs:1440-1444 | crates/perry-codegen/src/lower_call/method_override.rs:1526-1530 | crates/perry-codegen/src/lower_call/method_override.rs:1613-1617 — before extracting anything, compare `crates/perry-codegen/src/lower_call/func_ref.rs` and `crates/perry-codegen/src/lower_call/method_override.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 7) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:45— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:45-49 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:72-76 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:110-114 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:241-245 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:316-320 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:132-136 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:659-663 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_kdf.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) crates/perry-codegen/src/expr/bigint_set.rs:78— crates/perry-codegen/src/expr/bigint_set.rs:78-82 | crates/perry-codegen/src/expr/bigint_set.rs:190-194 | crates/perry-codegen/src/expr/bigint_set.rs:257-261 | crates/perry-codegen/src/expr/logical_collections.rs:480-484 | crates/perry-codegen/src/expr/math_simple.rs:201-205 | crates/perry-codegen/src/expr/math_simple.rs:296-300 | crates/perry-codegen/src/expr/math_simple.rs:365-369 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–5 lines × 5) crates/perry-codegen/src/lower_call/property_get.rs:123— crates/perry-codegen/src/lower_call/property_get.rs:123-127 | crates/perry-codegen/src/lower_call/property_get.rs:244-248 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:122-124 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:112-116 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:258-262 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–5 lines × 5) crates/perry-codegen/src/expr/property_get.rs:252— crates/perry-codegen/src/expr/property_get.rs:252-254 | crates/perry-codegen/src/expr/property_get.rs:337-339 | crates/perry-codegen/src/expr/static_field_meta.rs:470-474 | crates/perry-codegen/src/lower_call/method_override.rs:1195-1199 | crates/perry-codegen/src/lower_call/scalar_method.rs:670-674 — before extracting anything, compare `crates/perry-codegen/src/lower_call/method_override.rs` and `crates/perry-codegen/src/lower_call/scalar_method.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (4–5 lines × 4) crates/perry-codegen/src/expr/array_methods.rs:186— crates/perry-codegen/src/expr/array_methods.rs:186-191 | crates/perry-codegen/src/expr/array_methods.rs:394-398 | crates/perry-codegen/src/expr/arrays_finds.rs:632-635 | crates/perry-codegen/src/expr/arrays_finds.rs:740-744 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (4–5 lines × 4) crates/perry-codegen/src/proto_constants.rs:246— crates/perry-codegen/src/proto_constants.rs:246-249 | crates/perry-codegen/src/proto_constants.rs:252-256 | crates/perry-codegen/src/proto_constants.rs:590-593 | crates/perry-codegen/src/proto_constants.rs:596-600 — 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 (4–5 lines × 3) crates/perry-codegen/src/expr/array_methods.rs:429— crates/perry-codegen/src/expr/array_methods.rs:429-433 | crates/perry-codegen/src/expr/instance_misc1.rs:791-795 | crates/perry-codegen/src/expr/proxy_reflect.rs:788-791 — before extracting anything, compare `crates/perry-codegen/src/expr/array_methods.rs` and `crates/perry-codegen/src/expr/instance_misc1.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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 (4–5 lines × 3) scripts/constfn_executable_gates.py:469— scripts/constfn_executable_gates.py:469-473 | scripts/constfn_executable_gates.py:497-501 | scripts/constfn_executable_gates.py:603-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.
Duplicated block (42 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:722— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:722-763 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1067-1108 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (42 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:909— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:909-950 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1257-1298 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (19–22 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:635— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:635-653 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:786-807 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (19–22 lines × 2) scripts/shape_descriptor_census.py:1215— scripts/shape_descriptor_census.py:1215-1233 | scripts/shape_descriptor_census.py:1396-1417 — both copies are in the same file, so extract the block into 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–22 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1699— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1699-1720 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2270-2286 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (17–22 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1750— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:1750-1771 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:2316-2332 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (30 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:601— crates/perry-codegen-js/src/web_runtime.js:601 · crates/perry-codegen-wasm/src/wasm_runtime.js:3252 — 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) crates/perry-codegen-js/src/web_runtime.js:3611— crates/perry-codegen-js/src/web_runtime.js:3611 · crates/perry-codegen-wasm/src/wasm_runtime.js:4124 — 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 (29 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:652— crates/perry-codegen-js/src/web_runtime.js:652 · crates/perry-codegen-wasm/src/wasm_runtime.js:3303 — 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 (29 lines × 2 locations) scripts/test-async-resource-own-bind.mjs:20— scripts/test-async-resource-own-bind.mjs:20 · scripts/test-child-output-late-iterator.mjs:21 — 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 (24 lines × 2 locations) crates/perry-codegen-wasm/src/wasm_runtime.js:845— crates/perry-codegen-wasm/src/wasm_runtime.js:845 · crates/perry-codegen-wasm/src/wasm_runtime.js:885 — 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 (24 lines × 2 locations) upstream/actions/actions/checkout/src/git-command-manager.ts:545— upstream/actions/actions/checkout/src/git-command-manager.ts:545 · upstream/actions/actions/checkout/src/git-command-manager.ts: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 (23 lines × 2 locations) packages/perry-threads/src/parallel.ts:15— packages/perry-threads/src/parallel.ts:15 · packages/perry-threads/src/parallel.ts:58 — both copies are in the same file, so extract the block into 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 locations) upstream/actions/actions/configure-pages/src/config-parser.js:163— upstream/actions/actions/configure-pages/src/config-parser.js:163 · upstream/actions/actions/configure-pages/src/config-parser.js: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.
Duplicated block (16 lines × 2 locations) upstream/actions/astral-sh/setup-uv/src/save-cache.ts:15— upstream/actions/astral-sh/setup-uv/src/save-cache.ts:15 · upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:22 — 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 (16 lines × 2 locations) upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:204— upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:204 · upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:221 — both copies are in the same file, so extract the block into 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 locations) REDACTED:99— REDACTED:99 · REDACTED: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 (15 lines × 2 locations) upstream/actions/actions/deploy-pages/src/internal/api-client.js:128— upstream/actions/actions/deploy-pages/src/internal/api-client.js:128 · upstream/actions/actions/deploy-pages/src/internal/api-client.js:146 — 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.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×2
Untrusted text written into markup unescaped crates/perry-codegen-js/src/web_runtime.js:1210— `svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped crates/perry-codegen-js/src/web_runtime.js:1668— `item.title` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
Expr::hash (cyclomatic 659) crates/perry-hir/src/stable_hash/expr.rs:31— Expr::hash has cyclomatic complexity 659 (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.
wasm_runtime.buildImports (cyclomatic 331) crates/perry-codegen-wasm/src/wasm_runtime.js:137— wasm_runtime.buildImports has cyclomatic complexity 331 (threshold 15). Most of this is not in the body itself: 4 of the 331 points are its own statements and the rest belongs to 158 function literals inside it that branch (lines 668, 172, 581, …). 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.
gc_root_dominance_check.self_test (cyclomatic 140) scripts/gc_root_dominance_check.py:6812— gc_root_dominance_check.self_test has cyclomatic complexity 140 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Solver.apply (cyclomatic 121) scripts/wpfacts_recompute.py:311— Solver.apply has cyclomatic complexity 121 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GuardState::matches (cyclomatic 103) crates/perry-runtime/src/param_type_guard.rs:509— GuardState::matches has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gc_root_dominance_check.main (cyclomatic 92) scripts/gc_root_dominance_check.py:8076— gc_root_dominance_check.main has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
package_bench.cmd_report (cyclomatic 84) scripts/package_bench.py:925— package_bench.cmd_report has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gc_root_dominance_check.statepoint_self_test (cyclomatic 81) scripts/gc_root_dominance_check.py:6087— gc_root_dominance_check.statepoint_self_test 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.
check_actions_topology.main (cyclomatic 79) scripts/check_actions_topology.py:32— check_actions_topology.main has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
package_bench.cmd_run (cyclomatic 75) scripts/package_bench.py:504— package_bench.cmd_run has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gc_root_dominance_check.check_func_unrooted_allocas (cyclomatic 66) scripts/gc_root_dominance_check.py:3979— gc_root_dominance_check.check_func_unrooted_allocas has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent 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_linux_rss_ab.main (cyclomatic 66) scripts/measure_linux_rss_ab.py:160— measure_linux_rss_ab.main has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Proof::expr (cyclomatic 65) crates/perry-hir/src/analysis/numeric_order.rs:315— Proof::expr 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.
verification.native_rep_contract_results (cyclomatic 61) scripts/compiler_output_harness/verification.py:787— verification.native_rep_contract_results 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.
wpfacts_recompute.run (cyclomatic 61) scripts/wpfacts_recompute.py:1072— wpfacts_recompute.run has cyclomatic complexity 61 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
actions_plan._matches_event (cyclomatic 59) scripts/actions_plan.py:88— actions_plan._matches_event 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.
index.main (cyclomatic 59) upstream/actions/jdx/mr-boxington-action/src/index.ts:330— index.main has cyclomatic complexity 59 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
constfn_executable_gates.main (cyclomatic 56) scripts/constfn_executable_gates.py:366— constfn_executable_gates.main has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
web_runtime._perryCodeToKey (cyclomatic 55) crates/perry-codegen-js/src/web_runtime.js:1831— web_runtime._perryCodeToKey has cyclomatic complexity 55 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
wasm_runtime.__perryCodeToKey (cyclomatic 55) crates/perry-codegen-wasm/src/wasm_runtime.js:3652— wasm_runtime.__perryCodeToKey has cyclomatic complexity 55 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
node_core_subset.main (cyclomatic 54) scripts/node_core_subset.py:496— node_core_subset.main 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.
gc_runtime_root_holders.self_test (cyclomatic 53) scripts/gc_runtime_root_holders.py:1621— gc_runtime_root_holders.self_test has cyclomatic complexity 53 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Need::compute (cyclomatic 52) crates/perry-codegen/src/codegen/source_need/flow.rs:1577— Need::compute has cyclomatic complexity 52 (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.
actions_plan.select (cyclomatic 52) scripts/actions_plan.py:196— actions_plan.select 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.
verification.verify_artifacts (cyclomatic 52) scripts/compiler_output_harness/verification.py:1253— verification.verify_artifacts 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.
LlModule::layout_codegen_units (cyclomatic 51) crates/perry-codegen/src/module.rs:1269— LlModule::layout_codegen_units 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.
native_export_collisions.source_exports (cyclomatic 51) scripts/native_export_collisions.py:286— native_export_collisions.source_exports 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.
check_gate_freshness.self_test (cyclomatic 46) scripts/check_gate_freshness.py:512— check_gate_freshness.self_test 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.
perry_ext_ws::js_ws_process_pending (cyclomatic 45) crates/perry-ext-ws/src/lib.rs:1548— perry_ext_ws::js_ws_process_pending 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.
web_runtime._mapKeyToAction (cyclomatic 45) crates/perry-codegen-js/src/web_runtime.js:2245— web_runtime._mapKeyToAction has cyclomatic complexity 45 (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.
shape_descriptor_census.assert_authority_surfaces (cyclomatic 44) scripts/shape_descriptor_census.py:425— shape_descriptor_census.assert_authority_surfaces 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.
NativeRepSummary::from_records (cyclomatic 43) crates/perry-codegen/src/native_value/artifact.rs:372— NativeRepSummary::from_records has cyclomatic complexity 43 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GlobalEvalHoist::rewrite_list_inner (cyclomatic 43) crates/perry-hir/src/lower/global_eval_hoist.rs:740— GlobalEvalHoist::rewrite_list_inner 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.
HoneEditorView.onCreateInputConnection (cyclomatic 43) android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:123— HoneEditorView.onCreateInputConnection 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.
verification.generic_native_rep_contract_results (cyclomatic 43) scripts/compiler_output_harness/verification.py:617— verification.generic_native_rep_contract_results 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.
native_abi_evidence_report.compiler_output_summary (cyclomatic 42) scripts/native_abi_evidence_report.py:779— native_abi_evidence_report.compiler_output_summary 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.
package_bench_attr.run (cyclomatic 42) scripts/package_bench_attr.py:728— package_bench_attr.run 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.
ClassContract::join (cyclomatic 41) crates/perry-wpfacts/src/units.rs:511— ClassContract::join has cyclomatic complexity 41 (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.
native_abi_evidence_report.benchmark_deltas (cyclomatic 41) scripts/native_abi_evidence_report.py:980— native_abi_evidence_report.benchmark_deltas 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.
perf_frontier_report.collect_report (cyclomatic 41) scripts/perf_frontier_report.py:828— perf_frontier_report.collect_report 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.
rust_dependency_inventory.main (cyclomatic 41) scripts/rust_dependency_inventory.py:31— rust_dependency_inventory.main 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.
NumberAtReadFlow::stmt (cyclomatic 40) crates/perry-codegen/src/collectors/number_by_construction.rs:350— NumberAtReadFlow::stmt 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.
gc_1090_evidence_report.old_page_policy_summary (cyclomatic 40) scripts/gc_1090_evidence_report.py:1031— gc_1090_evidence_report.old_page_policy_summary has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
link_absence.main (cyclomatic 40) scripts/link_absence.py:369— link_absence.main 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.
color.namedColor (cyclomatic 40) packages/perry-styling/src/color.ts:155— color.namedColor has cyclomatic complexity 40 (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.
delete_retired_workflow_runs.main (cyclomatic 39) scripts/delete_retired_workflow_runs.py:46— delete_retired_workflow_runs.main 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.
LlInst::render_into (cyclomatic 38) crates/perry-codegen/src/inst.rs:197— LlInst::render_into has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
gc_root_dominance_check.flag_path_feasible (cyclomatic 38) scripts/gc_root_dominance_check.py:3871— gc_root_dominance_check.flag_path_feasible 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.
repsel_census.census_from_report (cyclomatic 37) scripts/compiler_output_harness/repsel_census.py:425— repsel_census.census_from_report 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.
check_docs.main (cyclomatic 36) scripts/check_docs.py:223— check_docs.main 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.
gc_root_dominance_check.check_func (cyclomatic 36) scripts/gc_root_dominance_check.py:2294— gc_root_dominance_check.check_func 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.
thread_exit_address_globals.check (cyclomatic 36) scripts/thread_exit_address_globals.py:393— thread_exit_address_globals.check 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.
component_http_guest_acceptance.main (cyclomatic 35) scripts/component_http_guest_acceptance.py:122— component_http_guest_acceptance.main 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.
wpfacts_corpus.check_one (cyclomatic 35) scripts/wpfacts_corpus.py:120— wpfacts_corpus.check_one 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.
perry_cli_support::dotenv::parse_record (cyclomatic 34) crates/perry-cli-support/src/dotenv.rs:66— perry_cli_support::dotenv::parse_record 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.
repsel_knob_isolation._verdict (cyclomatic 34) scripts/compiler_output_harness/repsel_knob_isolation.py:322— repsel_knob_isolation._verdict 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.
component_http_p3_acceptance.main (cyclomatic 34) scripts/component_http_p3_acceptance.py:156— component_http_p3_acceptance.main 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.
global_sink_isolation.self_test (cyclomatic 34) scripts/global_sink_isolation.py:484— global_sink_isolation.self_test has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
generator.generateTheme (cyclomatic 34) packages/perry-styling/src/generator.ts:52— generator.generateTheme 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.
Scanner::summary (cyclomatic 33) crates/perry/src/commands/compile/collect_modules/reexport_prune/scan.rs:42— Scanner::summary 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.
Types::value (cyclomatic 33) crates/perry-component-host/src/async_values/reader_types.rs:100— Types::value 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.
analyze-current0ed-native-v17.analyze (cyclomatic 33) docs/audits/gc-rss-instructions-2026-10-03/analyze-current0ed-native-v17.py:56— analyze-current0ed-native-v17.analyze 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.
copied_minor_fallback_report.run_target_collector_gates (cyclomatic 33) scripts/copied_minor_fallback_report.py:856— copied_minor_fallback_report.run_target_collector_gates 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.
gc_runtime_root_holders.scan (cyclomatic 33) scripts/gc_runtime_root_holders.py:833— gc_runtime_root_holders.scan 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.
gc_snapshot_contracts.snapshot_contract_problems (cyclomatic 33) scripts/gc_snapshot_contracts.py:23— gc_snapshot_contracts.snapshot_contract_problems 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.
runtime_abi_check.parse_codegen (cyclomatic 33) scripts/runtime_abi_check.py:580— runtime_abi_check.parse_codegen 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.
tokio_inventory.self_test (cyclomatic 33) scripts/tokio_inventory.py:361— tokio_inventory.self_test 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.
wpfacts_recompute.derive (cyclomatic 33) scripts/wpfacts_recompute.py:1222— wpfacts_recompute.derive 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.
Env::kind (cyclomatic 32) crates/perry-codegen/src/collectors/typed_locals.rs:321— Env::kind has cyclomatic complexity 32 (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.
raw_handle_debt.self_test (cyclomatic 32) scripts/raw_handle_debt.py:340— raw_handle_debt.self_test 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.
registry_lifetime_check.scan_with_sites (cyclomatic 32) scripts/registry_lifetime_check.py:300— registry_lifetime_check.scan_with_sites 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.
wasi_host_qualification.main (cyclomatic 32) scripts/wasi_host_qualification.py:108— wasi_host_qualification.main has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
release.ensureTagAndRelease (cyclomatic 32) scripts/publish/release.mts:123— release.ensureTagAndRelease 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.
gc_repsel_matrix_merge.merge (cyclomatic 31) scripts/gc_repsel_matrix_merge.py:67— gc_repsel_matrix_merge.merge 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.
gc_root_dominance_check.check_func_statepoints (cyclomatic 31) scripts/gc_root_dominance_check.py:5075— gc_root_dominance_check.check_func_statepoints 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.
sso_unbox_inventory.apply_reviews (cyclomatic 31) scripts/sso_unbox_inventory.py:311— sso_unbox_inventory.apply_reviews 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.
wpfacts_oracle.main (cyclomatic 31) scripts/wpfacts_oracle.py:96— wpfacts_oracle.main has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SolidJsx::native_parts (cyclomatic 30) crates/perry-hir/src/solid_jsx/native.rs:57— SolidJsx::native_parts 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.
Serializer::write_heap_value (cyclomatic 30) crates/perry-runtime/src/child_process/v8_serde.rs:245— Serializer::write_heap_value 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.
capture.capture (cyclomatic 30) scripts/compiler_output_harness/capture.py:234— capture.capture has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gc_1090_evidence_report.gate_copied_minor (cyclomatic 30) scripts/gc_1090_evidence_report.py:552— gc_1090_evidence_report.gate_copied_minor 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.
gc_1090_evidence_report.render_markdown (cyclomatic 30) scripts/gc_1090_evidence_report.py:1274— gc_1090_evidence_report.render_markdown 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.
gc_root_dominance_check.check_func_stale (cyclomatic 30) scripts/gc_root_dominance_check.py:3165— gc_root_dominance_check.check_func_stale 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.
realm_manifest_coverage.cell_names (cyclomatic 30) scripts/realm_manifest_coverage.py:24— realm_manifest_coverage.cell_names 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.
NativeAbiType::parse_str (cyclomatic 29) crates/perry-api-manifest/src/native_abi.rs:287— NativeAbiType::parse_str 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.
Prepared::new (cyclomatic 29) crates/perry-component-host/src/async_values/compose.rs:22— Prepared::new has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OutUsageAnalyzer::visit_stmt (cyclomatic 29) crates/perry-transform/src/deforest/out_usage.rs:22— OutUsageAnalyzer::visit_stmt 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.
StmtRefWalker::visit_stmt (cyclomatic 29) crates/perry-transform/src/deforest/walk.rs:214— StmtRefWalker::visit_stmt 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.
W::stmt (cyclomatic 29) crates/perry-wpfacts/src/ctor_phase.rs:148— W::stmt 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.
check_thread_locals.self_test (cyclomatic 29) scripts/check_thread_locals.py:526— check_thread_locals.self_test 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.
gc_root_dominance_check._array_element_loads (cyclomatic 29) scripts/gc_root_dominance_check.py:3607— gc_root_dominance_check._array_element_loads 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.
runtime_abi_check.self_test (cyclomatic 29) scripts/runtime_abi_check.py:1001— runtime_abi_check.self_test 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.
Prop::get (cyclomatic 28) crates/perry-runtime/src/node_stream/proto_methods.rs:927— Prop::get has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SubstituteLocal::visit_stmt (cyclomatic 28) crates/perry-transform/src/deforest/producer_rewrite.rs:94— SubstituteLocal::visit_stmt has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
StmtRefAllWalker::visit_stmt (cyclomatic 28) crates/perry-transform/src/deforest/scan.rs:342— StmtRefAllWalker::visit_stmt has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Graph::value (cyclomatic 28) crates/perry-wit/src/canonical.rs:179— Graph::value has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
check_gc_scanner_latches.mask_non_code (cyclomatic 28) scripts/check_gc_scanner_latches.py:47— check_gc_scanner_latches.mask_non_code 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.
gc_gate_wiring_check.check_gate (cyclomatic 28) scripts/gc_gate_wiring_check.py:220— gc_gate_wiring_check.check_gate 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.
test262_subset.main (cyclomatic 28) scripts/test262_subset.py:393— test262_subset.main has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Header::read (cyclomatic 27) crates/perry-ext-zlib/src/stream/driver.rs:162— Header::read 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.
verification._record_matches_required (cyclomatic 27) scripts/compiler_output_harness/verification.py:540— verification._record_matches_required 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.
gc_store_site_inventory.classify_rust_store (cyclomatic 27) scripts/gc_store_site_inventory.py:396— gc_store_site_inventory.classify_rust_store 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.
package_bench_attr.write_markdown (cyclomatic 27) scripts/package_bench_attr.py:956— package_bench_attr.write_markdown 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.
perf_frontier_report.classify_row (cyclomatic 27) scripts/perf_frontier_report.py:633— perf_frontier_report.classify_row 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.
tokens.parseTokens (cyclomatic 27) packages/perry-styling/src/tokens.ts:29— tokens.parseTokens 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.
GuardGraphBuilder::build_type (cyclomatic 26) crates/perry-codegen/src/codegen/param_guard.rs:300— GuardGraphBuilder::build_type 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.
Analyzer::stmt (cyclomatic 26) crates/perry-codegen/src/scope_env/analysis.rs:142— Analyzer::stmt 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.
WorkerPaths::resolve (cyclomatic 26) crates/perry-hir/src/dynamic_import/worker_paths.rs:133— WorkerPaths::resolve 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.
Substitute::visit_mut_expr (cyclomatic 26) crates/perry-parser/src/defines.rs:125— Substitute::visit_mut_expr 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.
check_gate_freshness.newest_post_merge_result (cyclomatic 26) scripts/check_gate_freshness.py:202— check_gate_freshness.newest_post_merge_result 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.
gate_failure_watch.subject_verdict (cyclomatic 26) scripts/gate_failure_watch.py:107— gate_failure_watch.subject_verdict 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.
gate_failure_watch.check_config (cyclomatic 26) scripts/gate_failure_watch.py:387— gate_failure_watch.check_config 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.
gate_failure_watch.self_test (cyclomatic 26) scripts/gate_failure_watch.py:458— gate_failure_watch.self_test 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.
gen_parity_gaps.covered (cyclomatic 26) scripts/gen_parity_gaps.py:189— gen_parity_gaps.covered 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.
local_binding_type_audit.strip_rust_comments (cyclomatic 26) scripts/local_binding_type_audit.py:117— local_binding_type_audit.strip_rust_comments 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.
wasi_run.main (cyclomatic 26) scripts/wasi_run.py:120— wasi_run.main has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Disposal::visit (cyclomatic 25) crates/perry-component-host/src/async_values/reader_dispose.rs:28— Disposal::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.
Registry::dispatch (cyclomatic 25) crates/perry-db-turnloop/src/lib.rs:813— Registry::dispatch 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.
RealmManifest::validate (cyclomatic 25) crates/perry-runtime-manifest/src/realm.rs:181— RealmManifest::validate 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.
primary-map-prefix-main07-v69r2-auto.build_arm (cyclomatic 25) docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:53— primary-map-prefix-main07-v69r2-auto.build_arm 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.
check_npm_publish_freshness.self_test (cyclomatic 25) scripts/check_npm_publish_freshness.py:557— check_npm_publish_freshness.self_test 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.
perf_frontier_report.summarize_gc_trace (cyclomatic 25) scripts/perf_frontier_report.py:166— perf_frontier_report.summarize_gc_trace 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.
perf_readpath3.main (cyclomatic 25) scripts/perf_readpath3.py:21— perf_readpath3.main has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
string_payload_access_inventory.mask_non_code (cyclomatic 25) scripts/string_payload_access_inventory.py:62— string_payload_access_inventory.mask_non_code 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.
server_ab.idle_client (cyclomatic 25) scripts/turnloop/server_ab.py:1003— server_ab.idle_client 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.
server_ab.markdown (cyclomatic 25) scripts/turnloop/server_ab.py:1534— server_ab.markdown 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.
Solver.call_tok (cyclomatic 25) scripts/wpfacts_recompute.py:719— Solver.call_tok 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.
wpfacts_recompute.load (cyclomatic 25) scripts/wpfacts_recompute.py:992— wpfacts_recompute.load 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.
index.post (cyclomatic 25) upstream/actions/jdx/mr-boxington-action/src/index.ts:593— index.post has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProvenanceJudge::walk_stmts (cyclomatic 24) crates/perry-codegen/src/collectors/integer_locals.rs:595— ProvenanceJudge::walk_stmts 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.
LoopFacts::walk_expr (cyclomatic 24) crates/perry-codegen/src/stmt/number_local_loop.rs:162— LoopFacts::walk_expr 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.
repsel_census.census (cyclomatic 24) scripts/compiler_output_harness/repsel_census.py:1213— repsel_census.census 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.
copied_minor_fallback_report.aggregate_workload (cyclomatic 24) scripts/copied_minor_fallback_report.py:515— copied_minor_fallback_report.aggregate_workload 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.
gc_1090_evidence_report.perf_frontier_summary (cyclomatic 24) scripts/gc_1090_evidence_report.py:777— gc_1090_evidence_report.perf_frontier_summary 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.
report_gc_ratchet.report (cyclomatic 24) scripts/report_gc_ratchet.py:76— report_gc_ratchet.report 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.
wpfacts_recompute.site_verdicts (cyclomatic 24) scripts/wpfacts_recompute.py:1341— wpfacts_recompute.site_verdicts 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.
objects-cache.validateObjectsCachePaths (cyclomatic 24) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:148— objects-cache.validateObjectsCachePaths has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Remap::stmt (cyclomatic 23) crates/perry-hir/src/lexical_frames.rs:335— Remap::stmt 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.
perry_http_server::conn::drain (cyclomatic 23) crates/perry-http-server/src/conn.rs:317— perry_http_server::conn::drain 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.
primary-entry-once-main07-v46-auto.build_arm (cyclomatic 23) docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:44— primary-entry-once-main07-v46-auto.build_arm 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.
primary-lazy-rss-main07-v52-auto.build_arm (cyclomatic 23) docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:44— primary-lazy-rss-main07-v52-auto.build_arm 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.
primary-learned-floor-main07-v60-auto.build_arm (cyclomatic 23) docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:43— primary-learned-floor-main07-v60-auto.build_arm 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.
primary-map-prefix-main07-v69-auto.build_arm (cyclomatic 23) docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:43— primary-map-prefix-main07-v69-auto.build_arm 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.
primary-map-prefix-main07-v69r1-auto.build_arm (cyclomatic 23) docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:43— primary-map-prefix-main07-v69r1-auto.build_arm 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.
capture_linux_incident.main (cyclomatic 23) scripts/capture_linux_incident.py:117— capture_linux_incident.main has cyclomatic complexity 23 (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.
check_node_version_consistency.check (cyclomatic 23) scripts/check_node_version_consistency.py:233— check_node_version_consistency.check 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.
analyzers._selector_matches (cyclomatic 23) scripts/compiler_output_harness/analyzers.py:356— analyzers._selector_matches has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
gc_root_dominance_check._tracked_across_statepoint (cyclomatic 23) scripts/gc_root_dominance_check.py:5251— gc_root_dominance_check._tracked_across_statepoint 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.
gc_store_site_inventory.strip_rust_comments (cyclomatic 23) scripts/gc_store_site_inventory.py:727— gc_store_site_inventory.strip_rust_comments 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.
package_bench_attr.analyze (cyclomatic 23) scripts/package_bench_attr.py:625— package_bench_attr.analyze 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.
server_ab.run (cyclomatic 23) scripts/turnloop/server_ab.py:1292— server_ab.run 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.
wpfacts_precision.census (cyclomatic 23) scripts/wpfacts_precision.py:44— wpfacts_precision.census 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.
index.html.renderDetail (cyclomatic 23) crates/perry-ui-geisterhand/src/inspector_ui/index.html:367— index.html.renderDetail has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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.
objects-cache.withObjectsResourceSampler (cyclomatic 23) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:601— objects-cache.withObjectsResourceSampler has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 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 647, sample, recordSampleFailure, …). 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.
Host::new_prepared (cyclomatic 22) crates/perry-component-host/src/lib.rs:191— Host::new_prepared 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.
CensusWalker::stmt (cyclomatic 22) crates/perry-hir/src/lower/shared_mutable_capture.rs:482— CensusWalker::stmt 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.
perry_http_client::http::exchange (cyclomatic 22) crates/perry-http-client/src/http.rs:467— perry_http_client::http::exchange 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.
MutableRegisteredRootScanState::step (cyclomatic 22) crates/perry-runtime/src/gc/cycle/registered_root_scan.rs:44— MutableRegisteredRootScanState::step 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.
check_gc_doc_claims.self_test (cyclomatic 22) scripts/check_gc_doc_claims.py:269— check_gc_doc_claims.self_test 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.
repsel_census.self_test (cyclomatic 22) scripts/compiler_output_harness/repsel_census.py:1362— repsel_census.self_test 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.
component_http_p3_acceptance.client (cyclomatic 22) scripts/component_http_p3_acceptance.py:19— component_http_p3_acceptance.client 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.
gc_root_dominance_check.run_statepoints (cyclomatic 22) scripts/gc_root_dominance_check.py:5456— gc_root_dominance_check.run_statepoints 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.
gc_runtime_root_holders.inventory_problems (cyclomatic 22) scripts/gc_runtime_root_holders.py:1151— gc_runtime_root_holders.inventory_problems 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.
native_abi_evidence_report.release_symbol_summary (cyclomatic 22) scripts/native_abi_evidence_report.py:1179— native_abi_evidence_report.release_symbol_summary 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.
runtime_abi_check.strip_comments (cyclomatic 22) scripts/runtime_abi_check.py:170— runtime_abi_check.strip_comments 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.
statepoint_report_assert.main (cyclomatic 22) scripts/statepoint_report_assert.py:57— statepoint_report_assert.main has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
server_ab.build (cyclomatic 22) scripts/turnloop/server_ab.py:224— server_ab.build has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
wpfacts_corpus.run_corpus (cyclomatic 22) scripts/wpfacts_corpus.py:211— wpfacts_corpus.run_corpus 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.
renderer.createNativeRenderer.insertNode (cyclomatic 22) packages/perry-solid/src/renderer.ts:100— renderer.createNativeRenderer.insertNode 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.
node_compat_matrix.checkAgainstBaseline (cyclomatic 22) scripts/node_compat_matrix.mjs:682— node_compat_matrix.checkAgainstBaseline 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.
objects-cache.saveIsolatedObjectsBundle (cyclomatic 22) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:843— objects-cache.saveIsolatedObjectsBundle 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, 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.
Names::stmts (cyclomatic 21) crates/perry-codegen/src/codegen/tdz_names.rs:62— Names::stmts 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.
Probe::stmt (cyclomatic 21) crates/perry-codegen/src/collectors/sealed_buffers.rs:167— Probe::stmt 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.
perry_component_io::embedding::option (cyclomatic 21) crates/perry-component-io/src/embedding.rs:554— perry_component_io::embedding::option 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.
ArenaSweepObjectsState::apply_block_skip (cyclomatic 21) crates/perry-runtime/src/gc/oldgen/sweep_objects.rs:134— ArenaSweepObjectsState::apply_block_skip 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.
JsonSourceParser::parse_string_token (cyclomatic 21) crates/perry-runtime/src/json/reviver.rs:215— JsonSourceParser::parse_string_token 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.
perry_ui_windows_winui::widgets::render_handle (cyclomatic 21) crates/perry-ui-windows-winui/src/widgets.rs:398— perry_ui_windows_winui::widgets::render_handle 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.
check_ext_net_socket_open_invariant.mask_non_code (cyclomatic 21) scripts/check_ext_net_socket_open_invariant.py:29— check_ext_net_socket_open_invariant.mask_non_code 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.
verification._text_check_passes (cyclomatic 21) scripts/compiler_output_harness/verification.py:220— verification._text_check_passes 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.
gc_1090_evidence_report.benchmark_matrix (cyclomatic 21) scripts/gc_1090_evidence_report.py:177— gc_1090_evidence_report.benchmark_matrix 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.
gc_root_dominance_check._sp_seed_sites (cyclomatic 21) scripts/gc_root_dominance_check.py:5592— gc_root_dominance_check._sp_seed_sites 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.
global_sink_isolation.asserted_globals (cyclomatic 21) scripts/global_sink_isolation.py:698— global_sink_isolation.asserted_globals 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.
SourceIndex.sourcemap (cyclomatic 21) scripts/package_bench_attr.py:357— SourceIndex.sourcemap 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.
runtime_abi_check.check_ir (cyclomatic 21) scripts/runtime_abi_check.py:925— runtime_abi_check.check_ir 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.
turnloop_p0_loop_stats.main (cyclomatic 21) scripts/turnloop_p0_loop_stats.py:54— turnloop_p0_loop_stats.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
wpfacts_recompute.compare (cyclomatic 21) scripts/wpfacts_recompute.py:1420— wpfacts_recompute.compare 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.
color.parseColor (cyclomatic 21) packages/perry-styling/src/color.ts:26— color.parseColor 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.
node_compat_matrix.parseArgs (cyclomatic 21) scripts/node_compat_matrix.mjs:118— node_compat_matrix.parseArgs has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
ProgramLayoutOrdinals::assign (cyclomatic 20) crates/perry-codegen/src/layout_ordinals.rs:55— ProgramLayoutOrdinals::assign 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.
Rewrite::stmt (cyclomatic 20) crates/perry-codegen/src/scope_env/pass.rs:198— Rewrite::stmt 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.
WalkerImage::decode_row (cyclomatic 20) crates/perry-runtime/src/eh_walker.rs:916— WalkerImage::decode_row 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.
RootScanCycleState::step_current_subphase (cyclomatic 20) crates/perry-runtime/src/gc/cycle.rs:366— RootScanCycleState::step_current_subphase 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.
SlotIter::next (cyclomatic 20) crates/perry-runtime/src/gc/roots/stack_maps_lazy.rs:215— SlotIter::next 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.
Rewriter::stmt (cyclomatic 20) crates/perry-transform/src/crypto_hash_chain.rs:828— Rewriter::stmt has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (perry_transform::crypto_hash_chain::for_each_stmt_expr, perry_transform::crypto_hash_chain::rewrite_refs_stmt) 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.
Dir::open_at (cyclomatic 20) crates/perry-wasi/src/filesystem.rs:877— Dir::open_at 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: perry_wasi::filesystem::from_raw_os_error (cyclomatic 27) 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.
Converter::definition (cyclomatic 20) crates/perry-wit/src/resolve.rs:167— Converter::definition 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.
gc-paired-instruction-domains-v1.run (cyclomatic 20) docs/audits/gc-rss-instructions-2026-10-03/gc-paired-instruction-domains-v1.py:38— gc-paired-instruction-domains-v1.run has cyclomatic complexity 20 (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.
addr_class_inventory.main (cyclomatic 20) scripts/addr_class_inventory.py:743— addr_class_inventory.main 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.
buffer_b1_validate.measure (cyclomatic 20) scripts/buffer_b1_validate.py:149— buffer_b1_validate.measure 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.
buffer_b4_validate.measure (cyclomatic 20) scripts/buffer_b4_validate.py:161— buffer_b4_validate.measure 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.
gc_root_dominance_check.parse_file (cyclomatic 20) scripts/gc_root_dominance_check.py:358— gc_root_dominance_check.parse_file 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.
gc_root_dominance_check.loop_carried_blocks (cyclomatic 20) scripts/gc_root_dominance_check.py:2138— gc_root_dominance_check.loop_carried_blocks 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.
gc_store_site_inventory.run_self_tests (cyclomatic 20) scripts/gc_store_site_inventory.py:1239— gc_store_site_inventory.run_self_tests 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.
node_suite_regression_check.main (cyclomatic 20) scripts/node_suite_regression_check.py:32— node_suite_regression_check.main has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
package_bench_attr.classify (cyclomatic 20) scripts/package_bench_attr.py:200— package_bench_attr.classify 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.
runtime_abi_check.compare_slot (cyclomatic 20) scripts/runtime_abi_check.py:676— runtime_abi_check.compare_slot 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.
runtime_rss_ab.main (cyclomatic 20) scripts/runtime_rss_ab.py:38— runtime_rss_ab.main has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokio_inventory.main (cyclomatic 20) scripts/tokio_inventory.py:548— tokio_inventory.main 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.
web_runtime.perry_ui_canvas_draw_image (cyclomatic 20) crates/perry-codegen-js/src/web_runtime.js:1451— web_runtime.perry_ui_canvas_draw_image 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.
web_runtime._renderTokenizedLine (cyclomatic 20) crates/perry-codegen-js/src/web_runtime.js:2642— web_runtime._renderTokenizedLine 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.
wasm_runtime.perry_ui_canvas_draw_image (cyclomatic 20) crates/perry-codegen-wasm/src/wasm_runtime.js:3554— wasm_runtime.perry_ui_canvas_draw_image 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.
platform-visibility.waitForPlatforms (cyclomatic 20) scripts/publish/platform-visibility.mjs:20— platform-visibility.waitForPlatforms 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.
Resolve::visit_mut_expr (cyclomatic 19) crates/perry/src/commands/compile/collect_modules/import_meta_resolve.rs:53— Resolve::visit_mut_expr 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.
Facts::expr (cyclomatic 19) crates/perry-codegen/src/codegen/opts/computed_names.rs:104— Facts::expr 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.
PrefixContainedParamUse::walk_stmt (cyclomatic 19) crates/perry-codegen/src/collectors/proven_args.rs:224— PrefixContainedParamUse::walk_stmt 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.
Fns::collect (cyclomatic 19) crates/perry-codegen/src/collectors/read_before_write.rs:95— Fns::collect has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_ui::bin::styling-matrix::cmd_gen (cyclomatic 19) crates/perry-ui/src/bin/styling-matrix.rs:82— perry_ui::bin::styling-matrix::cmd_gen 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.
FnContract::join (cyclomatic 19) crates/perry-wpfacts/src/units.rs:386— FnContract::join 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.
verify-gc-window-v6r1-inputs.main (cyclomatic 19) docs/audits/gc-rss-instructions-2026-10-03/verify-gc-window-v6r1-inputs.py:16— verify-gc-window-v6r1-inputs.main 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.
check_ext_net_socket_open_invariant.evaluate (cyclomatic 19) scripts/check_ext_net_socket_open_invariant.py:128— check_ext_net_socket_open_invariant.evaluate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
check_gc_scanner_latches.scan_source (cyclomatic 19) scripts/check_gc_scanner_latches.py:160— check_gc_scanner_latches.scan_source 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.
class_id_collisions.main (cyclomatic 19) scripts/class_id_collisions.py:103— class_id_collisions.main 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.
gc_gate_wiring_check.main (cyclomatic 19) scripts/gc_gate_wiring_check.py:605— gc_gate_wiring_check.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gc_rekeyed_key_tables.check (cyclomatic 19) scripts/gc_rekeyed_key_tables.py:214— gc_rekeyed_key_tables.check 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.
gc_runtime_root_holders.report (cyclomatic 19) scripts/gc_runtime_root_holders.py:1252— gc_runtime_root_holders.report 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.
gc_store_site_inventory.check_codegen_claims (cyclomatic 19) scripts/gc_store_site_inventory.py:995— gc_store_site_inventory.check_codegen_claims 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.
native_abi_evidence_report.explain_lowering_accounting (cyclomatic 19) scripts/native_abi_evidence_report.py:606— native_abi_evidence_report.explain_lowering_accounting 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.
native_abi_evidence_report.packet_workload_contract (cyclomatic 19) scripts/native_abi_evidence_report.py:697— native_abi_evidence_report.packet_workload_contract 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.
parity_report_merge.merge (cyclomatic 19) scripts/parity_report_merge.py:63— parity_report_merge.merge 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.
raw_handle_debt.main (cyclomatic 19) scripts/raw_handle_debt.py:552— raw_handle_debt.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
runtime_abi_check.expand_signature_macros (cyclomatic 19) scripts/runtime_abi_check.py:420— runtime_abi_check.expand_signature_macros 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.
subsystem_slots.main (cyclomatic 19) scripts/subsystem_slots.py:43— subsystem_slots.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
server_ab.main (cyclomatic 19) scripts/turnloop/server_ab.py:1795— server_ab.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
wasi_image_selftest.main (cyclomatic 19) scripts/wasi_image_selftest.py:38— wasi_image_selftest.main has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Solver.escape (cyclomatic 19) scripts/wpfacts_recompute.py:880— Solver.escape 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.
wasm_runtime._perry_audio_start_voice (cyclomatic 19) crates/perry-codegen-wasm/src/wasm_runtime.js:4263— wasm_runtime._perry_audio_start_voice has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
binding_pins.checkOffline (cyclomatic 19) scripts/binding_pins.mjs:252— binding_pins.checkOffline 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.
nightly.main (cyclomatic 19) scripts/publish/nightly.mts:11— nightly.main has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
pipeline.main (cyclomatic 19) scripts/publish/pipeline.mts:449— pipeline.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
objects-cache.measureTree (cyclomatic 19) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:193— objects-cache.measureTree 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.
BuildCacheProbe::probe (cyclomatic 18) crates/perry/src/commands/compile/build_cache.rs:298— BuildCacheProbe::probe 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.
Factories::walk_classes (cyclomatic 18) crates/perry-codegen/src/layout_families/late.rs:209— Factories::walk_classes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
perry_codegen_glance::emit::emit_node (cyclomatic 18) crates/perry-codegen-glance/src/emit.rs:401— perry_codegen_glance::emit::emit_node 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.
State::open_at (cyclomatic 18) crates/perry-component-host/src/sync_wasi/filesystem.rs:388— State::open_at 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.
Driver::new (cyclomatic 18) crates/perry-component-io/src/lib.rs:108— Driver::new has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NamedStateKey::write_existing (cyclomatic 18) crates/perry-runtime/src/runtime_state_key.rs:119— NamedStateKey::write_existing 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.
Value::encode (cyclomatic 18) crates/perry-runtime-manifest/src/realm_json.rs:35— Value::encode 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 items inside it that branch (write, quoted). 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.
primary-mainad0-v79-auto.build_arm (cyclomatic 18) docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-v79-auto.py:38— primary-mainad0-v79-auto.build_arm 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.
buffer_b5_validate.measure (cyclomatic 18) scripts/buffer_b5_validate.py:18— buffer_b5_validate.measure 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.
check_js_body_call_funnel.entry_abi_violations (cyclomatic 18) scripts/check_js_body_call_funnel.py:255— check_js_body_call_funnel.entry_abi_violations 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.
check_npm_publish_freshness.main (cyclomatic 18) scripts/check_npm_publish_freshness.py:826— check_npm_publish_freshness.main has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_CfgParser._expr (cyclomatic 18) scripts/check_thread_locals.py:196— _CfgParser._expr 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.
constfn_executable_gates.guarded_fast_body (cyclomatic 18) scripts/constfn_executable_gates.py:202— constfn_executable_gates.guarded_fast_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.
gc_root_dominance_check.between_blocks (cyclomatic 18) scripts/gc_root_dominance_check.py:2047— gc_root_dominance_check.between_blocks 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.
native_export_collisions.cfg_without_tests (cyclomatic 18) scripts/native_export_collisions.py:67— native_export_collisions.cfg_without_tests 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.
package_bench_attr.cmd_floor (cyclomatic 18) scripts/package_bench_attr.py:1059— package_bench_attr.cmd_floor 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.
perf_12015_lane.compare (cyclomatic 18) scripts/perf_12015_lane.py:114— perf_12015_lane.compare 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.
perf_tscwall_lane.run (cyclomatic 18) scripts/perf_tscwall_lane.py:46— perf_tscwall_lane.run 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.
test262_subset.discover (cyclomatic 18) scripts/test262_subset.py:279— test262_subset.discover 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.
unrooted_local_shape.self_test (cyclomatic 18) scripts/unrooted_local_shape.py:624— unrooted_local_shape.self_test 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.
unrooted_local_shape.main (cyclomatic 18) scripts/unrooted_local_shape.py:885— unrooted_local_shape.main has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Solver.load_from (cyclomatic 18) scripts/wpfacts_recompute.py:557— Solver.load_from 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.
web_runtime.perry_ui_menubar_attach (cyclomatic 18) crates/perry-codegen-js/src/web_runtime.js:1638— web_runtime.perry_ui_menubar_attach 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 8 function items inside it that branch (renderMenuItems, a function literal at line 1712, dismissAll, …). 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.
web_runtime._perry_media_wire_session (cyclomatic 18) crates/perry-codegen-js/src/web_runtime.js:3433— web_runtime._perry_media_wire_session has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 3450, 3458, 3446, …). 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.
wasm_runtime._perry_media_wire_session (cyclomatic 18) crates/perry-codegen-wasm/src/wasm_runtime.js:3944— wasm_runtime._perry_media_wire_session has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 3961, 3969, 3957, …). 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.
wasm_runtime.perry_audio_stop (cyclomatic 18) crates/perry-codegen-wasm/src/wasm_runtime.js:4440— wasm_runtime.perry_audio_stop has cyclomatic complexity 18 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perry_codegen_wear_tiles::emit::emit_node (cyclomatic 17) crates/perry-codegen-wear-tiles/src/emit.rs:207— perry_codegen_wear_tiles::emit::emit_node 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.
perry_ext_better_sqlite3::dispatch_ext::property_of (cyclomatic 17) crates/perry-ext-better-sqlite3/src/dispatch_ext.rs:190— perry_ext_better_sqlite3::dispatch_ext::property_of 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.
Pruner::stmt (cyclomatic 17) crates/perry-hir/src/lower/class_capture_scope.rs:165— Pruner::stmt 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.
Connection::fill_from_socket (cyclomatic 17) crates/perry-http-client/src/transport.rs:327— Connection::fill_from_socket 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.
Decoder::step (cyclomatic 17) crates/perry-http-client/src/ws/frame.rs:168— Decoder::step 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.
Reader::value (cyclomatic 17) crates/perry-runtime/src/array/literal_descriptor.rs:49— Reader::value 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.
CopyingNurseryCollector::move_young (cyclomatic 17) crates/perry-runtime/src/gc/copying.rs:487— CopyingNurseryCollector::move_young 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.
FullWeakProcessingState::step (cyclomatic 17) crates/perry-runtime/src/weakref/sliced.rs:182— FullWeakProcessingState::step 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.
Flat::call (cyclomatic 17) crates/perry-wpfacts/src/decl_units.rs:546— Flat::call 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.
DG-fallback-gap.check_native_calls (cyclomatic 17) scripts/DG-fallback-gap.py:104— DG-fallback-gap.check_native_calls 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.
check_buffer_layout.inventory (cyclomatic 17) scripts/check_buffer_layout.py:36— check_buffer_layout.inventory 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.
check_gc_env_knobs.self_test (cyclomatic 17) scripts/check_gc_env_knobs.py:201— check_gc_env_knobs.self_test 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.
check_npm_publish_freshness.evaluate_package (cyclomatic 17) scripts/check_npm_publish_freshness.py:293— check_npm_publish_freshness.evaluate_package 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.
compiler_output_step_liveness.check_workflow (cyclomatic 17) scripts/compiler_output_step_liveness.py:96— compiler_output_step_liveness.check_workflow 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.
component_host_acceptance.main (cyclomatic 17) scripts/component_host_acceptance.py:20— component_host_acceptance.main has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gc_1090_evidence_report.gc_store_inventory_summary (cyclomatic 17) scripts/gc_1090_evidence_report.py:818— gc_1090_evidence_report.gc_store_inventory_summary 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.
link_absence.witness_options (cyclomatic 17) scripts/link_absence.py:135— link_absence.witness_options has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
measure_readpath3.measure (cyclomatic 17) scripts/measure_readpath3.py:158— measure_readpath3.measure 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.
native_export_collisions.literal_exports (cyclomatic 17) scripts/native_export_collisions.py:138— native_export_collisions.literal_exports 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.
native_handle_ledger.self_test (cyclomatic 17) scripts/native_handle_ledger.py:369— native_handle_ledger.self_test 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.
native_result_ledger.scan_rows (cyclomatic 17) scripts/native_result_ledger.py:186— native_result_ledger.scan_rows 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.
parity_known_failures.validate_entry (cyclomatic 17) scripts/parity_known_failures.py:154— parity_known_failures.validate_entry 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.
perf_tscwall_lane.measure (cyclomatic 17) scripts/perf_tscwall_lane.py:138— perf_tscwall_lane.measure 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.
record_function_order.main (cyclomatic 17) scripts/record_function_order.py:67— record_function_order.main has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sso_unbox_inventory.main (cyclomatic 17) scripts/sso_unbox_inventory.py:583— sso_unbox_inventory.main has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackmap_anatomy.extract_section (cyclomatic 17) scripts/stackmap_anatomy.py:18— stackmap_anatomy.extract_section 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.
wasm_runtime.__classDispatch (cyclomatic 17) crates/perry-codegen-wasm/src/wasm_runtime.js:4896— wasm_runtime.__classDispatch 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.
node_compat_matrix.resolveNode (cyclomatic 17) scripts/node_compat_matrix.mjs:231— node_compat_matrix.resolveNode 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.
pipeline.dispatchPublishWorkflow (cyclomatic 17) scripts/publish/pipeline.mts:249— pipeline.dispatchPublishWorkflow has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
perry_audio_miniaudio::perry_audio_play (cyclomatic 16) crates/perry-audio-miniaudio/src/lib.rs:518— perry_audio_miniaudio::perry_audio_play 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.
GeneralPurpose::decode (cyclomatic 16) crates/perry-base64/src/lib.rs:127— GeneralPurpose::decode 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.
Gzip::read (cyclomatic 16) crates/perry-ext-zlib/src/stream/driver.rs:308— Gzip::read 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.
GraphemeState::width (cyclomatic 16) crates/perry-runtime/src/bun_compat/string_width.rs:421— GraphemeState::width 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.
PathModuleRegistry::require_with (cyclomatic 16) crates/perry-runtime/src/module_require/path_registry.rs:391— PathModuleRegistry::require_with 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.
Api::inventory_with_clock (cyclomatic 16) crates/perry-runtime/src/tls/roots/macos.rs:349— Api::inventory_with_clock 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.
ContentDecoder::next_chunk (cyclomatic 16) crates/perry-stdlib/src/turnloop_client/content_decoding.rs:138— ContentDecoder::next_chunk 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.
gc-currentc170-regression-profile-v23.run (cyclomatic 16) docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:37— gc-currentc170-regression-profile-v23.run 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.
latest-main2026-normal-auto-driver.build_arm (cyclomatic 16) docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:30— latest-main2026-normal-auto-driver.build_arm 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.
verify-gc-paired-instruction-domains-v1.main (cyclomatic 16) docs/audits/gc-rss-instructions-2026-10-03/verify-gc-paired-instruction-domains-v1.py:24— verify-gc-paired-instruction-domains-v1.main 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.
ci_plan.plan (cyclomatic 16) scripts/ci_plan.py:312— ci_plan.plan 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.
analyzers.runtime_counter_summary (cyclomatic 16) scripts/compiler_output_harness/analyzers.py:434— analyzers.runtime_counter_summary 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.
gc_root_dominance_check._seed_sites (cyclomatic 16) scripts/gc_root_dominance_check.py:2641— gc_root_dominance_check._seed_sites 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.
gc_root_dominance_check._constant_based (cyclomatic 16) scripts/gc_root_dominance_check.py:5199— gc_root_dominance_check._constant_based 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.
global_sink_isolation.audit (cyclomatic 16) scripts/global_sink_isolation.py:313— global_sink_isolation.audit 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.
native_abi_evidence_report.packet_record_matches (cyclomatic 16) scripts/native_abi_evidence_report.py:537— native_abi_evidence_report.packet_record_matches 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.
native_abi_evidence_report.material_accounting_rows (cyclomatic 16) scripts/native_abi_evidence_report.py:903— native_abi_evidence_report.material_accounting_rows 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.
perf_frontier_report.main (cyclomatic 16) scripts/perf_frontier_report.py:1038— perf_frontier_report.main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
realm_manifest_coverage.resolve_cell (cyclomatic 16) scripts/realm_manifest_coverage.py:82— realm_manifest_coverage.resolve_cell 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.
string_payload_access_inventory.main (cyclomatic 16) scripts/string_payload_access_inventory.py:425— string_payload_access_inventory.main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
string_validator_inventory.check (cyclomatic 16) scripts/string_validator_inventory.py:34— string_validator_inventory.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.
server_ab.run_load (cyclomatic 16) scripts/turnloop/server_ab.py:697— server_ab.run_load 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.
unrooted_local_shape.scan_function (cyclomatic 16) scripts/unrooted_local_shape.py:292— unrooted_local_shape.scan_function 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.
wpfacts_precision.main (cyclomatic 16) scripts/wpfacts_precision.py:176— wpfacts_precision.main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
web_runtime.hone_editor_render_line (cyclomatic 16) crates/perry-codegen-js/src/web_runtime.js:2313— web_runtime.hone_editor_render_line 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.
update-actions.inspectActionPins (cyclomatic 16) scripts/update-actions.mts:131— update-actions.inspectActionPins 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.
node_compat_matrix.runMatrix (cyclomatic 16) scripts/node_compat_matrix.mjs:458— node_compat_matrix.runMatrix 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.
node_compat_matrix.baselineValidationError (cyclomatic 16) scripts/node_compat_matrix.mjs:658— node_compat_matrix.baselineValidationError 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.
scan.scanTarball (cyclomatic 16) scripts/publish/scan.mts:169— scan.scanTarball 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.
perry_audio_play (cyclomatic 16) crates/perry-codegen-wasm/src/wasm_runtime.js:4392— perry_audio_play 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.
wasm_runtime.buildImports (cognitive 356) crates/perry-codegen-wasm/src/wasm_runtime.js:137— wasm_runtime.buildImports has cognitive complexity 356 (threshold 15). Drivers by points: if/else 157 (190 pts), ternaries 81 (83 pts), boolean chains 65, loops 12 (15 pts), error handling 3 (nesting depth added 38). Most of this is not in the body itself: 3 of the 356 points are its own statements and the rest belongs to 158 function literals inside it that branch (lines 668, 759, 777, …). 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.
Solver.apply (cognitive 190) scripts/wpfacts_recompute.py:311— Solver.apply has cognitive complexity 190 (threshold 15). Drivers by points: if/else 41 (108 pts), loops 29 (59 pts), ternaries 4 (12 pts), boolean chains 11 (nesting depth added 105). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.self_test (cognitive 188) scripts/gc_root_dominance_check.py:6812— gc_root_dominance_check.self_test has cognitive complexity 188 (threshold 15). Drivers by points: if/else 85 (120 pts), loops 29 (35 pts), boolean chains 18, ternaries 6 (12 pts), error handling 2 (3 pts) (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.
package_bench.cmd_run (cognitive 171) scripts/package_bench.py:504— package_bench.cmd_run has cognitive complexity 171 (threshold 15). Drivers by points: if/else 36 (98 pts), loops 16 (49 pts), boolean chains 15, ternaries 4 (9 pts) (nesting depth added 100). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.check_func_unrooted_allocas (cognitive 166) scripts/gc_root_dominance_check.py:3979— gc_root_dominance_check.check_func_unrooted_allocas has cognitive complexity 166 (threshold 15). Drivers by points: if/else 33 (114 pts), loops 18 (34 pts), boolean chains 14, ternaries 1 (4 pts) (nesting depth added 100). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.main (cognitive 162) scripts/gc_root_dominance_check.py:8076— gc_root_dominance_check.main has cognitive complexity 162 (threshold 15). Drivers by points: if/else 53 (85 pts), loops 19 (44 pts), ternaries 5 (17 pts), boolean chains 14, error handling 1 (2 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
measure_linux_rss_ab.main (cognitive 162) scripts/measure_linux_rss_ab.py:160— measure_linux_rss_ab.main has cognitive complexity 162 (threshold 15). Drivers by points: if/else 34 (97 pts), loops 14 (32 pts), ternaries 7 (23 pts), boolean chains 10 (nesting depth added 97). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
constfn_executable_gates.main (cognitive 149) scripts/constfn_executable_gates.py:366— constfn_executable_gates.main has cognitive complexity 149 (threshold 15). Drivers by points: if/else 23 (77 pts), loops 17 (37 pts), ternaries 6 (23 pts), boolean chains 12 (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.
native_export_collisions.source_exports (cognitive 142) scripts/native_export_collisions.py:286— native_export_collisions.source_exports has cognitive complexity 142 (threshold 15). Drivers by points: if/else 24 (78 pts), loops 14 (38 pts), ternaries 3 (14 pts), boolean chains 12 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
check_actions_topology.main (cognitive 139) scripts/check_actions_topology.py:32— check_actions_topology.main has cognitive complexity 139 (threshold 15). Drivers by points: if/else 36 (90 pts), boolean chains 31, loops 10 (18 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
package_bench.cmd_report (cognitive 123) scripts/package_bench.py:925— package_bench.cmd_report has cognitive complexity 123 (threshold 15). Drivers by points: if/else 25 (45 pts), loops 20 (31 pts), boolean chains 25, ternaries 12 (22 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.
Need::compute (cognitive 112) crates/perry-codegen/src/codegen/source_need/flow.rs:1577— Need::compute has cognitive complexity 112 (threshold 15). Drivers by points: loops 28 (57 pts), if/else 15 (45 pts), match/switch 2 (7 pts), boolean chains 3 (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.
actions_plan._matches_event (cognitive 105) scripts/actions_plan.py:88— actions_plan._matches_event has cognitive complexity 105 (threshold 15). Drivers by points: if/else 26 (59 pts), boolean chains 23, ternaries 5 (15 pts), loops 4 (8 pts) (nesting depth added 47). 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.
link_absence.main (cognitive 99) scripts/link_absence.py:369— link_absence.main has cognitive complexity 99 (threshold 15). Drivers by points: if/else 16 (48 pts), ternaries 9 (32 pts), boolean chains 13, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
gc_root_dominance_check.statepoint_self_test (cognitive 97) scripts/gc_root_dominance_check.py:6087— gc_root_dominance_check.statepoint_self_test has cognitive complexity 97 (threshold 15). Drivers by points: if/else 49 (66 pts), loops 11 (12 pts), boolean chains 11, ternaries 2 (6 pts), error handling 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.
gc_root_dominance_check.flag_path_feasible (cognitive 95) scripts/gc_root_dominance_check.py:3871— gc_root_dominance_check.flag_path_feasible has cognitive complexity 95 (threshold 15). Drivers by points: if/else 17 (56 pts), loops 7 (23 pts), ternaries 3 (11 pts), boolean chains 5 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.check_func_stale (cognitive 93) scripts/gc_root_dominance_check.py:3165— gc_root_dominance_check.check_func_stale has cognitive complexity 93 (threshold 15). Drivers by points: if/else 14 (61 pts), loops 11 (28 pts), boolean chains 4 (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.
node_core_subset.main (cognitive 90) scripts/node_core_subset.py:496— node_core_subset.main has cognitive complexity 90 (threshold 15). Drivers by points: if/else 29 (52 pts), ternaries 8 (18 pts), boolean chains 8, error handling 3 (7 pts), loops 4 (5 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.
gc_root_dominance_check.check_func_statepoints (cognitive 89) scripts/gc_root_dominance_check.py:5075— gc_root_dominance_check.check_func_statepoints has cognitive complexity 89 (threshold 15). Drivers by points: if/else 20 (72 pts), loops 6 (13 pts), boolean chains 4 (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.
verification.native_rep_contract_results (cognitive 87) scripts/compiler_output_harness/verification.py:787— verification.native_rep_contract_results has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (51 pts), boolean chains 32, loops 2 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expr::hash (cognitive 85) crates/perry-hir/src/stable_hash/expr.rs:31— Expr::hash has cognitive complexity 85 (threshold 15). Drivers by points: loops 16 (32 pts), if/else 19 (29 pts), match/switch 12 (24 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.
actions_plan.select (cognitive 85) scripts/actions_plan.py:196— actions_plan.select has cognitive complexity 85 (threshold 15). Drivers by points: if/else 29 (56 pts), boolean chains 18, ternaries 3 (9 pts), loops 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Planner::expr (cognitive 83) crates/perry-codegen/src/stmt/region_loop/plan.rs:334— Planner::expr has cognitive complexity 83 (threshold 15). Drivers by points: if/else 21 (61 pts), loops 3 (10 pts), boolean chains 6, match/switch 4 (6 pts) (nesting depth added 49). 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.
GlobalEvalHoist::rewrite_list_inner (cognitive 83) crates/perry-hir/src/lower/global_eval_hoist.rs:740— GlobalEvalHoist::rewrite_list_inner has cognitive complexity 83 (threshold 15). Drivers by points: if/else 19 (57 pts), loops 5 (13 pts), match/switch 3 (10 pts), boolean chains 3 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime_abi_check.parse_codegen (cognitive 83) scripts/runtime_abi_check.py:580— runtime_abi_check.parse_codegen has cognitive complexity 83 (threshold 15). Drivers by points: if/else 12 (35 pts), ternaries 9 (29 pts), loops 8 (15 pts), boolean chains 4 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_runtime_root_holders.scan (cognitive 78) scripts/gc_runtime_root_holders.py:833— gc_runtime_root_holders.scan has cognitive complexity 78 (threshold 15). Drivers by points: loops 17 (37 pts), if/else 12 (33 pts), ternaries 2 (4 pts), boolean chains 2, error handling 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.
rust_dependency_inventory.main (cognitive 77) scripts/rust_dependency_inventory.py:31— rust_dependency_inventory.main has cognitive complexity 77 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 15 (28 pts), boolean chains 11, ternaries 2 (5 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.
check_docs.main (cognitive 76) scripts/check_docs.py:223— check_docs.main has cognitive complexity 76 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 11 (18 pts), boolean chains 4 (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.
perf_frontier_report.collect_report (cognitive 76) scripts/perf_frontier_report.py:828— perf_frontier_report.collect_report has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 13 (33 pts), if/else 14 (31 pts), loops 6 (9 pts), boolean chains 3 (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.
check_gc_scanner_latches.mask_non_code (cognitive 74) scripts/check_gc_scanner_latches.py:47— check_gc_scanner_latches.mask_non_code has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 8 (23 pts), ternaries 2 (6 pts), boolean chains 3 (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.
component_http_guest_acceptance.main (cognitive 73) scripts/component_http_guest_acceptance.py:122— component_http_guest_acceptance.main has cognitive complexity 73 (threshold 15). Drivers by points: if/else 7 (28 pts), ternaries 6 (17 pts), loops 6 (14 pts), boolean chains 10, error handling 1 (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.
wpfacts_corpus.check_one (cognitive 73) scripts/wpfacts_corpus.py:120— wpfacts_corpus.check_one has cognitive complexity 73 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 4 (8 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.main (cognitive 73) upstream/actions/jdx/mr-boxington-action/src/index.ts:330— index.main has cognitive complexity 73 (threshold 15). Drivers by points: if/else 32 (42 pts), ternaries 18 (22 pts), boolean chains 9 (nesting depth added 14). 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.
gc_root_dominance_check.check_func (cognitive 72) scripts/gc_root_dominance_check.py:2294— gc_root_dominance_check.check_func has cognitive complexity 72 (threshold 15). Drivers by points: if/else 18 (49 pts), loops 8 (13 pts), boolean chains 7, ternaries 1 (3 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.
package_bench_attr.run (cognitive 72) scripts/package_bench_attr.py:728— package_bench_attr.run has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (43 pts), loops 7 (13 pts), boolean chains 11, ternaries 2 (5 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.
HoneEditorView.onCreateInputConnection (cognitive 70) android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:123— HoneEditorView.onCreateInputConnection has cognitive complexity 70 (threshold 15). Drivers by points: if/else 35 (62 pts), loops 2 (4 pts), boolean chains 2, 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.
repsel_knob_isolation._verdict (cognitive 70) scripts/compiler_output_harness/repsel_knob_isolation.py:322— repsel_knob_isolation._verdict has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 12 (23 pts), boolean chains 5 (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.
component_http_p3_acceptance.main (cognitive 69) scripts/component_http_p3_acceptance.py:156— component_http_p3_acceptance.main has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 8 (24 pts), if/else 6 (21 pts), loops 10 (15 pts), boolean chains 6, error handling 1 (3 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.
delete_retired_workflow_runs.main (cognitive 69) scripts/delete_retired_workflow_runs.py:46— delete_retired_workflow_runs.main has cognitive complexity 69 (threshold 15). Drivers by points: if/else 21 (49 pts), boolean chains 13, loops 4 (7 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.
verification.verify_artifacts (cognitive 68) scripts/compiler_output_harness/verification.py:1253— verification.verify_artifacts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 22, loops 11 (13 pts), ternaries 4 (5 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.
perf_frontier_report.summarize_gc_trace (cognitive 68) scripts/perf_frontier_report.py:166— perf_frontier_report.summarize_gc_trace has cognitive complexity 68 (threshold 15). Drivers by points: if/else 7 (27 pts), ternaries 11 (27 pts), loops 5 (13 pts), boolean chains 1 (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.
registry_lifetime_check.scan_with_sites (cognitive 68) scripts/registry_lifetime_check.py:300— registry_lifetime_check.scan_with_sites has cognitive complexity 68 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 13 (20 pts), ternaries 3 (9 pts), boolean chains 4 (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.
tokens.parseTokens (cognitive 68) packages/perry-styling/src/tokens.ts:29— tokens.parseTokens has cognitive complexity 68 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 7 (21 pts), boolean chains 6 (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.
Header::read (cognitive 67) crates/perry-ext-zlib/src/stream/driver.rs:162— Header::read has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (47 pts), loops 6 (16 pts), boolean chains 2, 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.
generator.generateTheme (cognitive 67) packages/perry-styling/src/generator.ts:52— generator.generateTheme has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 11 (22 pts), ternaries 3 (10 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_gate_freshness.newest_post_merge_result (cognitive 66) scripts/check_gate_freshness.py:202— check_gate_freshness.newest_post_merge_result has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (53 pts), loops 3 (6 pts), boolean chains 5, error handling 2 (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.
gc_runtime_root_holders.self_test (cognitive 66) scripts/gc_runtime_root_holders.py:1621— gc_runtime_root_holders.self_test has cognitive complexity 66 (threshold 15). Drivers by points: if/else 34 (45 pts), boolean chains 14, loops 4 (6 pts), ternaries 1 (nesting depth added 13). 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.
gc_store_site_inventory.strip_rust_comments (cognitive 66) scripts/gc_store_site_inventory.py:727— gc_store_site_inventory.strip_rust_comments has cognitive complexity 66 (threshold 15). Drivers by points: if/else 10 (37 pts), ternaries 4 (17 pts), loops 3 (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.
server_ab.idle_client (cognitive 66) scripts/turnloop/server_ab.py:1003— server_ab.idle_client has cognitive complexity 66 (threshold 15). Drivers by points: if/else 9 (34 pts), error handling 4 (15 pts), loops 8 (15 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.
copied_minor_fallback_report.run_target_collector_gates (cognitive 65) scripts/copied_minor_fallback_report.py:856— copied_minor_fallback_report.run_target_collector_gates has cognitive complexity 65 (threshold 15). Drivers by points: if/else 26 (58 pts), loops 3 (4 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.
thread_exit_address_globals.check (cognitive 65) scripts/thread_exit_address_globals.py:393— thread_exit_address_globals.check has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (50 pts), boolean chains 8, loops 6 (7 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native_abi_evidence_report.compiler_output_summary (cognitive 59) scripts/native_abi_evidence_report.py:779— native_abi_evidence_report.compiler_output_summary has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 16, ternaries 3, 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.
shape_descriptor_census.assert_authority_surfaces (cognitive 59) scripts/shape_descriptor_census.py:425— shape_descriptor_census.assert_authority_surfaces has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (39 pts), loops 18 (19 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.
string_payload_access_inventory.mask_non_code (cognitive 59) scripts/string_payload_access_inventory.py:62— string_payload_access_inventory.mask_non_code has cognitive complexity 59 (threshold 15). Drivers by points: if/else 23 (57 pts), boolean chains 1, loops 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Prepared::new (cognitive 58) crates/perry-component-host/src/async_values/compose.rs:22— Prepared::new has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 11 (20 pts), boolean chains 4, match/switch 1 (3 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.
gc_root_dominance_check._array_element_loads (cognitive 58) scripts/gc_root_dominance_check.py:3607— gc_root_dominance_check._array_element_loads has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (43 pts), boolean chains 9, loops 4 (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.
realm_manifest_coverage.cell_names (cognitive 58) scripts/realm_manifest_coverage.py:24— realm_manifest_coverage.cell_names has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 7 (12 pts), ternaries 2 (9 pts), boolean chains 6 (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.
NumberAtReadFlow::stmt (cognitive 57) crates/perry-codegen/src/collectors/number_by_construction.rs:350— NumberAtReadFlow::stmt has cognitive complexity 57 (threshold 15). Drivers by points: if/else 26 (48 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wasi_host_qualification.main (cognitive 57) scripts/wasi_host_qualification.py:108— wasi_host_qualification.main has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 12 (30 pts), if/else 6 (13 pts), loops 7 (8 pts), boolean chains 6 (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.
wpfacts_recompute.derive (cognitive 57) scripts/wpfacts_recompute.py:1222— wpfacts_recompute.derive has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 14, loops 4 (7 pts), ternaries 2 (6 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.
gc_1090_evidence_report.gate_copied_minor (cognitive 56) scripts/gc_1090_evidence_report.py:552— gc_1090_evidence_report.gate_copied_minor has cognitive complexity 56 (threshold 15). Drivers by points: if/else 25 (51 pts), loops 2 (3 pts), boolean chains 2 (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.
native_abi_evidence_report.benchmark_deltas (cognitive 56) scripts/native_abi_evidence_report.py:980— native_abi_evidence_report.benchmark_deltas has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (37 pts), boolean chains 12, loops 6, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wpfacts_oracle.main (cognitive 56) scripts/wpfacts_oracle.py:96— wpfacts_oracle.main has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 9 (13 pts), boolean chains 5, error handling 1 (3 pts), ternaries 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.
wpfacts_recompute.site_verdicts (cognitive 56) scripts/wpfacts_recompute.py:1341— wpfacts_recompute.site_verdicts has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 4 (16 pts), boolean chains 8, loops 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.
gc_repsel_matrix_merge.merge (cognitive 54) scripts/gc_repsel_matrix_merge.py:67— gc_repsel_matrix_merge.merge has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (46 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serializer::write_heap_value (cognitive 53) crates/perry-runtime/src/child_process/v8_serde.rs:245— Serializer::write_heap_value has cognitive complexity 53 (threshold 15). Drivers by points: if/else 30 (53 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.
buffer_b1_validate.measure (cognitive 52) scripts/buffer_b1_validate.py:149— buffer_b1_validate.measure has cognitive complexity 52 (threshold 15). Drivers by points: if/else 7 (29 pts), ternaries 7 (12 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.
buffer_b4_validate.measure (cognitive 52) scripts/buffer_b4_validate.py:161— buffer_b4_validate.measure has cognitive complexity 52 (threshold 15). Drivers by points: if/else 7 (29 pts), ternaries 7 (12 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.
gc_1090_evidence_report.render_markdown (cognitive 52) scripts/gc_1090_evidence_report.py:1274— gc_1090_evidence_report.render_markdown has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 9 (18 pts), loops 7 (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.
repsel_census.census_from_report (cognitive 51) scripts/compiler_output_harness/repsel_census.py:425— repsel_census.census_from_report has cognitive complexity 51 (threshold 15). Drivers by points: if/else 25 (42 pts), boolean chains 7, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_1090_evidence_report.old_page_policy_summary (cognitive 51) scripts/gc_1090_evidence_report.py:1031— gc_1090_evidence_report.old_page_policy_summary has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 11 (15 pts), boolean chains 11 (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.
native_result_ledger.scan_rows (cognitive 51) scripts/native_result_ledger.py:186— native_result_ledger.scan_rows has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 4 (11 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.
perf_12015_lane.compare (cognitive 51) scripts/perf_12015_lane.py:114— perf_12015_lane.compare has cognitive complexity 51 (threshold 15). Drivers by points: loops 9 (21 pts), if/else 4 (18 pts), ternaries 4 (12 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_ext_net_socket_open_invariant.mask_non_code (cognitive 49) scripts/check_ext_net_socket_open_invariant.py:29— check_ext_net_socket_open_invariant.mask_non_code has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 3 (7 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.
verification.generic_native_rep_contract_results (cognitive 49) scripts/compiler_output_harness/verification.py:617— verification.generic_native_rep_contract_results has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 22, if/else 16 (21 pts), loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check._tracked_across_statepoint (cognitive 49) scripts/gc_root_dominance_check.py:5251— gc_root_dominance_check._tracked_across_statepoint has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 6 (12 pts), boolean chains 4 (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.
server_ab.markdown (cognitive 49) scripts/turnloop/server_ab.py:1534— server_ab.markdown has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 8, loops 4 (7 pts), ternaries 3 (7 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.
ClassContract::join (cognitive 48) crates/perry-wpfacts/src/units.rs:511— ClassContract::join has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 10 (18 pts), if/else 8 (15 pts), boolean chains 9, loops 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.
native_abi_evidence_report.material_accounting_rows (cognitive 48) scripts/native_abi_evidence_report.py:903— native_abi_evidence_report.material_accounting_rows has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (43 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (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.
sso_unbox_inventory.apply_reviews (cognitive 48) scripts/sso_unbox_inventory.py:311— sso_unbox_inventory.apply_reviews has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 6, error handling 3 (5 pts), loops 3 (4 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.
gc_snapshot_contracts.snapshot_contract_problems (cognitive 47) scripts/gc_snapshot_contracts.py:23— gc_snapshot_contracts.snapshot_contract_problems has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 10, 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.
runtime_abi_check.check_ir (cognitive 47) scripts/runtime_abi_check.py:925— runtime_abi_check.check_ir has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 7 (11 pts), ternaries 3 (9 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.
release.ensureTagAndRelease (cognitive 47) scripts/publish/release.mts:123— release.ensureTagAndRelease has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (32 pts), error handling 3 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buffer_b5_validate.measure (cognitive 46) scripts/buffer_b5_validate.py:18— buffer_b5_validate.measure has cognitive complexity 46 (threshold 15). Drivers by points: if/else 7 (28 pts), ternaries 7 (12 pts), loops 3 (6 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.
check_gc_scanner_latches.scan_source (cognitive 46) scripts/check_gc_scanner_latches.py:160— check_gc_scanner_latches.scan_source has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 6 (13 pts), boolean chains 4 (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.
check_thread_locals.cfg_test_module_files (cognitive 46) scripts/check_thread_locals.py:349— check_thread_locals.cfg_test_module_files has cognitive complexity 46 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 8 (21 pts), ternaries 1 (4 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.
server_ab.run (cognitive 46) scripts/turnloop/server_ab.py:1292— server_ab.run has cognitive complexity 46 (threshold 15). Drivers by points: loops 8 (21 pts), if/else 11 (15 pts), ternaries 2 (5 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 23). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
wpfacts_recompute.load (cognitive 46) scripts/wpfacts_recompute.py:992— wpfacts_recompute.load has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 7 (28 pts), if/else 5 (15 pts), loops 2, boolean chains 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.
Uses::visit_call_expr (cognitive 45) crates/perry/src/commands/compile/cjs_wrap/run_once_syntax.rs:56— Uses::visit_call_expr has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (44 pts), boolean chains 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NativeRepSummary::from_records (cognitive 44) crates/perry-codegen/src/native_value/artifact.rs:372— NativeRepSummary::from_records has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 10, loops 4 (7 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.
analyze-current0ed-native-v17.analyze (cognitive 44) docs/audits/gc-rss-instructions-2026-10-03/analyze-current0ed-native-v17.py:56— analyze-current0ed-native-v17.analyze has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 11, loops 7 (8 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_gate_freshness.self_test (cognitive 44) scripts/check_gate_freshness.py:512— check_gate_freshness.self_test has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24, boolean chains 17, loops 1 (2 pts), ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gate_failure_watch.check_config (cognitive 44) scripts/gate_failure_watch.py:387— gate_failure_watch.check_config has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 8, loops 4 (8 pts), ternaries 1 (3 pts), error handling 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.
gc_gate_wiring_check.check_gate (cognitive 44) scripts/gc_gate_wiring_check.py:220— gc_gate_wiring_check.check_gate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 8, loops 4 (5 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.
wpfacts_corpus.run_corpus (cognitive 44) scripts/wpfacts_corpus.py:211— wpfacts_corpus.run_corpus has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 8 (18 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Solver.call_tok (cognitive 44) scripts/wpfacts_recompute.py:719— Solver.call_tok has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 6 (13 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
server_ab.build (cognitive 43) scripts/turnloop/server_ab.py:224— server_ab.build has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 6, loops 2 (4 pts), ternaries 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.
web_runtime._mapKeyToAction (cognitive 43) crates/perry-codegen-js/src/web_runtime.js:2245— web_runtime._mapKeyToAction has cognitive complexity 43 (threshold 15). Drivers by points: if/else 27, boolean chains 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RealmManifest::validate (cognitive 42) crates/perry-runtime-manifest/src/realm.rs:181— RealmManifest::validate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (8 pts), boolean chains 7, match/switch 2 (4 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.
copied_minor_fallback_report.aggregate_workload (cognitive 42) scripts/copied_minor_fallback_report.py:515— copied_minor_fallback_report.aggregate_workload has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 6 (12 pts), ternaries 2 (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.
gc_root_dominance_check.parse_file (cognitive 42) scripts/gc_root_dominance_check.py:358— gc_root_dominance_check.parse_file has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 2 (7 pts), loops 2, 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.
OutUsageAnalyzer::visit_stmt (cognitive 41) crates/perry-transform/src/deforest/out_usage.rs:22— OutUsageAnalyzer::visit_stmt has cognitive complexity 41 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 10 (18 pts), match/switch 1 (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.
StmtRefWalker::visit_stmt (cognitive 41) crates/perry-transform/src/deforest/walk.rs:214— StmtRefWalker::visit_stmt has cognitive complexity 41 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 10 (18 pts), match/switch 1 (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.
check_js_body_call_funnel.entry_abi_violations (cognitive 41) scripts/check_js_body_call_funnel.py:255— check_js_body_call_funnel.entry_abi_violations has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (21 pts), ternaries 3 (11 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check._sp_seed_sites (cognitive 41) scripts/gc_root_dominance_check.py:5592— gc_root_dominance_check._sp_seed_sites has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (34 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
global_sink_isolation.asserted_globals (cognitive 41) scripts/global_sink_isolation.py:698— global_sink_isolation.asserted_globals has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (23 pts), boolean chains 6, loops 4 (6 pts), ternaries 3 (6 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.
perf_tscwall_lane.measure (cognitive 41) scripts/perf_tscwall_lane.py:138— perf_tscwall_lane.measure has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (13 pts), ternaries 3 (10 pts), boolean chains 3 (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.
wpfacts_recompute.compare (cognitive 41) scripts/wpfacts_recompute.py:1420— wpfacts_recompute.compare has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 4 (12 pts), boolean chains 4, loops 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_http_client::http::exchange (cognitive 40) crates/perry-http-client/src/http.rs:467— perry_http_client::http::exchange has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 2 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubstituteLocal::visit_stmt (cognitive 40) crates/perry-transform/src/deforest/producer_rewrite.rs:94— SubstituteLocal::visit_stmt has cognitive complexity 40 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 9 (17 pts), match/switch 1 (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.
StmtRefAllWalker::visit_stmt (cognitive 40) crates/perry-transform/src/deforest/scan.rs:342— StmtRefAllWalker::visit_stmt has cognitive complexity 40 (threshold 15). Drivers by points: loops 9 (22 pts), if/else 9 (17 pts), match/switch 1 (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.
check_node_version_consistency.check (cognitive 40) scripts/check_node_version_consistency.py:233— check_node_version_consistency.check has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 6 (8 pts), error handling 1 (2 pts), ternaries 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.
runtime_abi_check.expand_signature_macros (cognitive 40) scripts/runtime_abi_check.py:420— runtime_abi_check.expand_signature_macros has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 7 (13 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
test262_subset.discover (cognitive 40) scripts/test262_subset.py:279— test262_subset.discover has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (31 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
primary-map-prefix-main07-v69r2-auto.build_arm (cognitive 39) docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:53— primary-map-prefix-main07-v69r2-auto.build_arm has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (12 pts), boolean chains 9, ternaries 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.
check_buffer_layout.inventory (cognitive 39) scripts/check_buffer_layout.py:36— check_buffer_layout.inventory has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
measure_readpath3.measure (cognitive 39) scripts/measure_readpath3.py:158— measure_readpath3.measure has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (10 pts), ternaries 5 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native_export_collisions.cfg_without_tests (cognitive 39) scripts/native_export_collisions.py:67— native_export_collisions.cfg_without_tests has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 5 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceIndex.sourcemap (cognitive 39) scripts/package_bench_attr.py:357— SourceIndex.sourcemap has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (6 pts), ternaries 2 (6 pts), boolean chains 4, error handling 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.
perf_readpath3.main (cognitive 39) scripts/perf_readpath3.py:21— perf_readpath3.main has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 7 (9 pts), ternaries 5 (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.
runtime_abi_check.strip_comments (cognitive 39) scripts/runtime_abi_check.py:170— runtime_abi_check.strip_comments has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 6 (12 pts), loops 3 (7 pts), boolean chains 6 (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.
wpfacts_precision.census (cognitive 39) scripts/wpfacts_precision.py:44— wpfacts_precision.census has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (7 pts), boolean chains 5, ternaries 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wpfacts_recompute.resolve_method (cognitive 39) scripts/wpfacts_recompute.py:1388— wpfacts_recompute.resolve_method has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
color.namedColor (cognitive 39) packages/perry-styling/src/color.ts:155— color.namedColor has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, 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.
shape-storage-observer-v17.observe_shapes (cognitive 38) docs/audits/gc-rss-instructions-2026-10-03/shape-storage-observer-v17.py:7— shape-storage-observer-v17.observe_shapes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 5 (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.
component_http_p3_acceptance.client (cognitive 38) scripts/component_http_p3_acceptance.py:19— component_http_p3_acceptance.client has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 3 (7 pts), error handling 2, ternaries 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.runtime_symbol_bodies (cognitive 38) scripts/gc_root_dominance_check.py:1375— gc_root_dominance_check.runtime_symbol_bodies has cognitive complexity 38 (threshold 15). Drivers by points: loops 9 (26 pts), if/else 4 (12 pts) (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.
native_export_collisions.production_tokens (cognitive 38) scripts/native_export_collisions.py:93— native_export_collisions.production_tokens has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (31 pts), loops 2 (5 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.
runtime_rss_ab.main (cognitive 38) scripts/runtime_rss_ab.py:38— runtime_rss_ab.main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 7 (12 pts), ternaries 4 (9 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
color.parseColor (cognitive 38) packages/perry-styling/src/color.ts:26— color.parseColor has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (32 pts), ternaries 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_http_server::conn::drain (cognitive 37) crates/perry-http-server/src/conn.rs:317— perry_http_server::conn::drain has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FullWeakProcessingState::step (cognitive 37) crates/perry-runtime/src/weakref/sliced.rs:182— FullWeakProcessingState::step has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (33 pts), match/switch 1 (2 pts), boolean chains 1, 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.
check_ext_net_socket_open_invariant.evaluate (cognitive 37) scripts/check_ext_net_socket_open_invariant.py:128— check_ext_net_socket_open_invariant.evaluate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 6 (9 pts), boolean chains 2, ternaries 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.
global_sink_isolation.self_test (cognitive 37) scripts/global_sink_isolation.py:484— global_sink_isolation.self_test has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23 (26 pts), loops 4, boolean chains 3, error handling 2 (3 pts), 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.
raw_handle_debt.self_test (cognitive 37) scripts/raw_handle_debt.py:340— raw_handle_debt.self_test has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (24 pts), loops 6, boolean chains 4, error handling 2 (3 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.
stackmap_anatomy.extract_section (cognitive 37) scripts/stackmap_anatomy.py:18— stackmap_anatomy.extract_section has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (10 pts), boolean chains 5 (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.
test262_subset.main (cognitive 37) scripts/test262_subset.py:393— test262_subset.main has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 5 (7 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turnloop_p0_loop_stats.main (cognitive 37) scripts/turnloop_p0_loop_stats.py:54— turnloop_p0_loop_stats.main has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 3 (4 pts), loops 3, 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.
primary-entry-once-main07-v46-auto.build_arm (cognitive 36) docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:44— primary-entry-once-main07-v46-auto.build_arm has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (10 pts), boolean chains 9 (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.
primary-lazy-rss-main07-v52-auto.build_arm (cognitive 36) docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:44— primary-lazy-rss-main07-v52-auto.build_arm has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (10 pts), boolean chains 9 (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.
primary-learned-floor-main07-v60-auto.build_arm (cognitive 36) docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:43— primary-learned-floor-main07-v60-auto.build_arm has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (10 pts), boolean chains 9 (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.
primary-map-prefix-main07-v69-auto.build_arm (cognitive 36) docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:43— primary-map-prefix-main07-v69-auto.build_arm has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (10 pts), boolean chains 9 (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.
primary-map-prefix-main07-v69r1-auto.build_arm (cognitive 36) docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:43— primary-map-prefix-main07-v69r1-auto.build_arm has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (10 pts), boolean chains 9 (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.
gc_store_site_inventory.codegen_stem_census (cognitive 36) scripts/gc_store_site_inventory.py:905— gc_store_site_inventory.codegen_stem_census has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 3 (6 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.
local_binding_type_audit.strip_rust_comments (cognitive 36) scripts/local_binding_type_audit.py:117— local_binding_type_audit.strip_rust_comments has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 10, ternaries 2 (5 pts), loops 2 (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.
parity_report_merge.merge (cognitive 36) scripts/parity_report_merge.py:63— parity_report_merge.merge has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 7 (12 pts), boolean chains 4 (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.
perf_schemadec_lane.class_micros (cognitive 36) scripts/perf_schemadec_lane.py:62— perf_schemadec_lane.class_micros has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (17 pts), ternaries 3 (11 pts), if/else 2 (8 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.
runtime_abi_check.self_test (cognitive 36) scripts/runtime_abi_check.py:1001— runtime_abi_check.self_test has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 6 (7 pts), boolean chains 5, error handling 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.
update-actions.inspectActionPins (cognitive 36) scripts/update-actions.mts:131— update-actions.inspectActionPins has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 3 (7 pts), boolean chains 1, 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.
gate_failure_watch.subject_verdict (cognitive 35) scripts/gate_failure_watch.py:107— gate_failure_watch.subject_verdict has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 6 (12 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.
objects-cache.measureTree (cognitive 35) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:193— objects-cache.measureTree has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
objects-cache.canonicalExistingDirectory (cognitive 35) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:374— objects-cache.canonicalExistingDirectory has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (28 pts), error handling 1 (5 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
index.post (cognitive 35) upstream/actions/jdx/mr-boxington-action/src/index.ts:593— index.post has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 11). Of this number, 24 points are the body's own statements and 11 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.
Resolve::visit_mut_expr (cognitive 34) crates/perry/src/commands/compile/collect_modules/import_meta_resolve.rs:53— Resolve::visit_mut_expr has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (31 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.
Fns::collect (cognitive 34) crates/perry-codegen/src/collectors/read_before_write.rs:95— Fns::collect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 5 (8 pts), match/switch 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.
ProgramLayoutOrdinals::assign (cognitive 34) crates/perry-codegen/src/layout_ordinals.rs:55— ProgramLayoutOrdinals::assign has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5, 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.
Gzip::read (cognitive 34) crates/perry-ext-zlib/src/stream/driver.rs:308— Gzip::read has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Substitute::visit_mut_expr (cognitive 34) crates/perry-parser/src/defines.rs:125— Substitute::visit_mut_expr has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutableRegisteredRootScanState::step (cognitive 34) crates/perry-runtime/src/gc/cycle/registered_root_scan.rs:44— MutableRegisteredRootScanState::step has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 4 (8 pts), boolean chains 6, loops 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.
check_thread_locals.self_test (cognitive 34) scripts/check_thread_locals.py:526— check_thread_locals.self_test has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (29 pts), loops 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
capture.capture (cognitive 34) scripts/compiler_output_harness/capture.py:234— capture.capture has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 7, ternaries 5 (6 pts), 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.
gc_gate_wiring_check.main (cognitive 34) scripts/gc_gate_wiring_check.py:605— gc_gate_wiring_check.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (6 pts), boolean chains 2, error handling 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.
gc_store_site_inventory.classify_rust_store (cognitive 34) scripts/gc_store_site_inventory.py:396— gc_store_site_inventory.classify_rust_store has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 8 (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.
gen_parity_gaps.covered (cognitive 34) scripts/gen_parity_gaps.py:189— gen_parity_gaps.covered has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 11, loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Disposal::visit (cognitive 33) crates/perry-component-host/src/async_values/reader_dispose.rs:28— Disposal::visit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (6 pts), match/switch 3 (5 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.
DriverClient::submit (cognitive 33) crates/perry-component-host/src/driver/requests.rs:441— DriverClient::submit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 2 (6 pts), match/switch 1 (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.
gc-currentc170-regression-profile-v23.run (cognitive 33) docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:37— gc-currentc170-regression-profile-v23.run has cognitive complexity 33 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (8 pts), ternaries 3 (8 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.run_statepoints (cognitive 33) scripts/gc_root_dominance_check.py:5456— gc_root_dominance_check.run_statepoints has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 7 (10 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shape_descriptor_census._rust_without_comments_and_literals (cognitive 33) scripts/shape_descriptor_census.py:45— shape_descriptor_census._rust_without_comments_and_literals has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 4 (15 pts), if/else 7 (13 pts), loops 2 (4 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.
server_ab.summarize (cognitive 33) scripts/turnloop/server_ab.py:1463— server_ab.summarize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (11 pts), ternaries 2 (7 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wasi_run.main (cognitive 33) scripts/wasi_run.py:120— wasi_run.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 5 (6 pts), boolean chains 4, 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.
Solver.accessor_hit (cognitive 33) scripts/wpfacts_recompute.py:643— Solver.accessor_hit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (10 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.
node_compat_matrix.parseArgs (cognitive 33) scripts/node_compat_matrix.mjs:118— node_compat_matrix.parseArgs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (9 pts), boolean chains 4 (nesting depth added 12). Of this number, 32 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.
objects-cache.withObjectsResourceSampler (cognitive 33) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:601— objects-cache.withObjectsResourceSampler has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (24 pts), error handling 4 (5 pts), loops 2, ternaries 2 (nesting depth added 9). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 647, recordSampleFailure, sample, …). 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.
ProvenanceJudge::walk_stmts (cognitive 32) crates/perry-codegen/src/collectors/integer_locals.rs:595— ProvenanceJudge::walk_stmts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (4 pts), boolean chains 2, 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.
gc-paired-instruction-domains-v1.run (cognitive 32) docs/audits/gc-rss-instructions-2026-10-03/gc-paired-instruction-domains-v1.py:38— gc-paired-instruction-domains-v1.run has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 3 (9 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
repsel_census.self_test (cognitive 32) scripts/compiler_output_harness/repsel_census.py:1362— repsel_census.self_test has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (7 pts), error handling 4 (6 pts), boolean chains 4, 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.
gc_root_dominance_check.must_active_slots (cognitive 32) scripts/gc_root_dominance_check.py:2185— gc_root_dominance_check.must_active_slots has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (11 pts), ternaries 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_runtime_root_holders.inventory_problems (cognitive 32) scripts/gc_runtime_root_holders.py:1151— gc_runtime_root_holders.inventory_problems has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 7, 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.
native_export_collisions.literal_exports (cognitive 32) scripts/native_export_collisions.py:138— native_export_collisions.literal_exports has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 2 (6 pts), boolean chains 3, 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.
schemadec_micros.main (cognitive 32) scripts/schemadec_micros.py:14— schemadec_micros.main has cognitive complexity 32 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 4 (9 pts), ternaries 2 (6 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.
sso_unbox_inventory.string_param_table (cognitive 32) scripts/sso_unbox_inventory.py:183— sso_unbox_inventory.string_param_table has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 4 (10 pts), ternaries 1 (2 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.
statepoint_report_assert.main (cognitive 32) scripts/statepoint_report_assert.py:57— statepoint_report_assert.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (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.
tokio_inventory.self_test (cognitive 32) scripts/tokio_inventory.py:361— tokio_inventory.self_test has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, boolean chains 2, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Names::stmts (cognitive 31) crates/perry-codegen/src/codegen/tdz_names.rs:62— Names::stmts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 3 (7 pts), 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.
ContentDecoder::next_chunk (cognitive 31) crates/perry-stdlib/src/turnloop_client/content_decoding.rs:138— ContentDecoder::next_chunk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 5, match/switch 1 (4 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.
DG-fallback-gap.check_native_calls (cognitive 31) scripts/DG-fallback-gap.py:104— DG-fallback-gap.check_native_calls has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 7 (14 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.
verification._record_matches_required (cognitive 31) scripts/compiler_output_harness/verification.py:540— verification._record_matches_required has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 13, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_runtime_root_holders.crate_type_index (cognitive 31) scripts/gc_runtime_root_holders.py:700— gc_runtime_root_holders.crate_type_index has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Analyzer::stmt (cognitive 30) crates/perry-codegen/src/scope_env/analysis.rs:142— Analyzer::stmt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (6 pts), 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.
RememberedSetClearState::step_counted (cognitive 30) crates/perry-runtime/src/gc/barrier/maintenance.rs:41— RememberedSetClearState::step_counted has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonSourceParser::parse_string_token (cognitive 30) crates/perry-runtime/src/json/reviver.rs:215— JsonSourceParser::parse_string_token has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (23 pts), match/switch 2 (5 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.
W::stmt (cognitive 30) crates/perry-wpfacts/src/ctor_phase.rs:148— W::stmt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 8, match/switch 2 (3 pts), loops 1 (2 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.
FnContract::join (cognitive 30) crates/perry-wpfacts/src/units.rs:386— FnContract::join has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 6 (10 pts), match/switch 4 (9 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.
addr_class_inventory.main (cognitive 30) scripts/addr_class_inventory.py:743— addr_class_inventory.main has cognitive complexity 30 (threshold 15). Drivers by points: loops 9 (18 pts), if/else 10 (12 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.
check_js_body_call_funnel.definition_violations (cognitive 30) scripts/check_js_body_call_funnel.py:185— check_js_body_call_funnel.definition_violations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
class_id_collisions.main (cognitive 30) scripts/class_id_collisions.py:103— class_id_collisions.main has cognitive complexity 30 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 8 (9 pts), ternaries 1 (2 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.
package_bench_attr.write_markdown (cognitive 30) scripts/package_bench_attr.py:956— package_bench_attr.write_markdown has cognitive complexity 30 (threshold 15). Drivers by points: loops 10 (11 pts), boolean chains 9, if/else 4 (6 pts), ternaries 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.
stackmap_anatomy.compact_size (cognitive 30) scripts/stackmap_anatomy.py:151— stackmap_anatomy.compact_size has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 5 (10 pts), ternaries 1 (4 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.
web_runtime.perry_ui_menubar_attach (cognitive 30) crates/perry-codegen-js/src/web_runtime.js:1638— web_runtime.perry_ui_menubar_attach has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 2, boolean chains 1 (nesting depth added 12). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 8 function items inside it that branch (renderMenuItems, a function literal at line 1712, dismissAll, …). 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.
Contracts::lookup (cognitive 29) crates/perry/src/commands/compile/collect_modules/reexport_prune/side_effects.rs:22— Contracts::lookup has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 1 (3 pts), boolean chains 2, loops 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.
SourcePrefetch::work (cognitive 29) crates/perry/src/commands/compile/collect_modules/source_prep.rs:797— SourcePrefetch::work has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoopFacts::walk_expr (cognitive 29) crates/perry-codegen/src/stmt/number_local_loop.rs:162— LoopFacts::walk_expr has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 1 (2 pts), 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.
Driver::new (cognitive 29) crates/perry-component-io/src/lib.rs:108— Driver::new has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 4 (8 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.
gc_root_dominance_check.loop_carried_blocks (cognitive 29) scripts/gc_root_dominance_check.py:2138— gc_root_dominance_check.loop_carried_blocks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4 (6 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.
native_export_collisions.positional_literal_params (cognitive 29) scripts/native_export_collisions.py:238— native_export_collisions.positional_literal_params has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 4, loops 2 (4 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.
node_suite_regression_check.main (cognitive 29) scripts/node_suite_regression_check.py:32— node_suite_regression_check.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (8 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.
package_bench_attr.cmd_floor (cognitive 29) scripts/package_bench_attr.py:1059— package_bench_attr.cmd_floor has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (7 pts), ternaries 3 (7 pts), boolean chains 6 (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.
perf_tscwall_lane.run (cognitive 29) scripts/perf_tscwall_lane.py:46— perf_tscwall_lane.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 4 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
realm_manifest_coverage.resolve_cell (cognitive 29) scripts/realm_manifest_coverage.py:82— realm_manifest_coverage.resolve_cell has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unrooted_local_shape.main (cognitive 29) scripts/unrooted_local_shape.py:885— unrooted_local_shape.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5 (10 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.
wpfacts_recompute.run (cognitive 29) scripts/wpfacts_recompute.py:1072— wpfacts_recompute.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2 (6 pts), 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.
web_runtime._perryCodeToKey (cognitive 29) crates/perry-codegen-js/src/web_runtime.js:1831— web_runtime._perryCodeToKey has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 9, match/switch 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.
wasm_runtime.__perryCodeToKey (cognitive 29) crates/perry-codegen-wasm/src/wasm_runtime.js:3652— wasm_runtime.__perryCodeToKey has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 9, match/switch 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.
wasm_runtime.perry_audio_stop (cognitive 29) crates/perry-codegen-wasm/src/wasm_runtime.js:4440— wasm_runtime.perry_audio_stop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (6 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 11). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 2 function items inside it that branch (stopOne, a function literal at line 4454). 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.
binding_pins.checkOffline (cognitive 29) scripts/binding_pins.mjs:252— binding_pins.checkOffline has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, 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.
node_compat_matrix.checkAgainstBaseline (cognitive 29) scripts/node_compat_matrix.mjs:682— node_compat_matrix.checkAgainstBaseline has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (5 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.
RootScanCycleState::step_current_subphase (cognitive 28) crates/perry-runtime/src/gc/cycle.rs:366— RootScanCycleState::step_current_subphase has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
primary-mainad0-v79-auto.build_arm (cognitive 28) docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-v79-auto.py:38— primary-mainad0-v79-auto.build_arm has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 pts), boolean chains 6, ternaries 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.
gc_rekeyed_key_tables.check (cognitive 28) scripts/gc_rekeyed_key_tables.py:214— gc_rekeyed_key_tables.check has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 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.
gc_store_site_inventory.check_codegen_claims (cognitive 28) scripts/gc_store_site_inventory.py:995— gc_store_site_inventory.check_codegen_claims has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 6 (7 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.
package_bench.lock_acquire (cognitive 28) scripts/package_bench.py:214— package_bench.lock_acquire has cognitive complexity 28 (threshold 15). Drivers by points: error handling 4 (13 pts), if/else 4 (12 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
raw_handle_debt.main (cognitive 28) scripts/raw_handle_debt.py:552— raw_handle_debt.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3 (6 pts), ternaries 2 (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.
report_gc_ratchet.report (cognitive 28) scripts/report_gc_ratchet.py:76— report_gc_ratchet.report has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, ternaries 3, 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, 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.
runtime_abi_check.expand_macros (cognitive 28) scripts/runtime_abi_check.py:376— runtime_abi_check.expand_macros has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (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.
tokio_inventory.main (cognitive 28) scripts/tokio_inventory.py:548— tokio_inventory.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 4 (10 pts), boolean chains 4, ternaries 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
unrooted_local_shape.scan_function (cognitive 28) scripts/unrooted_local_shape.py:292— unrooted_local_shape.scan_function has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), ternaries 2 (4 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.
SlotIter::next (cognitive 27) crates/perry-runtime/src/gc/roots/stack_maps_lazy.rs:215— SlotIter::next has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc-current0ed-instruction-profile-v21.run (cognitive 27) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:37— gc-current0ed-instruction-profile-v21.run has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (8 pts), boolean chains 4, ternaries 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.
gc-final-instruction-profile.run (cognitive 27) docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:37— gc-final-instruction-profile.run has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (8 pts), boolean chains 4, ternaries 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.
i18n_extract_todo.main (cognitive 27) docs/scripts/i18n_extract_todo.py:28— i18n_extract_todo.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (7 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.
capture_linux_incident.main (cognitive 27) scripts/capture_linux_incident.py:117— capture_linux_incident.main has cognitive complexity 27 (threshold 15). Drivers by points: error handling 7 (11 pts), if/else 9 (10 pts), boolean chains 4, 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.
_CfgParser._expr (cognitive 27) scripts/check_thread_locals.py:196— _CfgParser._expr has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 8, loops 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.
repsel_census.census (cognitive 27) scripts/compiler_output_harness/repsel_census.py:1213— repsel_census.census has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (10 pts), loops 6 (8 pts), if/else 6 (7 pts), boolean chains 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.
constfn_executable_gates.guarded_fast_body (cognitive 27) scripts/constfn_executable_gates.py:202— constfn_executable_gates.guarded_fast_body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (8 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.between_blocks (cognitive 27) scripts/gc_root_dominance_check.py:2047— gc_root_dominance_check.between_blocks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (6 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.
gc_root_dominance_check._seed_sites (cognitive 27) scripts/gc_root_dominance_check.py:2641— gc_root_dominance_check._seed_sites has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, 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.
global_sink_isolation.audit (cognitive 27) scripts/global_sink_isolation.py:313— global_sink_isolation.audit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perf_frontier_report.classify_row (cognitive 27) scripts/perf_frontier_report.py:633— perf_frontier_report.classify_row has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 10, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
subsystem_slots.main (cognitive 27) scripts/subsystem_slots.py:43— subsystem_slots.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 7 (11 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConstructorContracts::record (cognitive 26) crates/perry-codegen/src/codegen/constructor_contracts.rs:33— ConstructorContracts::record has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (8 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.
LlInst::render_into (cognitive 26) crates/perry-codegen/src/inst.rs:197— LlInst::render_into has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (5 pts), loops 1 (2 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.
perry_codegen_swiftui::emit::emit_node (cognitive 26) crates/perry-codegen-swiftui/src/emit.rs:840— perry_codegen_swiftui::emit::emit_node has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (5 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Checker::interfaces (cognitive 26) crates/perry-component-host/src/contract.rs:48— Checker::interfaces has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BirthWriteSite::write (cognitive 26) crates/perry-runtime/src/node_stream_constructors/birth.rs:86— BirthWriteSite::write has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 2 (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.
ci_plan.table (cognitive 26) scripts/ci_plan.py:388— ci_plan.table has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 2 (7 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.
gate_failure_watch.self_test (cognitive 26) scripts/gate_failure_watch.py:458— gate_failure_watch.self_test has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
gc_1090_evidence_report.benchmark_matrix (cognitive 26) scripts/gc_1090_evidence_report.py:177— gc_1090_evidence_report.benchmark_matrix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 3 (4 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.
gc_1090_evidence_report.perf_frontier_summary (cognitive 26) scripts/gc_1090_evidence_report.py:777— gc_1090_evidence_report.perf_frontier_summary has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 8, boolean chains 5, 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.
gc_root_dominance_check.seeded_violation_test (cognitive 26) scripts/gc_root_dominance_check.py:2703— gc_root_dominance_check.seeded_violation_test has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (5 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (gc_root_dominance_check.seeded_statepoint_test) 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.
gc_root_dominance_check.run_stale (cognitive 26) scripts/gc_root_dominance_check.py:3330— gc_root_dominance_check.run_stale has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 5 (8 pts), ternaries 2 (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.
gc_root_dominance_check.seeded_statepoint_test (cognitive 26) scripts/gc_root_dominance_check.py:5656— gc_root_dominance_check.seeded_statepoint_test has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (5 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (gc_root_dominance_check.seeded_violation_test) 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.
native_export_collisions.repeated_head_layout (cognitive 26) scripts/native_export_collisions.py:176— native_export_collisions.repeated_head_layout has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
package_bench_attr.classify (cognitive 26) scripts/package_bench_attr.py:200— package_bench_attr.classify has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4 (5 pts), boolean chains 4, 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.
perf_frontier_report.main (cognitive 26) scripts/perf_frontier_report.py:1038— perf_frontier_report.main has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 6 (8 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.
server_ab.run_load (cognitive 26) scripts/turnloop/server_ab.py:697— server_ab.run_load has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (3 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.
wasi_imports_check.module_imports (cognitive 26) scripts/wasi_imports_check.py:124— wasi_imports_check.module_imports has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (7 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.
wpfacts_precision.main (cognitive 26) scripts/wpfacts_precision.py:176— wpfacts_precision.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4, ternaries 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.
web_runtime._renderTokenizedLine (cognitive 26) crates/perry-codegen-js/src/web_runtime.js:2642— web_runtime._renderTokenizedLine has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, ternaries 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.
index.html.renderDetail (cognitive 26) crates/perry-ui-geisterhand/src/inspector_ui/index.html:367— index.html.renderDetail has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (apply, a function literal at line 411). 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.
renderer.createNativeRenderer.insertNode (cognitive 26) packages/perry-solid/src/renderer.ts:100— renderer.createNativeRenderer.insertNode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pipeline.main (cognitive 26) scripts/publish/pipeline.mts:449— pipeline.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 2 (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.
platform-visibility.waitForPlatforms (cognitive 26) scripts/publish/platform-visibility.mjs:20— platform-visibility.waitForPlatforms has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, error handling 1 (3 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.
__classDispatch (cognitive 26) crates/perry-codegen-wasm/src/wasm_runtime.js:4896— __classDispatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, loops 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.
perry_ext_parcel_watcher::js_parcel_watcher_process_pending (cognitive 25) crates/perry-ext-parcel-watcher/src/lib.rs:591— perry_ext_parcel_watcher::js_parcel_watcher_process_pending has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (8 pts), loops 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.
Remap::stmt (cognitive 25) crates/perry-hir/src/lexical_frames.rs:335— Remap::stmt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CensusWalker::stmt (cognitive 25) crates/perry-hir/src/lower/shared_mutable_capture.rs:482— CensusWalker::stmt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 1 (2 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.
DirtyHeaderSlotScan::step (cognitive 25) crates/perry-runtime/src/gc/barrier/remembered_mark.rs:99— DirtyHeaderSlotScan::step has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 2, 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.
perry_ui::bin::styling-matrix::cmd_gen (cognitive 25) crates/perry-ui/src/bin/styling-matrix.rs:82— perry_ui::bin::styling-matrix::cmd_gen has cognitive complexity 25 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (7 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
perry_wit::typescript::generate (cognitive 25) crates/perry-wit/src/typescript.rs:266— perry_wit::typescript::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.
native-sites-observer-v17.capture_native_pages (cognitive 25) docs/audits/gc-rss-instructions-2026-10-03/native-sites-observer-v17.py:29— native-sites-observer-v17.capture_native_pages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), ternaries 1 (2 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.
copied_minor_fallback_report.run_strict_fallback_evidence_gates (cognitive 25) scripts/copied_minor_fallback_report.py:796— copied_minor_fallback_report.run_strict_fallback_evidence_gates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 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.
gc_root_dominance_check.statepoint_corpus_stats (cognitive 25) scripts/gc_root_dominance_check.py:5427— gc_root_dominance_check.statepoint_corpus_stats 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.
gc_runtime_root_holders.report (cognitive 25) scripts/gc_runtime_root_holders.py:1252— gc_runtime_root_holders.report has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 5 (10 pts), boolean chains 2 (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.
global_sink_isolation.declaration_kind (cognitive 25) scripts/global_sink_isolation.py:260— global_sink_isolation.declaration_kind has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (5 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.
native_abi_evidence_report.explain_lowering_accounting (cognitive 25) scripts/native_abi_evidence_report.py:606— native_abi_evidence_report.explain_lowering_accounting has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, 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.
SourceIndex.locate (cognitive 25) scripts/package_bench_attr.py:322— SourceIndex.locate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (4 pts), loops 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.
package_bench_attr.aggregate (cognitive 25) scripts/package_bench_attr.py:518— package_bench_attr.aggregate has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 2 (5 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hone_editor_render_line (cognitive 25) crates/perry-codegen-js/src/web_runtime.js:2313— hone_editor_render_line has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 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.
SocketOwner::raw_option (cognitive 24) crates/perry-component-host/src/sync_wasi/sockets.rs:218— SocketOwner::raw_option has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 4 (8 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.
RememberedSetRootMarkState::step (cognitive 24) crates/perry-runtime/src/gc/barrier/remembered_mark.rs:329— RememberedSetRootMarkState::step has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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.
latest-main2026-normal-auto-driver.build_arm (cognitive 24) docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:30— latest-main2026-normal-auto-driver.build_arm has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
summarize-gc-comparison.summarize (cognitive 24) docs/audits/gc-rss-instructions-2026-10-03/summarize-gc-comparison.py:87— summarize-gc-comparison.summarize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (8 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
i18n_merge_translations.main (cognitive 24) docs/scripts/i18n_merge_translations.py:40— i18n_merge_translations.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (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.
check_npm_publish_freshness.self_test (cognitive 24) scripts/check_npm_publish_freshness.py:557— check_npm_publish_freshness.self_test has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 3 (4 pts), boolean chains 2, 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.
analyzers._selector_matches (cognitive 24) scripts/compiler_output_harness/analyzers.py:356— analyzers._selector_matches has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (10 pts), loops 2 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
component_host_acceptance.main (cognitive 24) scripts/component_host_acceptance.py:20— component_host_acceptance.main has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (11 pts), ternaries 6 (8 pts), if/else 4 (5 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
gc_1090_evidence_report.perf_summary (cognitive 24) scripts/gc_1090_evidence_report.py:752— gc_1090_evidence_report.perf_summary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (5 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.
gc_rekeyed_key_tables.collect_sites (cognitive 24) scripts/gc_rekeyed_key_tables.py:159— gc_rekeyed_key_tables.collect_sites has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.phi_replacing_edges (cognitive 24) scripts/gc_root_dominance_check.py:2087— gc_root_dominance_check.phi_replacing_edges has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (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.
gc_root_dominance_check.local_flag_cells (cognitive 24) scripts/gc_root_dominance_check.py:3841— gc_root_dominance_check.local_flag_cells has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (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.
package_bench_attr.analyze (cognitive 24) scripts/package_bench_attr.py:625— package_bench_attr.analyze has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9, ternaries 5 (7 pts), boolean chains 5, loops 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.
parity_normalize.normalize_parity_output (cognitive 24) scripts/parity_normalize.py:173— parity_normalize.normalize_parity_output has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 3, 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.
sso_unbox_inventory.scan_codegen (cognitive 24) scripts/sso_unbox_inventory.py:215— sso_unbox_inventory.scan_codegen has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sso_unbox_inventory.main (cognitive 24) scripts/sso_unbox_inventory.py:583— sso_unbox_inventory.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 5 (10 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.
thread_exit_address_globals.scan (cognitive 24) scripts/thread_exit_address_globals.py:222— thread_exit_address_globals.scan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (7 pts), ternaries 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.
tls_budget_check.parse_report (cognitive 24) scripts/tls_budget_check.py:66— tls_budget_check.parse_report has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokio_inventory.wasi_fixture_problems (cognitive 24) scripts/tokio_inventory.py:280— tokio_inventory.wasi_fixture_problems has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 2 (7 pts), boolean chains 2 (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.
Solver.store_into (cognitive 24) scripts/wpfacts_recompute.py:674— Solver.store_into has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, 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.
external-tools.checkPins (cognitive 24) scripts/soak/external-tools.mts:99— external-tools.checkPins has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
perry_audio_play (cognitive 24) crates/perry-codegen-wasm/src/wasm_runtime.js:4392— perry_audio_play has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (6 pts), boolean chains 4, ternaries 2 (nesting depth added 8). Of this number, 20 points are the body's own statements and 4 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.
AgentTimers::sift_down (cognitive 23) crates/perry-runtime/src/timer/store.rs:341— AgentTimers::sift_down has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), 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.
Flat::call (cognitive 23) crates/perry-wpfacts/src/decl_units.rs:546— Flat::call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 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.
check_statepoint_linear_size.main (cognitive 23) scripts/check_statepoint_linear_size.py:25— check_statepoint_linear_size.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
capture._native_rep_artifact_paths (cognitive 23) scripts/compiler_output_harness/capture.py:605— capture._native_rep_artifact_paths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), ternaries 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check._macro_defined_symbols (cognitive 23) scripts/gc_root_dominance_check.py:801— gc_root_dominance_check._macro_defined_symbols has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.dominators (cognitive 23) scripts/gc_root_dominance_check.py:1982— gc_root_dominance_check.dominators has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), ternaries 1 (4 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.
gc_root_dominance_check.native_heap_source_kind (cognitive 23) scripts/gc_root_dominance_check.py:4830— gc_root_dominance_check.native_heap_source_kind has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_store_site_inventory.run_self_tests (cognitive 23) scripts/gc_store_site_inventory.py:1239— gc_store_site_inventory.run_self_tests has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 9 (10 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
global_sink_isolation.check_asserted (cognitive 23) scripts/global_sink_isolation.py:809— global_sink_isolation.check_asserted has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (7 pts), ternaries 1 (2 pts), boolean chains 1, error handling 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.
string_payload_access_inventory.main (cognitive 23) scripts/string_payload_access_inventory.py:425— string_payload_access_inventory.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5 (10 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.
tokio_inventory.lock_entries (cognitive 23) scripts/tokio_inventory.py:145— tokio_inventory.lock_entries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wpfacts_precision.static_sites (cognitive 23) scripts/wpfacts_precision.py:118— wpfacts_precision.static_sites has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 1 (4 pts), ternaries 1 (3 pts), loops 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.
class_call_method (cognitive 23) crates/perry-codegen-wasm/src/wasm_runtime.js:1922— class_call_method has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (7 pts), boolean chains 3, 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.
Env::kind (cognitive 22) crates/perry-codegen/src/collectors/typed_locals.rs:321— Env::kind has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (7 pts), boolean chains 6 (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.
Factories::walk_classes (cognitive 22) crates/perry-codegen/src/layout_families/late.rs:209— Factories::walk_classes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (7 pts), match/switch 2 (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.
Types::value (cognitive 22) crates/perry-component-host/src/async_values/reader_types.rs:100— Types::value has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 6 (9 pts), match/switch 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.
BunResolver::resolve (cognitive 22) crates/perry-ext-typescript/src/bun.rs:930— BunResolver::resolve has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (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.
Zstd::read (cognitive 22) crates/perry-ext-zlib/src/stream/driver.rs:460— Zstd::read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathModuleRegistry::require_with (cognitive 22) crates/perry-runtime/src/module_require/path_registry.rs:391— PathModuleRegistry::require_with has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamedStateKey::write_existing (cognitive 22) crates/perry-runtime/src/runtime_state_key.rs:119— NamedStateKey::write_existing has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 2 (3 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.
Dir::open_at (cognitive 22) crates/perry-wasi/src/filesystem.rs:877— Dir::open_at has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 5, 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.
Observe.stop (cognitive 22) docs/audits/gc-rss-instructions-2026-10-03/current0ed-meta-observer-v19.py:10— Observe.stop has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-gc-paired-instruction-domains-v1.main (cognitive 22) docs/audits/gc-rss-instructions-2026-10-03/verify-gc-paired-instruction-domains-v1.py:24— verify-gc-paired-instruction-domains-v1.main has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (8 pts), if/else 3 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-gc-window-v6r1-inputs.main (cognitive 22) docs/audits/gc-rss-instructions-2026-10-03/verify-gc-window-v6r1-inputs.py:16— verify-gc-window-v6r1-inputs.main has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (9 pts), boolean chains 7, if/else 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_dev_debug.check (cognitive 22) scripts/check_dev_debug.py:8— check_dev_debug.check has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 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.
analyzers.runtime_counter_summary (cognitive 22) scripts/compiler_output_harness/analyzers.py:434— analyzers.runtime_counter_summary has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (6 pts), ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
component_command_acceptance.main (cognitive 22) scripts/component_command_acceptance.py:18— component_command_acceptance.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 pts), loops 3 (6 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.
gc_root_dominance_check.build_cfg (cognitive 22) scripts/gc_root_dominance_check.py:444— gc_root_dominance_check.build_cfg has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (10 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.
gc_root_dominance_check.compute_poll_reaching (cognitive 22) scripts/gc_root_dominance_check.py:1953— gc_root_dominance_check.compute_poll_reaching has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 6 (10 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.
native_abi_evidence_report.packet_workload_contract (cognitive 22) scripts/native_abi_evidence_report.py:697— native_abi_evidence_report.packet_workload_contract has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 3, 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.
native_export_collisions.tokens (cognitive 22) scripts/native_export_collisions.py:25— native_export_collisions.tokens has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), ternaries 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.
native_handle_ledger.scan (cognitive 22) scripts/native_handle_ledger.py:228— native_handle_ledger.scan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (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.
package_bench.cmd_compile (cognitive 22) scripts/package_bench.py:752— package_bench.cmd_compile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, error handling 1 (2 pts), loops 1, 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.
parity_matrix_trend.report_results (cognitive 22) scripts/parity_matrix_trend.py:112— parity_matrix_trend.report_results has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 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.
registry_lifetime_check.strip_cfg_test (cognitive 22) scripts/registry_lifetime_check.py:201— registry_lifetime_check.strip_cfg_test has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 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.
registry_lifetime_check.function_spans (cognitive 22) scripts/registry_lifetime_check.py:239— registry_lifetime_check.function_spans has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 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.
runtime_abi_check.check (cognitive 22) scripts/runtime_abi_check.py:778— runtime_abi_check.check has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 pts), ternaries 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.
tokio_inventory.manifest_problems (cognitive 22) scripts/tokio_inventory.py:205— tokio_inventory.manifest_problems has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 pts), ternaries 1 (5 pts), 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.
PerfStat.finish (cognitive 22) scripts/turnloop/server_ab.py:898— PerfStat.finish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), boolean chains 3, 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.
Solver.escape (cognitive 22) scripts/wpfacts_recompute.py:880— Solver.escape has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuardGraphBuilder::class_chain_fields (cognitive 21) crates/perry-codegen/src/codegen/param_guard.rs:127— GuardGraphBuilder::class_chain_fields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (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.
Probe::stmt (cognitive 21) crates/perry-codegen/src/collectors/sealed_buffers.rs:167— Probe::stmt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::open_at (cognitive 21) crates/perry-component-host/src/sync_wasi/filesystem.rs:388— State::open_at has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 7 (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.
GraphemeState::width (cognitive 21) crates/perry-runtime/src/bun_compat/string_width.rs:421— GraphemeState::width has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeapChildSlotIterator::next (cognitive 21) crates/perry-runtime/src/gc/layout/child_slots.rs:221— HeapChildSlotIterator::next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecordWalk::next (cognitive 21) crates/perry-runtime/src/gc/roots/stack_maps_lazy.rs:114— RecordWalk::next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 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.
NumericIndex::rebuild_dense (cognitive 21) crates/perry-runtime/src/map.rs:615— NumericIndex::rebuild_dense has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), 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.
actions_plan._glob_regex (cognitive 21) scripts/actions_plan.py:28— actions_plan._glob_regex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 2, 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.
check_cross_thread_promise_provenance.analyze_source (cognitive 21) scripts/check_cross_thread_promise_provenance.py:119— check_cross_thread_promise_provenance.analyze_source has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 5 (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.
check_gc_doc_claims.self_test (cognitive 21) scripts/check_gc_doc_claims.py:269— check_gc_doc_claims.self_test has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, 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.
check_js_body_call_funnel.transmute_targets (cognitive 21) scripts/check_js_body_call_funnel.py:99— check_js_body_call_funnel.transmute_targets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_npm_publish_freshness.main (cognitive 21) scripts/check_npm_publish_freshness.py:826— check_npm_publish_freshness.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 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.
ci_plan.plan (cognitive 21) scripts/ci_plan.py:312— ci_plan.plan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 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.
analyzers.summarize_gc_trace (cognitive 21) scripts/compiler_output_harness/analyzers.py:484— analyzers.summarize_gc_trace has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 3 (4 pts), error handling 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.
verification.named_region_contract_results (cognitive 21) scripts/compiler_output_harness/verification.py:160— verification.named_region_contract_results 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.
verification._text_check_passes (cognitive 21) scripts/compiler_output_harness/verification.py:220— verification._text_check_passes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9 (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.
gc_parse_churn_layout_check.evaluate (cognitive 21) scripts/gc_parse_churn_layout_check.py:77— gc_parse_churn_layout_check.evaluate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 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.
gc_root_dominance_check._c_symbol_bodies (cognitive 21) scripts/gc_root_dominance_check.py:857— gc_root_dominance_check._c_symbol_bodies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 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.
gc_root_dominance_check.indented_macro_exports (cognitive 21) scripts/gc_root_dominance_check.py:1134— gc_root_dominance_check.indented_macro_exports has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (11 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.
gc_root_dominance_check.load_allowlist (cognitive 21) scripts/gc_root_dominance_check.py:2472— gc_root_dominance_check.load_allowlist has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
gc_root_dominance_check.window_hits_generic (cognitive 21) scripts/gc_root_dominance_check.py:3303— gc_root_dominance_check.window_hits_generic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (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.
link_absence.text_bounds (cognitive 21) scripts/link_absence.py:203— link_absence.text_bounds has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (8 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.
native_abi_evidence_report.release_symbol_summary (cognitive 21) scripts/native_abi_evidence_report.py:1179— native_abi_evidence_report.release_symbol_summary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 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.
perf_objops_lane.gc (cognitive 21) scripts/perf_objops_lane.py:146— perf_objops_lane.gc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 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.
record_function_order.main (cognitive 21) scripts/record_function_order.py:67— record_function_order.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schemadec_profile.main (cognitive 21) scripts/schemadec_profile.py:51— schemadec_profile.main has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (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.
string_validator_inventory.check (cognitive 21) scripts/string_validator_inventory.py:34— string_validator_inventory.check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, loops 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.
tokio_inventory.source_hits (cognitive 21) scripts/tokio_inventory.py:254— tokio_inventory.source_hits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 2, error handling 1 (2 pts), 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.
unrooted_local_shape.self_test (cognitive 21) scripts/unrooted_local_shape.py:624— unrooted_local_shape.self_test has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4, boolean chains 3, error handling 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.
wasi_build_runtime.main (cognitive 21) scripts/wasi_build_runtime.py:30— wasi_build_runtime.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wpfacts_corpus.run_sabotage (cognitive 21) scripts/wpfacts_corpus.py:274— wpfacts_corpus.run_sabotage has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Solver.load_from (cognitive 21) scripts/wpfacts_recompute.py:557— Solver.load_from has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8 (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.
binding_pins.parseBindings (cognitive 21) scripts/binding_pins.mjs:72— binding_pins.parseBindings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
node_compat_matrix.summarize (cognitive 21) scripts/node_compat_matrix.mjs:543— node_compat_matrix.summarize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, 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.
shared.extractFirstJson (cognitive 21) scripts/publish/shared.mts:248— shared.extractFirstJson has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, 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.
buildImports::class_call_method (cognitive 21) crates/perry-codegen-wasm/src/wasm_runtime.js:668— buildImports::class_call_method has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, 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.
_perry_audio_start_voice (cognitive 21) crates/perry-codegen-wasm/src/wasm_runtime.js:4263— _perry_audio_start_voice has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 4 (6 pts) (nesting depth added 2). Of this number, 16 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.
perry_ext_typescript::bun::scan_bun_source (cognitive 20) crates/perry-ext-typescript/src/bun.rs:435— perry_ext_typescript::bun::scan_bun_source has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (7 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Observe.stop (cognitive 20) docs/audits/gc-rss-instructions-2026-10-03/current0ed-meta-observer-v17.py:10— Observe.stop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prepare-gc-overlay.prepare (cognitive 20) docs/audits/gc-rss-instructions-2026-10-03/prepare-gc-overlay.py:15— prepare-gc-overlay.prepare has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5, 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.
capture_linux_incident.summarize (cognitive 20) scripts/capture_linux_incident.py:74— capture_linux_incident.summarize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (5 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.
compiler_output_step_liveness.check_workflow (cognitive 20) scripts/compiler_output_step_liveness.py:96— compiler_output_step_liveness.check_workflow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
component_reader_acceptance.main (cognitive 20) scripts/component_reader_acceptance.py:14— component_reader_acceptance.main has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (11 pts), loops 6, if/else 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.
copied_minor_fallback_report.main (cognitive 20) scripts/copied_minor_fallback_report.py:1015— copied_minor_fallback_report.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (5 pts), error handling 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_pin_sites.raw_byte_offenders (cognitive 20) scripts/gc_pin_sites.py:257— gc_pin_sites.raw_byte_offenders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), ternaries 1 (4 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.
gc_root_dominance_check._cast_closure (cognitive 20) scripts/gc_root_dominance_check.py:4977— gc_root_dominance_check._cast_closure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 4, 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.
gc_root_dominance_check._phi_edge_hazard (cognitive 20) scripts/gc_root_dominance_check.py:5380— gc_root_dominance_check._phi_edge_hazard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 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.
gc_store_site_inventory.split_top_level_args (cognitive 20) scripts/gc_store_site_inventory.py:831— gc_store_site_inventory.split_top_level_args 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.
gc_store_site_inventory.check_runtime_claims (cognitive 20) scripts/gc_store_site_inventory.py:1128— gc_store_site_inventory.check_runtime_claims has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local_binding_type_audit.scan_text (cognitive 20) scripts/local_binding_type_audit.py:170— local_binding_type_audit.scan_text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lock_no_downgrade.analyse (cognitive 20) scripts/lock_no_downgrade.py:177— lock_no_downgrade.analyse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2, 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.
package_bench.cmd_profile (cognitive 20) scripts/package_bench.py:821— package_bench.cmd_profile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 2, 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.
package_bench_attr.derive (cognitive 20) scripts/package_bench_attr.py:551— package_bench_attr.derive has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parity_known_failures.validate_entry (cognitive 20) scripts/parity_known_failures.py:154— parity_known_failures.validate_entry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5 (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.
parity_known_failures.audit (cognitive 20) scripts/parity_known_failures.py:267— parity_known_failures.audit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perf_objops_lane.compare (cognitive 20) scripts/perf_objops_lane.py:119— perf_objops_lane.compare has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 4 (6 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.
string_validator_inventory.inventory (cognitive 20) scripts/string_validator_inventory.py:17— string_validator_inventory.inventory 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.
test262_subset.parse_frontmatter (cognitive 20) scripts/test262_subset.py:201— test262_subset.parse_frontmatter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thread_exit_address_globals.exit_hooks (cognitive 20) scripts/thread_exit_address_globals.py:316— thread_exit_address_globals.exit_hooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 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.
verify_tscwall_gaps.main (cognitive 20) scripts/verify_tscwall_gaps.py:31— verify_tscwall_gaps.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 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.
web_runtime.perry_ui_canvas_draw_image (cognitive 20) crates/perry-codegen-js/src/web_runtime.js:1451— web_runtime.perry_ui_canvas_draw_image has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (6 pts), boolean chains 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.
wasm_runtime.perry_ui_canvas_draw_image (cognitive 20) crates/perry-codegen-wasm/src/wasm_runtime.js:3554— wasm_runtime.perry_ui_canvas_draw_image has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (6 pts), boolean chains 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.
external-tools.main (cognitive 20) scripts/soak/external-tools.mts:634— external-tools.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 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.
node_compat_matrix.resolveNode (cognitive 20) scripts/node_compat_matrix.mjs:231— node_compat_matrix.resolveNode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 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, 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.
objects-cache.cacheArchiveFiles (cognitive 20) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:553— objects-cache.cacheArchiveFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2, error handling 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.
callWasmClosure (cognitive 20) crates/perry-codegen-wasm/src/wasm_runtime.js:2616— callWasmClosure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (7 pts), boolean chains 4 (nesting depth added 6). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrefixContainedParamUse::walk_stmt (cognitive 19) crates/perry-codegen/src/collectors/proven_args.rs:224— PrefixContainedParamUse::walk_stmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Incoming::prepare (cognitive 19) crates/perry-component-host/src/sync_wasi/udp.rs:54— Incoming::prepare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 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.
Arena::drop (cognitive 19) crates/perry-runtime/src/arena/block.rs:640— Arena::drop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncrementalSweepState::step (cognitive 19) crates/perry-runtime/src/gc/oldgen.rs:1233— IncrementalSweepState::step has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 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.
SlotIndex::insert (cognitive 19) crates/perry-runtime/src/object/shapes_slot_list.rs:113— SlotIndex::insert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileOutputStream::blocking_write (cognitive 19) crates/perry-wasi/src/p2/filesystem.rs:241— FileOutputStream::blocking_write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 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.
check_thread_locals.scan (cognitive 19) scripts/check_thread_locals.py:427— check_thread_locals.scan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (12 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.
component_producer_acceptance.main (cognitive 19) scripts/component_producer_acceptance.py:14— component_producer_acceptance.main has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (11 pts), loops 5, if/else 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.
gc_1090_evidence_report.collect_report (cognitive 19) scripts/gc_1090_evidence_report.py:1165— gc_1090_evidence_report.collect_report has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_root_dominance_check.heap_source_kind (cognitive 19) scripts/gc_root_dominance_check.py:3105— gc_root_dominance_check.heap_source_kind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 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.
gc_root_dominance_check._constant_based (cognitive 19) scripts/gc_root_dominance_check.py:5199— gc_root_dominance_check._constant_based has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5 (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.
gc_store_site_inventory.extract_call_args (cognitive 19) scripts/gc_store_site_inventory.py:868— gc_store_site_inventory.extract_call_args has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 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.
link_absence.compile_witness (cognitive 19) scripts/link_absence.py:271— link_absence.compile_witness has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 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.
lock_no_downgrade.self_test (cognitive 19) scripts/lock_no_downgrade.py:300— lock_no_downgrade.self_test has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native_export_collisions.bind_repeated (cognitive 19) scripts/native_export_collisions.py:216— native_export_collisions.bind_repeated has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (5 pts), ternaries 1 (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.
package_bench_attr.iter_samples (cognitive 19) scripts/package_bench_attr.py:449— package_bench_attr.iter_samples has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 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.
realm_dump.canonical (cognitive 19) scripts/realm_dump.py:25— realm_dump.canonical has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (17 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.
runtime_abi_check.compare_slot (cognitive 19) scripts/runtime_abi_check.py:676— runtime_abi_check.compare_slot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. 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.
thread_exit_address_globals.allocation_lifetime_problems (cognitive 19) scripts/thread_exit_address_globals.py:359— thread_exit_address_globals.allocation_lifetime_problems has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 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.
windows_pipe_drain_cancel.check (cognitive 19) scripts/windows_pipe_drain_cancel.py:10— windows_pipe_drain_cancel.check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, 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.
lib.eventSavePolicy (cognitive 19) upstream/actions/jdx/mr-boxington-action/src/lib.ts:498— lib.eventSavePolicy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 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.
objects-cache.saveIsolatedObjectsBundle (cognitive 19) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:843— objects-cache.saveIsolatedObjectsBundle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, 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.
Requires::visit_call_expr (cognitive 18) crates/perry/src/commands/compile/cjs_wrap/deferred_requires.rs:187— Requires::visit_call_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ModuleState::new (cognitive 18) crates/perry-codegen/src/typed_feedback_profile.rs:236— ModuleState::new 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.
perry_codegen_glance::emit::emit_node (cognitive 18) crates/perry-codegen-glance/src/emit.rs:401— perry_codegen_glance::emit::emit_node has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Payload::step (cognitive 18) crates/perry-ext-zlib/src/stream/driver.rs:939— Payload::step has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (3 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.
Sidecar::parse (cognitive 18) crates/perry-gc-effects/src/sidecar.rs:174— Sidecar::parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pruner::stmt (cognitive 18) crates/perry-hir/src/lower/class_capture_scope.rs:165— Pruner::stmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Decoder::step (cognitive 18) crates/perry-http-client/src/ws/frame.rs:168— Decoder::step has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IpcStream::raw_io (cognitive 18) crates/perry-runtime/src/child_process/ipc_transport.rs:111— IpcStream::raw_io has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 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.
BlockPersistCycleState::step (cognitive 18) crates/perry-runtime/src/gc/cycle.rs:168— BlockPersistCycleState::step has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Histogram::percentile_entries (cognitive 18) crates/perry-runtime/src/perf_histogram.rs:310— Histogram::percentile_entries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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.
WeakStorage::probe (cognitive 18) crates/perry-runtime/src/weakref/storage.rs:68— WeakStorage::probe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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.
TlsSession::pump (cognitive 18) crates/perry-tls-session/src/session.rs:303— TlsSession::pump has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perry_ext_ethers::keccak256::keccak_f (cognitive 18) crates/perry-ext-ethers/src/lib.rs:278— perry_ext_ethers::keccak256::keccak_f has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (18 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.
check_npm_publish_freshness.evaluate_package (cognitive 18) scripts/check_npm_publish_freshness.py:293— check_npm_publish_freshness.evaluate_package has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
repsel_census.render_consumption_report (cognitive 18) scripts/compiler_output_harness/repsel_census.py:1115— repsel_census.render_consumption_report has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 4 (6 pts), ternaries 1 (2 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.
component_async_guest_resources_acceptance.main (cognitive 18) scripts/component_async_guest_resources_acceptance.py:18— component_async_guest_resources_acceptance.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4, boolean chains 2, error handling 1 (2 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.
constfn_executable_gates.isolated_refusal_routes (cognitive 18) scripts/constfn_executable_gates.py:295— constfn_executable_gates.isolated_refusal_routes has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), boolean chains 4, if/else 3 (4 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.
gc_root_dominance_check.heap_value_origins (cognitive 18) scripts/gc_root_dominance_check.py:3685— gc_root_dominance_check.heap_value_origins has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
gc_runtime_root_holders.function_bodies (cognitive 18) scripts/gc_runtime_root_holders.py:445— gc_runtime_root_holders.function_bodies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_runtime_root_holders.type_can_hold_js_value (cognitive 18) scripts/gc_runtime_root_holders.py:764— gc_runtime_root_holders.type_can_hold_js_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (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.
gc_store_site_inventory.helper_reaches_ground (cognitive 18) scripts/gc_store_site_inventory.py:1107— gc_store_site_inventory.helper_reaches_ground has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 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.
gc_store_site_inventory.main (cognitive 18) scripts/gc_store_site_inventory.py:1929— gc_store_site_inventory.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 4 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gen_parity_gaps.parse_inventory (cognitive 18) scripts/gen_parity_gaps.py:87— gen_parity_gaps.parse_inventory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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.
native_handle_ledger.self_test (cognitive 18) scripts/native_handle_ledger.py:369— native_handle_ledger.self_test has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, 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.
native_handle_ledger.main (cognitive 18) scripts/native_handle_ledger.py:459— native_handle_ledger.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
node_core_subset.merge_reports (cognitive 18) scripts/node_core_subset.py:391— node_core_subset.merge_reports has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 3 (5 pts), boolean chains 3, error handling 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.
package_bench_attr.rank_buckets (cognitive 18) scripts/package_bench_attr.py:899— package_bench_attr.rank_buckets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (5 pts), loops 4, 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.
perf_missread_lane.compare (cognitive 18) scripts/perf_missread_lane.py:118— perf_missread_lane.compare has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), loops 3 (6 pts), if/else 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.
perf_tscwall_lane.compile_set (cognitive 18) scripts/perf_tscwall_lane.py:102— perf_tscwall_lane.compile_set has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 2 (6 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.
runtime_abi_check.split_top (cognitive 18) scripts/runtime_abi_check.py:109— runtime_abi_check.split_top has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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.
sso_unbox_inventory.collect_inventory (cognitive 18) scripts/sso_unbox_inventory.py:286— sso_unbox_inventory.collect_inventory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 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.
tokio_inventory.check (cognitive 18) scripts/tokio_inventory.py:311— tokio_inventory.check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server_ab.finish_sample (cognitive 18) scripts/turnloop/server_ab.py:1235— server_ab.finish_sample has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
server_ab.main (cognitive 18) scripts/turnloop/server_ab.py:1795— server_ab.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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.
wasi_image_selftest.main (cognitive 18) scripts/wasi_image_selftest.py:38— wasi_image_selftest.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 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.
web_runtime.hone_editor_set_viewport (cognitive 18) crates/perry-codegen-js/src/web_runtime.js:2575— web_runtime.hone_editor_set_viewport has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 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.
index.serve (cognitive 18) REDACTED:54— index.serve has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (5 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 57, 96, 83). 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.
pipeline.verifyPublishedProofs (cognitive 18) scripts/publish/pipeline.mts:333— pipeline.verifyPublishedProofs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
BuildCacheProbe::probe (cognitive 17) crates/perry/src/commands/compile/build_cache.rs:298— BuildCacheProbe::probe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, match/switch 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.
BirthShape::content_hash (cognitive 17) crates/perry-codegen/src/codegen/static_shape_ids.rs:123— BirthShape::content_hash has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5, boolean chains 1, match/switch 1 (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.
LoweringContext::pop_block_scope (cognitive 17) crates/perry-hir/src/lower/context.rs:1811— LoweringContext::pop_block_scope has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 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.
RequireAliases::visit_var_decl (cognitive 17) crates/perry-hir/src/realm_reach.rs:265— RequireAliases::visit_var_decl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Metadata::scan (cognitive 17) crates/perry-runtime/src/regex/perex_literal_bytes.rs:60— Metadata::scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Value::encode (cognitive 17) crates/perry-runtime-manifest/src/realm_json.rs:35— Value::encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), match/switch 2 (3 pts) (nesting depth added 8). None of this is in the body itself: all 17 points belong to 2 function items inside it that branch (write, quoted). 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.
perry_ui_windows_winui::app::app_run (cognitive 17) crates/perry-ui-windows-winui/src/app.rs:145— perry_ui_windows_winui::app::app_run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 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.
Frames::poll_next (cognitive 17) crates/perry-wasi/src/p3/http/body/outgoing.rs:98— Frames::poll_next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (5 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.
perry_updater::core::perry_updater_verify_signature_v2 (cognitive 17) crates/perry-updater/src/core.rs:268— perry_updater::core::perry_updater_verify_signature_v2 has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8 (9 pts), if/else 5 (6 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
currentc170-peak-mappings-v28.maps (cognitive 17) docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:12— currentc170-peak-mappings-v28.maps has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (5 pts), boolean chains 3, 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.
currentc170-peak-mappings-v28r1.maps (cognitive 17) docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28r1.py:13— currentc170-peak-mappings-v28r1.maps has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (5 pts), boolean chains 3, 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.
currentc170-peak-mappings-v28r2.maps (cognitive 17) docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28r2.py:13— currentc170-peak-mappings-v28r2.maps has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (5 pts), boolean chains 3, 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.
buffer_b1_validate.compile_arm (cognitive 17) scripts/buffer_b1_validate.py:82— buffer_b1_validate.compile_arm has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 pts), error handling 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.
buffer_b4_validate.compile_arm (cognitive 17) scripts/buffer_b4_validate.py:81— buffer_b4_validate.compile_arm has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buffer_b4_validate.full_collections (cognitive 17) scripts/buffer_b4_validate.py:112— buffer_b4_validate.full_collections has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (4 pts), ternaries 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.
check_gc_env_knobs.self_test (cognitive 17) scripts/check_gc_env_knobs.py:201— check_gc_env_knobs.self_test has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
check_gc_header_constants.check (cognitive 17) scripts/check_gc_header_constants.py:253— check_gc_header_constants.check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 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.
check_mbx_policy.check (cognitive 17) scripts/check_mbx_policy.py:14— check_mbx_policy.check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
check_readpath3_gaps.main (cognitive 17) scripts/check_readpath3_gaps.py:11— check_readpath3_gaps.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (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.
check_thread_locals._cfg_value (cognitive 17) scripts/check_thread_locals.py:236— check_thread_locals._cfg_value has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_thread_locals.cfg_attributes (cognitive 17) scripts/check_thread_locals.py:260— check_thread_locals.cfg_attributes 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.
analyzers.parse_vectorization_remarks (cognitive 17) scripts/compiler_output_harness/analyzers.py:162— analyzers.parse_vectorization_remarks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
capture.capture_suite (cognitive 17) scripts/compiler_output_harness/capture.py:527— capture.capture_suite has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 4, boolean chains 3, error handling 1 (2 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.
repsel_knob_isolation.check_isolation (cognitive 17) scripts/compiler_output_harness/repsel_knob_isolation.py:259— repsel_knob_isolation.check_isolation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 pts), 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.
component_http_acceptance.main (cognitive 17) scripts/component_http_acceptance.py:24— component_http_acceptance.main has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), ternaries 4 (7 pts), if/else 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.
Echo.do_POST (cognitive 17) scripts/component_http_guest_acceptance.py:86— Echo.do_POST has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts), error handling 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.
gap_snapshot.merge (cognitive 17) scripts/gap_snapshot.py:146— gap_snapshot.merge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), ternaries 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.
gc_1090_evidence_report.gc_store_inventory_summary (cognitive 17) scripts/gc_1090_evidence_report.py:818— gc_1090_evidence_report.gc_store_inventory_summary has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 5 (6 pts), boolean chains 2, 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.
gc_root_dominance_check.nm_exported_symbols (cognitive 17) scripts/gc_root_dominance_check.py:993— gc_root_dominance_check.nm_exported_symbols has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (5 pts), ternaries 2 (5 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_snapshot_contracts.snapshot_contract_self_test (cognitive 17) scripts/gc_snapshot_contracts.py:108— gc_snapshot_contracts.snapshot_contract_self_test has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
node_suite_run.discover (cognitive 17) scripts/node_suite_run.py:49— node_suite_run.discover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
perf_frontier_report.render_markdown (cognitive 17) scripts/perf_frontier_report.py:957— perf_frontier_report.render_markdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (6 pts), loops 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.
raw_handle_debt.compare_across_base (cognitive 17) scripts/raw_handle_debt.py:216— raw_handle_debt.compare_across_base has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
realm_manifest_coverage.check (cognitive 17) scripts/realm_manifest_coverage.py:126— realm_manifest_coverage.check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (4 pts), ternaries 1 (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.
registry_lifetime_check.allowlist_problems (cognitive 17) scripts/registry_lifetime_check.py:435— registry_lifetime_check.allowlist_problems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, 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.
registry_lifetime_check.report (cognitive 17) scripts/registry_lifetime_check.py:493— registry_lifetime_check.report has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 5, boolean chains 3, loops 3 (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.
runtime_abi_check.main (cognitive 17) scripts/runtime_abi_check.py:1227— runtime_abi_check.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), ternaries 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.
shape_descriptor_census.callsite_multiset (cognitive 17) scripts/shape_descriptor_census.py:134— shape_descriptor_census.callsite_multiset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (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.
PerfStat.resolve (cognitive 17) scripts/turnloop/server_ab.py:848— PerfStat.resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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.
typed-feedback-profile.make_profile (cognitive 17) scripts/typed-feedback-profile.py:9— typed-feedback-profile.make_profile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 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.
wasi_release.main (cognitive 17) scripts/wasi_release.py:118— wasi_release.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 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.
wpfacts_oracle.load_static (cognitive 17) scripts/wpfacts_oracle.py:67— wpfacts_oracle.load_static has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
web_runtime._perry_media_wire_session (cognitive 17) crates/perry-codegen-js/src/web_runtime.js:3433— web_runtime._perry_media_wire_session has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 7, error handling 1. Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 3450, 3458, 3446, …). 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.
wasm_runtime._perry_media_wire_session (cognitive 17) crates/perry-codegen-wasm/src/wasm_runtime.js:3944— wasm_runtime._perry_media_wire_session has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 7, error handling 1. Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 3961, 3969, 3957, …). 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.
wasm_runtime.perry_audio_set_volume (cognitive 17) crates/perry-codegen-wasm/src/wasm_runtime.js:4506— wasm_runtime.perry_audio_set_volume has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
node_compat_matrix.baselineValidationError (cognitive 17) scripts/node_compat_matrix.mjs:658— node_compat_matrix.baselineValidationError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, 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.
nightly.main (cognitive 17) scripts/publish/nightly.mts:11— nightly.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
pipeline.dispatchPublishWorkflow (cognitive 17) scripts/publish/pipeline.mts:249— pipeline.dispatchPublishWorkflow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
scan.scanTarball (cognitive 17) scripts/publish/scan.mts:169— scan.scanTarball has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 2 (3 pts), error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
objects-cache.validateObjectsCachePaths (cognitive 17) upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:148— objects-cache.validateObjectsCachePaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposeSpec::merge (cognitive 16) crates/perry-container-compose/src/types.rs:782— ComposeSpec::merge has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 6 (nesting depth added 4). 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.
TerminalEmitter::emit (cognitive 16) crates/perry-diagnostics/src/emitter.rs:117— TerminalEmitter::emit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 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.
PageMap::remove_pages (cognitive 16) crates/perry-runtime/src/arena/page_meta/storage.rs:109— PageMap::remove_pages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
ArenaObjectCursor::next_budgeted (cognitive 16) crates/perry-runtime/src/arena/walk.rs:244— ArenaObjectCursor::next_budgeted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 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.
FieldReprCensus::summary (cognitive 16) crates/perry-runtime/src/gc/census_field_repr.rs:115— FieldReprCensus::summary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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.
ImageList::new (cognitive 16) crates/perry-runtime/src/object/image_keys.rs:112— ImageList::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlotCandidates::next (cognitive 16) crates/perry-runtime/src/object/shapes_slot_list.rs:248— SlotCandidates::next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Directory::poll_produce (cognitive 16) crates/perry-wasi/src/p3/filesystem/directory.rs:47— Directory::poll_produce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PerryBridge.onImagePickerResult (cognitive 16) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:721— PerryBridge.onImagePickerResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_gc_doc_claims.path_problems (cognitive 16) scripts/check_gc_doc_claims.py:146— check_gc_doc_claims.path_problems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (4 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.
analyzers.named_hot_regions (cognitive 16) scripts/compiler_output_harness/analyzers.py:396— analyzers.named_hot_regions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), boolean chains 3, 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.
repsel_census.load_baseline (cognitive 16) scripts/compiler_output_harness/repsel_census.py:769— repsel_census.load_baseline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
gate_failure_watch.handle_event (cognitive 16) scripts/gate_failure_watch.py:343— gate_failure_watch.handle_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 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.
gc_root_dominance_check._scan_unrooted (cognitive 16) scripts/gc_root_dominance_check.py:6713— gc_root_dominance_check._scan_unrooted has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 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.
gc_runtime_root_holders.declarations_in_tls (cognitive 16) scripts/gc_runtime_root_holders.py:546— gc_runtime_root_holders.declarations_in_tls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc_runtime_root_holders.ffi_holder_is_candidate (cognitive 16) scripts/gc_runtime_root_holders.py:792— gc_runtime_root_holders.ffi_holder_is_candidate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, 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.
gc_store_site_inventory.rust_function_spans (cognitive 16) scripts/gc_store_site_inventory.py:788— gc_store_site_inventory.rust_function_spans has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 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.
global_sink_isolation.referenced_idents (cognitive 16) scripts/global_sink_isolation.py:108— global_sink_isolation.referenced_idents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
link_absence.witness_options (cognitive 16) scripts/link_absence.py:135— link_absence.witness_options has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
link_absence.why_live (cognitive 16) scripts/link_absence.py:333— link_absence.why_live has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perf_missread_lane.compile_arm (cognitive 16) scripts/perf_missread_lane.py:62— perf_missread_lane.compile_arm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (4 pts), error handling 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.
runtime_size_budget.main (cognitive 16) scripts/runtime_size_budget.py:97— runtime_size_budget.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (6 pts), 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.
wasm_runtime.perry_ui_stack_set_alignment (cognitive 16) crates/perry-codegen-wasm/src/wasm_runtime.js:3072— wasm_runtime.perry_ui_stack_set_alignment has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 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.
soak.parseExcludeEntries (cognitive 16) scripts/soak/soak.mts:186— soak.parseExcludeEntries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 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.
soak.runSoak (cognitive 16) scripts/soak/soak.mts:486— soak.runSoak has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (3 pts), boolean chains 2, 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.
Change coupling clique: helpers.rs, builtins.rs, global_this.rs crates/perry-codegen/src/expr/helpers.rs— 3 files — `crates/perry-codegen/src/expr/helpers.rs`, `crates/perry-hir/src/analysis/builtins.rs`, `crates/perry-runtime/src/object/global_this.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication· Near-duplicate member family (8 members, 21 shared lines) · ×1
Near-duplicate member family (8 members, 21 shared lines) docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:31— docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:31-76 | docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:45-101 | docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:45-101 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:44-100 | docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-v79-auto.py:39-86 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:44-100 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:44-100 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:54-112 — These 8 members are variants of one another: a block of 21 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 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· Near-duplicate member family (7 members, 24 shared lines) · ×1
Near-duplicate member family (7 members, 24 shared lines) crates/perry-codegen/src/expr/bigint_set.rs:77— crates/perry-codegen/src/expr/bigint_set.rs:77-142 | crates/perry-codegen/src/expr/bigint_set.rs:189-254 | crates/perry-codegen/src/expr/bigint_set.rs:256-323 | crates/perry-codegen/src/expr/logical_collections.rs:479-546 | crates/perry-codegen/src/expr/math_simple.rs:200-267 | crates/perry-codegen/src/expr/math_simple.rs:295-362 | crates/perry-codegen/src/expr/math_simple.rs:364-429 — These 7 members are variants of one another: a block of 24 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 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· Near-duplicate member family (4 members, 32 shared lines) · ×1
Near-duplicate member family (4 members, 32 shared lines) crates/perry-hir/src/monomorph/infer.rs:253— crates/perry-hir/src/monomorph/infer.rs:253-312 | crates/perry-hir/src/monomorph/infer.rs:363-421 | crates/perry-hir/src/monomorph/update_call_sites.rs:572-621 | crates/perry-hir/src/monomorph/update_call_sites.rs:628-679 — These 4 members are variants of one another: a block of 32 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, 23 shared lines) · ×1
Near-duplicate member family (4 members, 23 shared lines) crates/perry-container-compose/src/backend/apple.rs:63— crates/perry-container-compose/src/backend/apple.rs:63-136 | crates/perry-container-compose/src/backend/apple.rs:138-192 | crates/perry-container-compose/src/backend/docker.rs:88-154 | crates/perry-container-compose/src/backend/docker.rs:156-207 — These 4 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 8 shared lines) · ×1
Near-duplicate member family (4 members, 8 shared lines) crates/perry-codegen/src/expr/calls/crypto_kdf.rs:64— crates/perry-codegen/src/expr/calls/crypto_kdf.rs:64-94 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:101-132 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:232-262 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:308-338 — 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 (3 members, 55 shared lines) · ×1
Near-duplicate member family (3 members, 55 shared lines) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:38— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:38-117 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:38-117 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:38-119 — These 3 members are variants of one another: a block of 55 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, 27 shared lines) · ×1
Near-duplicate member family (3 members, 27 shared lines) crates/perry-codegen/src/codegen/closure.rs:39— crates/perry-codegen/src/codegen/closure.rs:39-111 | crates/perry-codegen/src/codegen/function.rs:225-284 | crates/perry-codegen/src/codegen/method_trampolines.rs:24-83 — These 3 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 16 shared lines) · ×1
Near-duplicate member family (3 members, 16 shared lines) scripts/buffer_b1_validate.py:150— scripts/buffer_b1_validate.py:150-205 | scripts/buffer_b4_validate.py:162-217 | scripts/buffer_b5_validate.py:19-65 — These 3 members are variants of one another: a block of 16 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, 10 shared lines) · ×1
Near-duplicate member family (3 members, 10 shared lines) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:12— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:12-34 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:12-34 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:12-34 — These 3 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 (1909 shared lines) crates/perry-hir/src/walker/expr_mut.rs:9— crates/perry-hir/src/walker/expr_mut.rs:9-1974 | crates/perry-hir/src/walker/expr_ref.rs:10-1934 — These two members are variants of one another: 1909 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 (494 shared lines) crates/perry-hir/src/lower/stmt_loops.rs:658— crates/perry-hir/src/lower/stmt_loops.rs:658-1863 | crates/perry-hir/src/lower_decl/body_stmt.rs:105-2535 — These two members are variants of one another: 494 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 (460 shared lines) crates/perry-codegen/src/collectors/i32_locals.rs:1240— crates/perry-codegen/src/collectors/i32_locals.rs:1240-1761 | crates/perry-codegen/src/collectors/refs.rs:206-1023 — These two members are variants of one another: 460 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 (420 shared lines) crates/perry-hir/src/lower_decl/class_decl.rs:115— crates/perry-hir/src/lower_decl/class_decl.rs:115-1412 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:15-763 — These two members are variants of one another: 420 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 (161 shared lines) crates/perry-codegen/src/dialect/mod.rs:1097— crates/perry-codegen/src/dialect/mod.rs:1097-1343 | crates/perry-codegen/src/dialect/mod.rs:1348-1922 — These two members are variants of one another: 161 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 (78 shared lines) crates/perry-codegen/src/expr/calls/fs.rs:11— crates/perry-codegen/src/expr/calls/fs.rs:11-113 | crates/perry-codegen/src/expr/calls/fs.rs:135-483 — These two members are variants of one another: 78 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 (75 shared lines) crates/perry-hir/src/lower/lower_expr/reactive_text.rs:36— crates/perry-hir/src/lower/lower_expr/reactive_text.rs:36-239 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:106-317 — These two members are variants of one another: 75 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 (63 shared lines) crates/perry-hir/src/monomorph/infer.rs:9— crates/perry-hir/src/monomorph/infer.rs:9-149 | crates/perry-hir/src/monomorph/update_call_sites.rs:682-779 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (57 shared lines) crates/perry-codegen/src/codegen/method_entries.rs:36— crates/perry-codegen/src/codegen/method_entries.rs:36-123 | crates/perry-codegen/src/codegen/method_entries.rs:136-230 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (50 shared lines) crates/perry-codegen/src/type_analysis/strings.rs:352— crates/perry-codegen/src/type_analysis/strings.rs:352-454 | crates/perry-codegen/src/type_analysis/strings.rs:683-917 — These two members are variants of one another: 50 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/perry-codegen-glance/src/emit.rs:401— crates/perry-codegen-glance/src/emit.rs:401-548 | crates/perry-codegen-swiftui/src/emit.rs:840-1005 — 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 (44 shared lines) crates/perry-codegen/src/native_value/verify/abi.rs:298— crates/perry-codegen/src/native_value/verify/abi.rs:298-360 | crates/perry-codegen/src/native_value/verify/abi.rs:362-424 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (36 shared lines) crates/perry-codegen/src/expr/pod_record.rs:263— crates/perry-codegen/src/expr/pod_record.rs:263-329 | crates/perry-codegen/src/expr/pod_record.rs:336-441 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (34 shared lines) crates/perry-codegen/src/lower_call/direct_method_guard.rs:40— crates/perry-codegen/src/lower_call/direct_method_guard.rs:40-129 | crates/perry-codegen/src/lower_call/method_override.rs:383-439 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (29 shared lines) crates/perry-ext-better-sqlite3/src/lib.rs:346— crates/perry-ext-better-sqlite3/src/lib.rs:346-400 | crates/perry-ext-better-sqlite3/src/lib.rs:412-482 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (27 shared lines) crates/perry-codegen/src/expr/compare.rs:596— crates/perry-codegen/src/expr/compare.rs:596-707 | crates/perry-codegen/src/expr/compare.rs:1083-1169 — These two members are variants of one another: 27 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/perry-codegen-glance/src/emit.rs:39— crates/perry-codegen-glance/src/emit.rs:39-108 | crates/perry-codegen-wear-tiles/src/emit.rs:40-169 — 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 (22 shared lines) crates/perry-codegen/src/proto_constants.rs:225— crates/perry-codegen/src/proto_constants.rs:225-282 | crates/perry-codegen/src/proto_constants.rs:562-622 — These two members are variants of one another: 22 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 (19 shared lines) docs/audits/gc-rss-instructions-2026-10-03/current0ed-meta-observer-v17.py:11— docs/audits/gc-rss-instructions-2026-10-03/current0ed-meta-observer-v17.py:11-51 | docs/audits/gc-rss-instructions-2026-10-03/current0ed-meta-observer-v19.py:11-61 — These two members are variants of one another: 19 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 (18 shared lines) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:92— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:92-115 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:93-116 — These two members are variants of one another: 18 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) crates/perry-codegen/src/collectors/hot_callees.rs:125— crates/perry-codegen/src/collectors/hot_callees.rs:125-172 | crates/perry-codegen/src/collectors/hot_callees.rs:224-316 — 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 (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) crates/perry-codegen/src/expr/binary.rs:1108— crates/perry-codegen/src/expr/binary.rs:1108-1145 | crates/perry-codegen/src/expr/mod.rs:4036-4073 — 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 (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) crates/perry-hir/src/destructuring/assignment_stmt.rs:228— crates/perry-hir/src/destructuring/assignment_stmt.rs:228-299 | crates/perry-hir/src/destructuring/pattern_binding.rs:115-188 — 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· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) crates/perry-hir/src/lower/expr_assign.rs:32— crates/perry-hir/src/lower/expr_assign.rs:32-47 | crates/perry-hir/src/lower/lower_expr/helpers.rs:308-320 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) crates/perry-ext-net/src/payload_closed.rs:63— crates/perry-ext-net/src/payload_closed.rs:63-80 | crates/perry-ext-net/src/payload_closed.rs:82-100 — 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· Members sharing a duplicated core (15 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (15 members, 50+ identical tokens) crates/perry-codegen/src/expr/calls/crypto_hash.rs:350— crates/perry-codegen/src/expr/calls/crypto_hash.rs:350-378 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:39-57 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:101-132 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:139-173 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:232-262 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:189-211 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:218-245 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:44-84 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:272-288 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:398-417 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:456-495 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:594-621 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:628-646 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:653-675 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:682-708 — These 15 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 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (13 members, 50+ identical tokens) crates/perry-codegen/src/expr/array_pop.rs:46— crates/perry-codegen/src/expr/array_pop.rs:46-236 | crates/perry-codegen/src/expr/array_push.rs:804-1533 | crates/perry-codegen/src/expr/i32_fast_path.rs:1153-1211 | crates/perry-codegen/src/expr/i32_fast_path.rs:1216-1274 | crates/perry-codegen/src/expr/index_get.rs:706-805 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:746-845 | crates/perry-codegen/src/expr/index_set_guarded.rs:223-532 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:103-281 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:293-499 | crates/perry-codegen/src/expr/masked_window.rs:52-61 | crates/perry-codegen/src/expr/masked_window.rs:314-362 | crates/perry-codegen/src/expr/ptr_numarray_access.rs:49-100 | crates/perry-codegen/src/expr/string_window.rs:46-63 — These 13 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 13 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 13 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/perry-codegen/src/codegen/typed_abi.rs:849— crates/perry-codegen/src/codegen/typed_abi.rs:849-880 | crates/perry-codegen/src/codegen/typed_abi.rs:944-996 | crates/perry-codegen/src/codegen/typed_abi.rs:1010-1062 | crates/perry-codegen/src/codegen/typed_abi.rs:1067-1123 | crates/perry-codegen/src/codegen/typed_abi.rs:1139-1195 | crates/perry-codegen/src/codegen/typed_abi.rs:1199-1228 | crates/perry-codegen/src/codegen/typed_abi.rs:1232-1261 | crates/perry-codegen/src/codegen/typed_abi.rs:1263-1292 — 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.
Duplicated block (1243–1283 lines × 2) crates/perry-hir/src/walker/expr_mut.rs:669— crates/perry-hir/src/walker/expr_mut.rs:669-1951 | crates/perry-hir/src/walker/expr_ref.rs:670-1912 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (2–559 lines × 6) crates/perry-codegen/src/collectors/escape_objects.rs:697— crates/perry-codegen/src/collectors/escape_objects.rs:697-699 | crates/perry-hir/src/js_transform/imports.rs:1167-1168 | crates/perry-hir/src/monomorph/driver.rs:705-712 | crates/perry-hir/src/monomorph/update_call_sites.rs:542-549 | crates/perry-hir/src/walker/expr_mut.rs:10-568 | crates/perry-hir/src/walker/expr_ref.rs:11-569 — before extracting anything, compare `crates/perry-hir/src/monomorph/driver.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 578 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (169 lines × 2) crates/perry-codegen/src/collectors/i32_locals.rs:1590— crates/perry-codegen/src/collectors/i32_locals.rs:1590-1758 | crates/perry-codegen/src/collectors/refs.rs:671-839 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (132–153 lines × 2) crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:117— crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:117-269 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:67-198 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` and `crates/perry-hir/src/lower/expr_call/inline_array_methods.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (135–136 lines × 2) crates/perry-codegen/src/collectors/i32_locals.rs:1296— crates/perry-codegen/src/collectors/i32_locals.rs:1296-1430 | crates/perry-codegen/src/collectors/refs.rs:259-394 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (79–117 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:419— crates/perry-hir/src/lower_decl/class_decl.rs:419-535 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:214-292 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (38–105 lines × 2) crates/perry-hir/src/lower/expr_member.rs:436— crates/perry-hir/src/lower/expr_member.rs:436-540 | crates/perry-hir/src/lower/expr_member.rs:640-677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (88–89 lines × 4) crates/perry-hir/src/audit.rs:100— crates/perry-hir/src/audit.rs:100-188 | crates/perry-hir/src/capability.rs:139-226 | crates/perry-hir/src/egress.rs:131-218 | crates/perry-hir/src/lockdown.rs:88-175 — before extracting anything, compare `crates/perry-hir/src/audit.rs` and `crates/perry-hir/src/capability.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (86–87 lines × 2) crates/perry-codegen-js/src/minify.rs:58— crates/perry-codegen-js/src/minify.rs:58-144 | crates/perry-codegen-wasm/src/minify.rs:55-140 — before extracting anything, compare `crates/perry-codegen-js/src/minify.rs` and `crates/perry-codegen-wasm/src/minify.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (70–84 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:992— crates/perry-hir/src/lower_decl/class_decl.rs:992-1075 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:569-638 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (56–69 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:829— crates/perry-hir/src/lower_decl/class_decl.rs:829-897 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:420-475 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (66–68 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:264— crates/perry-hir/src/lower_decl/class_decl.rs:264-331 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:80-145 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (62 lines × 2) crates/perry-codegen/src/collectors/i32_locals.rs:1465— crates/perry-codegen/src/collectors/i32_locals.rs:1465-1526 | crates/perry-codegen/src/collectors/refs.rs:437-498 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (39–58 lines × 2) crates/perry-codegen/src/expr/this_super_call.rs:1415— crates/perry-codegen/src/expr/this_super_call.rs:1415-1472 | crates/perry-codegen/src/expr/this_super_call.rs:1772-1810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (57–58 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:933— crates/perry-hir/src/lower_decl/class_decl.rs:933-990 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:511-567 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (57 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1282— crates/perry-codegen/src/dialect/mod.rs:1282-1338 | crates/perry-codegen/src/dialect/mod.rs:1392-1448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (51–53 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1391— crates/perry-codegen/src/codegen/closure.rs:1391-1441 | crates/perry-codegen/src/codegen/entry.rs:1001-1053 | crates/perry-codegen/src/codegen/entry/module_init.rs:481-533 | crates/perry-codegen/src/codegen/function.rs:1500-1550 | crates/perry-codegen/src/codegen/method.rs:782-832 | crates/perry-codegen/src/codegen/method_static.rs:457-507 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21–51 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:372— crates/perry-hir/src/lower_decl/class_decl.rs:372-422 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:185-205 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (46–49 lines × 2) crates/perry-codegen/src/expr/arrays_finds.rs:1119— crates/perry-codegen/src/expr/arrays_finds.rs:1119-1167 | crates/perry-codegen/src/expr/arrays_finds.rs:1217-1262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (48–49 lines × 2) crates/perry-codegen/src/stmt/region_loop/plan.rs:898— crates/perry-codegen/src/stmt/region_loop/plan.rs:898-946 | crates/perry-codegen/src/stmt/region_loop/plan.rs:1012-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (44–49 lines × 2) crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:168— crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:168-216 | crates/perry-hir/src/lower_decl/fn_decl.rs:283-326 — before extracting anything, compare `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (43–47 lines × 2) crates/perry-codegen/src/lower_string_method.rs:37— crates/perry-codegen/src/lower_string_method.rs:37-79 | crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:294-340 — 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 (42–46 lines × 2) crates/perry-codegen-js/src/minify.rs:11— crates/perry-codegen-js/src/minify.rs:11-56 | crates/perry-codegen-wasm/src/minify.rs:11-52 — before extracting anything, compare `crates/perry-codegen-js/src/minify.rs` and `crates/perry-codegen-wasm/src/minify.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–46 lines × 2) crates/perry-hir/src/lower/expr_object.rs:1345— crates/perry-hir/src/lower/expr_object.rs:1345-1389 | crates/perry-hir/src/lower/expr_object.rs:1608-1653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41–46 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1693— crates/perry-hir/src/lower/stmt_loops.rs:1693-1738 | crates/perry-hir/src/lower_decl/body_stmt.rs:2179-2219 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–44 lines × 2) crates/perry-codegen-swiftui/src/emit.rs:351— crates/perry-codegen-swiftui/src/emit.rs:351-394 | crates/perry-codegen-swiftui/src/emit.rs:461-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.
Duplicated block (43 lines × 3) crates/perry-codegen/src/collectors/all_pointer_arrays.rs:200— crates/perry-codegen/src/collectors/all_pointer_arrays.rs:200-242 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:1263-1305 | crates/perry-codegen/src/collectors/ptr_shape_returns.rs:770-812 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (37–43 lines × 2) crates/perry-hir/src/destructuring/pattern_binding.rs:492— crates/perry-hir/src/destructuring/pattern_binding.rs:492-528 | crates/perry-hir/src/destructuring/pattern_binding.rs:787-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40–41 lines × 2) crates/perry-codegen-arkts/src/widgets/scroll.rs:39— crates/perry-codegen-arkts/src/widgets/scroll.rs:39-79 | crates/perry-codegen-arkts/src/widgets/structure.rs:33-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (41 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1279— crates/perry-hir/src/lower/stmt_loops.rs:1279-1319 | crates/perry-hir/src/lower_decl/body_stmt.rs:1772-1812 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–40 lines × 2) crates/perry-hir/src/lower/stmt.rs:935— crates/perry-hir/src/lower/stmt.rs:935-974 | crates/perry-hir/src/lower_decl/body_stmt.rs:301-332 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (38 lines × 2) crates/perry-codegen/src/collectors/i32_locals.rs:1549— crates/perry-codegen/src/collectors/i32_locals.rs:1549-1586 | crates/perry-codegen/src/collectors/refs.rs:558-595 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33–38 lines × 2) crates/perry-hir/src/lower/module_decl.rs:1339— crates/perry-hir/src/lower/module_decl.rs:1339-1371 | crates/perry-hir/src/lower/module_decl.rs:1851-1888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (36–37 lines × 2) crates/perry-codegen/src/collectors/escape_check.rs:496— crates/perry-codegen/src/collectors/escape_check.rs:496-531 | crates/perry-codegen/src/collectors/escape_news.rs:332-368 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_check.rs` and `crates/perry-codegen/src/collectors/escape_news.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (34–37 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1027— crates/perry-hir/src/lower/stmt_loops.rs:1027-1063 | crates/perry-hir/src/lower_decl/body_stmt.rs:1279-1312 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–36 lines × 2) crates/perry-codegen/src/expr/v8_interop.rs:80— crates/perry-codegen/src/expr/v8_interop.rs:80-108 | crates/perry-codegen/src/expr/v8_interop.rs:174-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (36 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:594— crates/perry-hir/src/lower/stmt_loops.rs:594-629 | crates/perry-hir/src/lower_decl/body_stmt/for_await.rs:37-72 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt/for_await.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–36 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:706— crates/perry-hir/src/lower/stmt_loops.rs:706-741 | crates/perry-hir/src/lower_decl/body_stmt.rs:1449-1480 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–35 lines × 6) crates/perry-codegen/src/codegen/closure.rs:1298— crates/perry-codegen/src/codegen/closure.rs:1298-1332 | crates/perry-codegen/src/codegen/entry.rs:904-937 | crates/perry-codegen/src/codegen/entry/module_init.rs:384-417 | crates/perry-codegen/src/codegen/function.rs:1404-1438 | crates/perry-codegen/src/codegen/method.rs:689-723 | crates/perry-codegen/src/codegen/method_static.rs:364-398 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32–35 lines × 2) crates/perry-hir/src/lower_decl/class_members.rs:622— crates/perry-hir/src/lower_decl/class_members.rs:622-656 | crates/perry-hir/src/lower_decl/private_members.rs:181-212 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_members.rs` and `crates/perry-hir/src/lower_decl/private_members.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25–34 lines × 3) crates/perry-hir/src/lower/expr_function.rs:661— crates/perry-hir/src/lower/expr_function.rs:661-694 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:105-133 | crates/perry-hir/src/lower_decl/private_members.rs:126-150 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/perry-codegen/src/expr/helpers.rs:442— crates/perry-codegen/src/expr/helpers.rs:442-475 | crates/perry-hir/src/analysis/builtins.rs:47-80 — 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 (30–34 lines × 2) crates/perry-hir/src/lower/expr_assign.rs:1258— crates/perry-hir/src/lower/expr_assign.rs:1258-1287 | crates/perry-hir/src/lower/expr_assign.rs:1459-1492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–34 lines × 2) crates/perry-hir/src/lower/stmt.rs:1282— crates/perry-hir/src/lower/stmt.rs:1282-1310 | crates/perry-hir/src/lower_decl/body_stmt.rs:812-845 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–33 lines × 4) crates/perry-codegen/src/lower_call/native/mod.rs:395— crates/perry-codegen/src/lower_call/native/mod.rs:395-427 | crates/perry-codegen/src/lower_call/native/mod.rs:450-482 | crates/perry-codegen/src/lower_call/native/mod.rs:520-551 | crates/perry-codegen/src/lower_call/native/mod.rs:573-604 — 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 (27–33 lines × 2) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1208— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1208-1240 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1250-1276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2) crates/perry-hir/src/lower/expr_call/globals.rs:766— crates/perry-hir/src/lower/expr_call/globals.rs:766-797 | crates/perry-hir/src/lower/expr_call/module_static.rs:343-374 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26–32 lines × 2) crates/perry-hir/src/lower/expr_function.rs:302— crates/perry-hir/src/lower/expr_function.rs:302-333 | crates/perry-hir/src/lower_decl/fn_decl.rs:169-194 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (27–32 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:857— crates/perry-hir/src/lower/stmt_loops.rs:857-888 | crates/perry-hir/src/lower_decl/body_stmt.rs:1579-1605 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–32 lines × 2) crates/perry-hir/src/lower_patterns.rs:1147— crates/perry-hir/src/lower_patterns.rs:1147-1176 | crates/perry-hir/src/lower_patterns.rs:1221-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.
Duplicated block (27–31 lines × 2) crates/perry-codegen-arkts/src/widgets/stack.rs:84— crates/perry-codegen-arkts/src/widgets/stack.rs:84-114 | crates/perry-codegen-arkts/src/widgets/structure.rs:66-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (22–31 lines × 2) crates/perry-codegen/src/expr/logical_collections.rs:1385— crates/perry-codegen/src/expr/logical_collections.rs:1385-1406 | crates/perry-codegen/src/expr/logical_collections.rs:1422-1452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–31 lines × 2) crates/perry-hir/src/lower/expr_object.rs:1433— crates/perry-hir/src/lower/expr_object.rs:1433-1453 | crates/perry-hir/src/lower/expr_object.rs:1652-1682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2) crates/perry-hir/src/monomorph/update_call_sites.rs:580— crates/perry-hir/src/monomorph/update_call_sites.rs:580-610 | crates/perry-hir/src/monomorph/update_call_sites.rs:638-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 4) crates/perry-codegen/src/lower_call/early_branches.rs:817— crates/perry-codegen/src/lower_call/early_branches.rs:817-845 | crates/perry-codegen/src/lower_call/early_branches.rs:918-946 | crates/perry-codegen/src/lower_call/early_branches.rs:1022-1050 | crates/perry-codegen/src/lower_call/early_branches.rs:1129-1157 — 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 (27–29 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1356— crates/perry-hir/src/lower/stmt_loops.rs:1356-1384 | crates/perry-hir/src/lower_decl/body_stmt.rs:1828-1854 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–28 lines × 3) crates/perry-codegen/src/codegen/split_regions_facts.rs:60— crates/perry-codegen/src/codegen/split_regions_facts.rs:60-86 | crates/perry-codegen/src/scope_env/analysis.rs:314-340 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1314-1341 — before extracting anything, compare `crates/perry-codegen/src/codegen/split_regions_facts.rs` and `crates/perry-hir/src/lower/shared_mutable_capture.rs` as WHOLE FILES: this scan already matched 3 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 (28 lines × 2) crates/perry-codegen/src/codegen/entry.rs:1180— crates/perry-codegen/src/codegen/entry.rs:1180-1207 | crates/perry-codegen/src/codegen/entry/module_init.rs:648-675 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–28 lines × 2) crates/perry-codegen/src/expr/static_method.rs:617— crates/perry-codegen/src/expr/static_method.rs:617-644 | crates/perry-codegen/src/lower_call/namespace_call.rs:315-327 — before extracting anything, compare `crates/perry-codegen/src/expr/static_method.rs` and `crates/perry-codegen/src/lower_call/namespace_call.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–28 lines × 2) crates/perry-codegen/src/expr/static_method.rs:692— crates/perry-codegen/src/expr/static_method.rs:692-706 | crates/perry-codegen/src/lower_call/namespace_call.rs:382-409 — before extracting anything, compare `crates/perry-codegen/src/expr/static_method.rs` and `crates/perry-codegen/src/lower_call/namespace_call.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–28 lines × 2) crates/perry-codegen/src/module.rs:1001— crates/perry-codegen/src/module.rs:1001-1020 | crates/perry-codegen/src/module.rs:1043-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 (22–27 lines × 2) crates/perry-codegen/src/stmt/let_stmt.rs:1506— crates/perry-codegen/src/stmt/let_stmt.rs:1506-1532 | crates/perry-codegen/src/stmt/let_stmt.rs:1533-1554 — both copies are in the same file, so extract the block into 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–27 lines × 2) crates/perry-codegen/src/typed_shape.rs:173— crates/perry-codegen/src/typed_shape.rs:173-186 | crates/perry-codegen/src/typed_shape.rs:204-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–27 lines × 2) crates/perry-ext-http/src/server/server.rs:1313— crates/perry-ext-http/src/server/server.rs:1313-1329 | crates/perry-ext-http/src/server/server.rs:1359-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–27 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1498— crates/perry-hir/src/lower/stmt_loops.rs:1498-1524 | crates/perry-hir/src/lower_decl/body_stmt.rs:1983-2008 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–27 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1527— crates/perry-hir/src/lower/stmt_loops.rs:1527-1551 | crates/perry-hir/src/lower_decl/body_stmt.rs:2011-2037 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–26 lines × 4) crates/perry-hir/src/monomorph/infer.rs:287— crates/perry-hir/src/monomorph/infer.rs:287-312 | crates/perry-hir/src/monomorph/infer.rs:396-421 | crates/perry-hir/src/monomorph/update_call_sites.rs:600-621 | crates/perry-hir/src/monomorph/update_call_sites.rs:658-679 — before extracting anything, compare `crates/perry-hir/src/monomorph/infer.rs` and `crates/perry-hir/src/monomorph/update_call_sites.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–26 lines × 3) crates/perry-codegen/src/lower_call/early_branches.rs:452— crates/perry-codegen/src/lower_call/early_branches.rs:452-477 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:444-450 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1100-1106 — 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 (23–26 lines × 2) crates/perry-codegen/src/dialect/mod.rs:1106— crates/perry-codegen/src/dialect/mod.rs:1106-1128 | crates/perry-codegen/src/dialect/mod.rs:1645-1670 — both copies are in the same file, so extract the block into 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–26 lines × 2) crates/perry-codegen/src/stmt/loops.rs:8526— crates/perry-codegen/src/stmt/loops.rs:8526-8551 | crates/perry-codegen/src/stmt/loops.rs:8586-8601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–26 lines × 2) crates/perry-component-host/src/async_values/reader.rs:39— crates/perry-component-host/src/async_values/reader.rs:39-64 | crates/perry-component-host/src/async_values/writer.rs:31-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (26 lines × 2) crates/perry-ext-http/src/server/http2_server/controls.rs:131— crates/perry-ext-http/src/server/http2_server/controls.rs:131-156 | crates/perry-ext-http/src/server/http2_server/controls.rs:198-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.
Duplicated block (20–26 lines × 2) crates/perry-hir/src/lower/expr_function.rs:1379— crates/perry-hir/src/lower/expr_function.rs:1379-1398 | crates/perry-hir/src/lower/expr_object.rs:344-369 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower/expr_object.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 5) crates/perry-codegen/src/lower_call/method_override.rs:1277— crates/perry-codegen/src/lower_call/method_override.rs:1277-1301 | crates/perry-codegen/src/lower_call/method_override.rs:1362-1386 | crates/perry-codegen/src/lower_call/method_override.rs:1447-1471 | crates/perry-codegen/src/lower_call/method_override.rs:1534-1558 | crates/perry-codegen/src/lower_call/method_override.rs:1622-1646 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25 lines × 4) crates/perry-codegen/src/collectors/refs.rs:609— crates/perry-codegen/src/collectors/refs.rs:609-633 | crates/perry-hir/src/js_transform/imports.rs:1248-1272 | crates/perry-hir/src/walker/expr_mut.rs:1879-1903 | crates/perry-hir/src/walker/expr_ref.rs:1850-1874 — before extracting anything, compare `crates/perry-hir/src/walker/expr_mut.rs` and `crates/perry-hir/src/walker/expr_ref.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 2017 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (24–25 lines × 3) crates/perry-codegen/src/codegen/closure.rs:1170— crates/perry-codegen/src/codegen/closure.rs:1170-1193 | crates/perry-codegen/src/codegen/function.rs:1317-1341 | crates/perry-codegen/src/codegen/method.rs:605-629 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/function.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 320 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–25 lines × 2) crates/perry-codegen/src/expr/url_main.rs:502— crates/perry-codegen/src/expr/url_main.rs:502-526 | crates/perry-codegen/src/expr/url_main.rs:596-607 — both copies are in the same file, so extract the block into 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–25 lines × 2) crates/perry-ext-http/src/server/turnloop_serve/conn.rs:1115— crates/perry-ext-http/src/server/turnloop_serve/conn.rs:1115-1139 | crates/perry-http-server/src/conn.rs:898-917 — before extracting anything, compare `crates/perry-ext-http/src/server/turnloop_serve/conn.rs` and `crates/perry-http-server/src/conn.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23–25 lines × 2) crates/perry-hir/src/lower/expr_function.rs:339— crates/perry-hir/src/lower/expr_function.rs:339-361 | crates/perry-hir/src/lower_decl/fn_decl.rs:196-220 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 3) crates/perry-hir/src/lower_decl/class_captures.rs:723— crates/perry-hir/src/lower_decl/class_captures.rs:723-746 | crates/perry-hir/src/lower_decl/class_captures.rs:770-793 | crates/perry-hir/src/lower_decl/class_captures.rs:821-844 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18–24 lines × 2) crates/perry-codegen/src/codegen/mod.rs:1464— crates/perry-codegen/src/codegen/mod.rs:1464-1481 | crates/perry-codegen/src/codegen/mod.rs:1648-1671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–24 lines × 2) crates/perry-codegen/src/collectors/escape_check.rs:301— crates/perry-codegen/src/collectors/escape_check.rs:301-324 | crates/perry-codegen/src/collectors/escape_check.rs:339-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–24 lines × 2) crates/perry-codegen/src/lower_call/extern_func.rs:1518— crates/perry-codegen/src/lower_call/extern_func.rs:1518-1531 | crates/perry-codegen/src/lower_call/func_ref.rs:990-1013 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–24 lines × 2) crates/perry-hir/src/lower/expr_assign.rs:1021— crates/perry-hir/src/lower/expr_assign.rs:1021-1039 | crates/perry-hir/src/lower/expr_member/member_tail.rs:901-924 — 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 (15–24 lines × 2) crates/perry-hir/src/lower/expr_function.rs:625— crates/perry-hir/src/lower/expr_function.rs:625-648 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:83-97 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–24 lines × 2) crates/perry-hir/src/lower_decl/class_decl.rs:762— crates/perry-hir/src/lower_decl/class_decl.rs:762-785 | crates/perry-hir/src/lower_decl/class_decl/from_ast.rs:360-376 — before extracting anything, compare `crates/perry-hir/src/lower_decl/class_decl.rs` and `crates/perry-hir/src/lower_decl/class_decl/from_ast.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 548 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–23 lines × 4) crates/perry-codegen/src/collectors/typed_locals.rs:346— crates/perry-codegen/src/collectors/typed_locals.rs:346-368 | crates/perry-codegen/src/stmt/region_loop/plan.rs:736-757 | crates/perry-codegen/src/type_analysis/numeric.rs:293-314 | crates/perry-codegen/src/type_analysis/numeric.rs:813-835 — 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 (21–23 lines × 2) crates/perry-codegen/src/codegen/mod.rs:1545— crates/perry-codegen/src/codegen/mod.rs:1545-1567 | crates/perry-codegen/src/codegen/mod.rs:1691-1711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–23 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:767— crates/perry-hir/src/lower/stmt_loops.rs:767-789 | crates/perry-hir/src/lower_decl/body_stmt.rs:1503-1518 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–22 lines × 4) crates/perry-codegen/src/codegen/closure.rs:1593— crates/perry-codegen/src/codegen/closure.rs:1593-1609 | crates/perry-codegen/src/codegen/entry.rs:1477-1493 | crates/perry-codegen/src/codegen/entry/module_init.rs:686-707 | crates/perry-codegen/src/codegen/function.rs:1819-1835 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–22 lines × 2) crates/perry-codegen/src/type_analysis/strings.rs:402— crates/perry-codegen/src/type_analysis/strings.rs:402-419 | crates/perry-codegen/src/type_analysis/strings.rs:798-819 — both copies are in the same file, so extract the block into 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–22 lines × 2) crates/perry-hir/src/lower/expr_call/globals.rs:855— crates/perry-hir/src/lower/expr_call/globals.rs:855-869 | crates/perry-hir/src/lower/expr_call/module_static.rs:239-260 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/globals.rs` and `crates/perry-hir/src/lower/expr_call/module_static.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–21 lines × 8) crates/perry-codegen/src/expr/binary.rs:1068— crates/perry-codegen/src/expr/binary.rs:1068-1076 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:374-382 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:392-398 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:725-745 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:761-770 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:845-852 | crates/perry-codegen/src/expr/ta_element_read.rs:327-334 | crates/perry-codegen/src/expr/ta_param_f64_read.rs:337-346 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (21 lines × 5) crates/perry-codegen/src/collectors/integer_locals.rs:623— crates/perry-codegen/src/collectors/integer_locals.rs:623-643 | crates/perry-codegen/src/collectors/ptr_numarray.rs:607-627 | crates/perry-codegen/src/collectors/ptr_shape.rs:1331-1351 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:831-851 | crates/perry-codegen/src/collectors/sealed_buffers.rs:487-507 — before extracting anything, compare `crates/perry-codegen/src/collectors/integer_locals.rs` and `crates/perry-codegen/src/collectors/ptr_numarray.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–21 lines × 4) crates/perry-codegen/src/expr/this_super_call.rs:1179— crates/perry-codegen/src/expr/this_super_call.rs:1179-1199 | crates/perry-codegen/src/expr/this_super_call.rs:1218-1232 | crates/perry-codegen/src/expr/this_super_call.rs:1252-1266 | crates/perry-codegen/src/expr/this_super_call.rs:1285-1301 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 3) crates/perry-codegen/src/codegen/entry.rs:882— crates/perry-codegen/src/codegen/entry.rs:882-902 | crates/perry-codegen/src/codegen/entry/module_init.rs:362-382 | crates/perry-codegen/src/codegen/method_static.rs:341-361 — before extracting anything, compare `crates/perry-codegen/src/codegen/entry.rs` and `crates/perry-codegen/src/codegen/entry/module_init.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 473 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-codegen/src/expr/this_super_call.rs:929— crates/perry-codegen/src/expr/this_super_call.rs:929-945 | crates/perry-codegen/src/expr/this_super_call.rs:953-969 | crates/perry-codegen/src/expr/this_super_call.rs:979-999 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–21 lines × 3) crates/perry-codegen/src/type_analysis/strings.rs:402— crates/perry-codegen/src/type_analysis/strings.rs:402-417 | crates/perry-codegen/src/type_analysis/strings.rs:589-600 | crates/perry-codegen/src/type_analysis/strings.rs:797-817 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19–21 lines × 3) crates/perry-ext-http/src/server/http2_server/pump.rs:60— crates/perry-ext-http/src/server/http2_server/pump.rs:60-78 | crates/perry-ext-http/src/server/https_server.rs:482-500 | crates/perry-ext-http/src/server/server.rs:1342-1362 — before extracting anything, compare `crates/perry-ext-http/src/server/http2_server/pump.rs` and `crates/perry-ext-http/src/server/https_server.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–21 lines × 2) crates/perry-codegen/src/expr/index_get.rs:1018— crates/perry-codegen/src/expr/index_get.rs:1018-1038 | crates/perry-codegen/src/expr/index_get.rs:1063-1075 — both copies are in the same file, so extract the block into 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–21 lines × 2) crates/perry-codegen/src/expr/logical_collections.rs:1172— crates/perry-codegen/src/expr/logical_collections.rs:1172-1192 | crates/perry-codegen/src/expr/logical_collections.rs:1223-1238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–20 lines × 6) crates/perry-hir/src/lower/stmt.rs:1355— crates/perry-hir/src/lower/stmt.rs:1355-1373 | crates/perry-hir/src/lower/stmt.rs:1426-1441 | crates/perry-hir/src/lower/stmt.rs:1476-1493 | crates/perry-hir/src/lower_decl/body_stmt.rs:889-908 | crates/perry-hir/src/lower_decl/body_stmt.rs:960-976 | crates/perry-hir/src/lower_decl/body_stmt.rs:1012-1030 — before extracting anything, compare `crates/perry-hir/src/lower/stmt.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 308 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/perry-codegen/src/collectors/ptr_numarray.rs:654— crates/perry-codegen/src/collectors/ptr_numarray.rs:654-673 | crates/perry-codegen/src/collectors/ptr_shape.rs:1378-1397 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:886-905 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–20 lines × 2) crates/perry-codegen/src/codegen/closure_collect.rs:676— crates/perry-codegen/src/codegen/closure_collect.rs:676-695 | crates/perry-codegen/src/codegen/closure_collect.rs:704-717 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/perry-codegen/src/expr/pod_record.rs:314— crates/perry-codegen/src/expr/pod_record.rs:314-329 | crates/perry-codegen/src/expr/pod_record.rs:422-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) crates/perry-codegen/src/lower_call/early_branches.rs:556— crates/perry-codegen/src/lower_call/early_branches.rs:556-573 | crates/perry-codegen/src/lower_call/early_branches.rs:1195-1214 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/perry-hir/src/destructuring/var_decl.rs:187— crates/perry-hir/src/destructuring/var_decl.rs:187-206 | crates/perry-hir/src/destructuring/var_decl.rs:528-537 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:1440— crates/perry-hir/src/lower/stmt_loops.rs:1440-1459 | crates/perry-hir/src/lower_decl/body_stmt.rs:1937-1951 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 5) crates/perry-codegen/src/collectors/integer_locals.rs:655— crates/perry-codegen/src/collectors/integer_locals.rs:655-673 | crates/perry-codegen/src/collectors/proven_args.rs:275-293 | crates/perry-codegen/src/collectors/ptr_numarray.rs:639-657 | crates/perry-codegen/src/collectors/ptr_shape.rs:1363-1381 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:871-889 — before extracting anything, compare `crates/perry-codegen/src/collectors/integer_locals.rs` and `crates/perry-codegen/src/collectors/ptr_numarray.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–19 lines × 2) crates/perry-codegen-glance/src/emit_glue.rs:30— crates/perry-codegen-glance/src/emit_glue.rs:30-48 | crates/perry-codegen-wear-tiles/src/emit_glue.rs:27-41 — before extracting anything, compare `crates/perry-codegen-glance/src/emit_glue.rs` and `crates/perry-codegen-wear-tiles/src/emit_glue.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 (16–19 lines × 2) crates/perry-codegen/src/collectors/ptr_shape.rs:1453— crates/perry-codegen/src/collectors/ptr_shape.rs:1453-1471 | crates/perry-codegen/src/collectors/ptr_shape.rs:1504-1519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–19 lines × 2) crates/perry-hir/src/lower/stmt_loops.rs:670— crates/perry-hir/src/lower/stmt_loops.rs:670-688 | crates/perry-hir/src/lower_decl/body_stmt.rs:1420-1431 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 540 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 5) crates/perry-codegen/src/codegen/closure.rs:1266— crates/perry-codegen/src/codegen/closure.rs:1266-1283 | crates/perry-codegen/src/codegen/entry.rs:873-890 | crates/perry-codegen/src/codegen/entry/module_init.rs:353-370 | crates/perry-codegen/src/codegen/method.rs:657-674 | crates/perry-codegen/src/codegen/method_static.rs:332-349 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 5) crates/perry-codegen/src/lower_call/native/mod.rs:408— crates/perry-codegen/src/lower_call/native/mod.rs:408-425 | crates/perry-codegen/src/lower_call/native/mod.rs:463-480 | crates/perry-codegen/src/lower_call/native/mod.rs:533-549 | crates/perry-codegen/src/lower_call/native/mod.rs:586-602 | crates/perry-codegen/src/lower_call/web_storage.rs:53-70 — before extracting anything, compare `crates/perry-codegen/src/lower_call/native/mod.rs` and `crates/perry-codegen/src/lower_call/web_storage.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 (18 lines × 3) crates/perry-codegen/src/collectors/integer_locals.rs:215— crates/perry-codegen/src/collectors/integer_locals.rs:215-232 | crates/perry-codegen/src/collectors/segview.rs:545-562 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1287-1304 — before extracting anything, compare `crates/perry-codegen/src/collectors/segview.rs` and `crates/perry-hir/src/lower/shared_mutable_capture.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–18 lines × 3) crates/perry-codegen/src/stmt/let_stmt.rs:1018— crates/perry-codegen/src/stmt/let_stmt.rs:1018-1034 | crates/perry-codegen/src/stmt/let_stmt.rs:1174-1191 | crates/perry-codegen/src/stmt/let_stmt.rs:1365-1381 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–18 lines × 2) crates/perry-codegen/src/codegen/export_value_wrappers.rs:259— crates/perry-codegen/src/codegen/export_value_wrappers.rs:259-276 | crates/perry-codegen/src/codegen/export_value_wrappers.rs:365-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–18 lines × 2) crates/perry-hir/src/lower/expr_object.rs:210— crates/perry-hir/src/lower/expr_object.rs:210-227 | crates/perry-hir/src/lower/expr_object.rs:542-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–18 lines × 2) crates/perry-hir/src/lower/expr_object.rs:241— crates/perry-hir/src/lower/expr_object.rs:241-258 | crates/perry-hir/src/lower_decl/fn_decl.rs:113-121 — before extracting anything, compare `crates/perry-hir/src/lower/expr_object.rs` and `crates/perry-hir/src/lower_decl/fn_decl.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–17 lines × 6) crates/perry-hir/src/lower/expr_function.rs:665— crates/perry-hir/src/lower/expr_function.rs:665-681 | crates/perry-hir/src/lower/expr_object.rs:267-280 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:109-122 | crates/perry-hir/src/lower_decl/class_members.rs:541-552 | crates/perry-hir/src/lower_decl/fn_decl.rs:132-142 | crates/perry-hir/src/lower_decl/private_members.rs:130-139 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower/expr_object.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–17 lines × 3) crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:334— crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:334-342 | crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:414-430 | crates/perry-codegen/src/collectors/ptr_shape_this_flow.rs:451-459 — 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–17 lines × 4) crates/perry-hir/src/audit.rs:318— crates/perry-hir/src/audit.rs:318-334 | crates/perry-hir/src/capability.rs:312-328 | crates/perry-hir/src/ir/constants.rs:482-498 | crates/perry-hir/src/ir/constants.rs:505-509 — before extracting anything, compare `crates/perry-hir/src/audit.rs` and `crates/perry-hir/src/capability.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–17 lines × 2) crates/perry-codegen-arkts/src/app_extract.rs:59— crates/perry-codegen-arkts/src/app_extract.rs:59-75 | crates/perry-codegen-arkts/src/app_extract.rs:85-99 — both copies are in the same file, so extract the block into 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/perry-codegen/src/codegen/method.rs:444— crates/perry-codegen/src/codegen/method.rs:444-454 | crates/perry-codegen/src/codegen/method_static.rs:162-178 — before extracting anything, compare `crates/perry-codegen/src/codegen/method.rs` and `crates/perry-codegen/src/codegen/method_static.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 341 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 5) crates/perry-codegen/src/collectors/integer_locals.rs:664— crates/perry-codegen/src/collectors/integer_locals.rs:664-679 | crates/perry-codegen/src/collectors/ptr_numarray.rs:648-663 | crates/perry-codegen/src/collectors/ptr_shape.rs:1372-1387 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:880-895 | crates/perry-codegen/src/collectors/sealed_buffers.rs:532-547 — before extracting anything, compare `crates/perry-codegen/src/collectors/integer_locals.rs` and `crates/perry-codegen/src/collectors/ptr_numarray.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 4) crates/perry-codegen/src/lower_call/early_branches.rs:768— crates/perry-codegen/src/lower_call/early_branches.rs:768-782 | crates/perry-codegen/src/lower_call/early_branches.rs:868-882 | crates/perry-codegen/src/lower_call/early_branches.rs:970-984 | crates/perry-codegen/src/lower_call/early_branches.rs:1077-1092 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–16 lines × 3) crates/perry-codegen/src/expr/static_method.rs:649— crates/perry-codegen/src/expr/static_method.rs:649-656 | crates/perry-codegen/src/lower_call/extern_func.rs:1420-1427 | crates/perry-codegen/src/lower_call/namespace_call.rs:334-349 — before extracting anything, compare `crates/perry-codegen/src/expr/static_method.rs` and `crates/perry-codegen/src/lower_call/namespace_call.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–16 lines × 2) crates/perry-codegen/src/expr/proven_view_access.rs:324— crates/perry-codegen/src/expr/proven_view_access.rs:324-333 | crates/perry-codegen/src/expr/ta_param_f64_read.rs:304-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (3–16 lines × 4) crates/perry-container-compose/src/backend/apple.rs:72— crates/perry-container-compose/src/backend/apple.rs:72-87 | crates/perry-container-compose/src/backend/apple.rs:143-153 | crates/perry-container-compose/src/backend/docker.rs:93-95 | crates/perry-container-compose/src/backend/docker.rs:161-163 — before extracting anything, compare `crates/perry-container-compose/src/backend/apple.rs` and `crates/perry-container-compose/src/backend/docker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–16 lines × 2) crates/perry-hir/src/lower_decl/body_stmt.rs:988— crates/perry-hir/src/lower_decl/body_stmt.rs:988-998 | crates/perry-hir/src/lower_decl/body_stmt.rs:1036-1051 — both copies are in the same file, so extract the block into 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 × 5) crates/perry-codegen/src/collectors/all_pointer_arrays.rs:220— crates/perry-codegen/src/collectors/all_pointer_arrays.rs:220-232 | crates/perry-codegen/src/collectors/hoisted_callback_calls.rs:86-100 | crates/perry-codegen/src/collectors/ptr_shape_elements.rs:1283-1295 | crates/perry-codegen/src/collectors/ptr_shape_returns.rs:790-802 | crates/perry-codegen/src/layout_desc.rs:614-628 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (14–15 lines × 3) crates/perry-codegen/src/expr/bigint_set.rs:1227— crates/perry-codegen/src/expr/bigint_set.rs:1227-1240 | crates/perry-codegen/src/expr/bigint_set.rs:1485-1498 | crates/perry-codegen/src/expr/math_simple.rs:1023-1037 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/math_simple.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–15 lines × 3) crates/perry-codegen/src/expr/this_super_call.rs:1417— crates/perry-codegen/src/expr/this_super_call.rs:1417-1431 | crates/perry-codegen/src/expr/this_super_call.rs:1774-1785 | crates/perry-codegen/src/lower_call/new_error_init.rs:73-86 — before extracting anything, compare `crates/perry-codegen/src/expr/this_super_call.rs` and `crates/perry-codegen/src/lower_call/new_error_init.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–15 lines × 3) crates/perry-hir/src/lower/stmt_loops.rs:577— crates/perry-hir/src/lower/stmt_loops.rs:577-587 | crates/perry-hir/src/lower/stmt_loops.rs:827-841 | crates/perry-hir/src/lower_decl/body_stmt/for_await.rs:20-30 — before extracting anything, compare `crates/perry-hir/src/lower/stmt_loops.rs` and `crates/perry-hir/src/lower_decl/body_stmt/for_await.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–15 lines × 3) crates/perry-codegen/src/expr/compare.rs:288— crates/perry-codegen/src/expr/compare.rs:288-292 | crates/perry-codegen/src/expr/compare.rs:971-985 | crates/perry-codegen/src/expr/compare_short_string.rs:27-40 — before extracting anything, compare `crates/perry-codegen/src/expr/compare.rs` and `crates/perry-codegen/src/expr/compare_short_string.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–15 lines × 2) crates/perry-ext-http/src/server/https_server.rs:469— crates/perry-ext-http/src/server/https_server.rs:469-479 | crates/perry-ext-http/src/server/https_server.rs:497-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 5) crates/perry-ext-http/src/server/http2_server/pump.rs:71— crates/perry-ext-http/src/server/http2_server/pump.rs:71-83 | crates/perry-ext-http/src/server/https_server.rs:465-478 | crates/perry-ext-http/src/server/https_server.rs:493-505 | crates/perry-ext-http/src/server/server.rs:1309-1322 | crates/perry-ext-http/src/server/server.rs:1355-1367 — before extracting anything, compare `crates/perry-ext-http/src/server/http2_server/pump.rs` and `crates/perry-ext-http/src/server/https_server.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–14 lines × 4) crates/perry-codegen/src/collectors/segview.rs:708— crates/perry-codegen/src/collectors/segview.rs:708-719 | crates/perry-codegen/src/collectors/segview.rs:1329-1340 | crates/perry-hir/src/analysis.rs:547-560 | crates/perry-hir/src/lower_decl/class_captures.rs:72-85 — 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 (10–14 lines × 4) crates/perry-ext-net/src/jsvalue.rs:233— crates/perry-ext-net/src/jsvalue.rs:233-246 | crates/perry-ext-net/src/jsvalue.rs:263-272 | crates/perry-ext-net/src/jsvalue.rs:278-291 | crates/perry-ext-net/src/jsvalue.rs:316-329 — 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–14 lines × 3) crates/perry-codegen/src/collectors/receiver_regions.rs:991— crates/perry-codegen/src/collectors/receiver_regions.rs:991-1004 | crates/perry-codegen/src/loop_purity.rs:142-153 | crates/perry-codegen/src/loop_purity.rs:697-709 — 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 (9–14 lines × 3) crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:488— crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:488-501 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:518-526 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:534-543 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 3) crates/perry-hir/src/lower/expr_call/module_class_static.rs:121— crates/perry-hir/src/lower/expr_call/module_class_static.rs:121-133 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:274-287 | crates/perry-hir/src/lower/expr_call/nested_namespace.rs:349-362 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–14 lines × 3) crates/perry-codegen/src/collectors/escape_arrays.rs:802— crates/perry-codegen/src/collectors/escape_arrays.rs:802-815 | crates/perry-codegen/src/collectors/escape_check.rs:1164-1173 | crates/perry-codegen/src/collectors/escape_objects.rs:663-670 — before extracting anything, compare `crates/perry-codegen/src/collectors/escape_arrays.rs` and `crates/perry-codegen/src/collectors/escape_objects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–14 lines × 3) crates/perry-codegen/src/expr/array_literal.rs:304— crates/perry-codegen/src/expr/array_literal.rs:304-317 | crates/perry-codegen/src/expr/inline_birth/shared.rs:135-144 | crates/perry-codegen/src/lower_call/new_alloc.rs:787-791 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/expr/inline_birth/shared.rs` as WHOLE FILES: this scan already matched 6 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 (12–14 lines × 2) crates/perry-component-host/src/driver/async_values.rs:58— crates/perry-component-host/src/driver/async_values.rs:58-71 | crates/perry-component-host/src/driver/writers.rs:21-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.
Duplicated block (2–14 lines × 3) crates/perry-hir/src/lower/module_decl.rs:580— crates/perry-hir/src/lower/module_decl.rs:580-591 | crates/perry-hir/src/lower/module_decl.rs:1700-1713 | crates/perry-hir/src/lower/module_decl.rs:1791-1792 — 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–13 lines × 10) crates/perry-codegen/src/expr/element_shape_reads.rs:185— crates/perry-codegen/src/expr/element_shape_reads.rs:185-194 | crates/perry-codegen/src/expr/property_get.rs:537-544 | crates/perry-codegen/src/expr/property_get/composed_ics.rs:65-70 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:701-710 | crates/perry-codegen/src/expr/typed_array_rmw.rs:297-304 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:134-139 | crates/perry-codegen/src/lower_conditional.rs:109-115 | crates/perry-codegen/src/lower_string_method/char_code_at.rs:216-228 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:718-725 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1057-1063 — before extracting anything, compare `crates/perry-codegen/src/expr/property_get.rs` and `crates/perry-codegen/src/expr/property_get/generic_dispatch.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 9) crates/perry-codegen/src/lower_call/early_branches.rs:831— crates/perry-codegen/src/lower_call/early_branches.rs:831-843 | crates/perry-codegen/src/lower_call/early_branches.rs:932-944 | crates/perry-codegen/src/lower_call/early_branches.rs:1036-1048 | crates/perry-codegen/src/lower_call/early_branches.rs:1143-1155 | crates/perry-codegen/src/lower_call/func_ref.rs:237-249 | crates/perry-codegen/src/lower_call/func_ref.rs:1161-1173 | crates/perry-codegen/src/lower_call/func_ref.rs:1236-1248 | crates/perry-codegen/src/lower_call/func_ref.rs:1314-1326 | crates/perry-codegen/src/lower_call/func_ref.rs:1405-1417 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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 (8–13 lines × 4) crates/perry-codegen/src/codegen/string_pool.rs:1107— crates/perry-codegen/src/codegen/string_pool.rs:1107-1119 | crates/perry-codegen/src/codegen/string_pool.rs:1184-1193 | crates/perry-codegen/src/codegen/string_pool.rs:1474-1481 | crates/perry-codegen/src/codegen/string_pool.rs:1554-1561 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) crates/perry-codegen/src/collectors/typed_locals.rs:332— crates/perry-codegen/src/collectors/typed_locals.rs:332-343 | crates/perry-codegen/src/stmt/region_loop/plan.rs:723-735 | crates/perry-codegen/src/type_analysis/numeric.rs:278-290 | crates/perry-codegen/src/type_analysis/numeric.rs:798-810 — 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 (10–13 lines × 4) crates/perry-codegen/src/expr/array_pop.rs:79— crates/perry-codegen/src/expr/array_pop.rs:79-91 | crates/perry-codegen/src/expr/array_pop.rs:138-148 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:244-254 | crates/perry-codegen/src/stmt/loops.rs:3317-3326 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.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.
Duplicated block (9–13 lines × 4) crates/perry-codegen/src/expr/folded_builtin_override.rs:872— crates/perry-codegen/src/expr/folded_builtin_override.rs:872-883 | crates/perry-codegen/src/expr/static_method.rs:528-536 | crates/perry-codegen/src/lower_call/property_get.rs:276-287 | crates/perry-codegen/src/lower_call/property_get/builtin_kind_guard.rs:464-476 — before extracting anything, compare `crates/perry-codegen/src/expr/folded_builtin_override.rs` and `crates/perry-codegen/src/expr/static_method.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 (10–13 lines × 3) crates/perry-codegen/src/expr/this_super_call.rs:1437— crates/perry-codegen/src/expr/this_super_call.rs:1437-1449 | crates/perry-codegen/src/expr/this_super_call.rs:1790-1799 | crates/perry-codegen/src/lower_call/new_error_init.rs:90-100 — before extracting anything, compare `crates/perry-codegen/src/expr/this_super_call.rs` and `crates/perry-codegen/src/lower_call/new_error_init.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–13 lines × 3) crates/perry-hir/src/js_transform/local_natives.rs:999— crates/perry-hir/src/js_transform/local_natives.rs:999-1009 | crates/perry-hir/src/js_transform/local_natives.rs:1091-1103 | crates/perry-hir/src/js_transform/local_natives.rs:1118-1128 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) crates/perry-hir/src/lower/expr_call/local_array_methods.rs:1146— crates/perry-hir/src/lower/expr_call/local_array_methods.rs:1146-1157 | crates/perry-hir/src/lower/expr_call/textencoder.rs:68-80 | crates/perry-hir/src/lower/expr_call/textencoder.rs:105-116 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–12 lines × 12) crates/perry-codegen/src/expr/env_clones.rs:110— crates/perry-codegen/src/expr/env_clones.rs:110-117 | crates/perry-codegen/src/expr/misc_methods.rs:378-385 | crates/perry-codegen/src/expr/misc_methods.rs:427-434 | crates/perry-codegen/src/expr/misc_methods.rs:489-496 | crates/perry-codegen/src/expr/misc_methods.rs:510-517 | crates/perry-codegen/src/expr/misc_methods.rs:531-538 | crates/perry-codegen/src/expr/misc_methods.rs:630-641 | crates/perry-codegen/src/expr/os_uri_dates.rs:214-221 | crates/perry-codegen/src/expr/os_uri_dates.rs:279-286 | crates/perry-codegen/src/expr/os_uri_dates.rs:339-346 | crates/perry-codegen/src/expr/string_regex_proc.rs:515-526 | crates/perry-codegen/src/expr/super_method.rs:92-99 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 12) crates/perry-codegen/src/lower_call/early_branches.rs:559— crates/perry-codegen/src/lower_call/early_branches.rs:559-570 | crates/perry-codegen/src/lower_call/early_branches.rs:831-842 | crates/perry-codegen/src/lower_call/early_branches.rs:932-943 | crates/perry-codegen/src/lower_call/early_branches.rs:1036-1047 | crates/perry-codegen/src/lower_call/early_branches.rs:1143-1154 | crates/perry-codegen/src/lower_call/early_branches.rs:1198-1209 | crates/perry-codegen/src/lower_call/func_ref.rs:237-248 | crates/perry-codegen/src/lower_call/func_ref.rs:1161-1172 | crates/perry-codegen/src/lower_call/func_ref.rs:1236-1247 | crates/perry-codegen/src/lower_call/func_ref.rs:1314-1325 | crates/perry-codegen/src/lower_call/func_ref.rs:1405-1416 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:182-193 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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–12 lines × 6) crates/perry-ext-ws/src/lib.rs:1584— crates/perry-ext-ws/src/lib.rs:1584-1595 | crates/perry-ext-ws/src/lib.rs:1662-1671 | crates/perry-ext-ws/src/lib.rs:1678-1687 | crates/perry-ext-ws/src/lib.rs:1731-1742 | crates/perry-ext-ws/src/lib.rs:1753-1761 | crates/perry-ext-ws/src/lib.rs:1768-1776 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–12 lines × 4) crates/perry-codegen/src/expr/array_literal.rs:311— crates/perry-codegen/src/expr/array_literal.rs:311-322 | crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs:49-57 | crates/perry-codegen/src/expr/inline_birth/shared.rs:141-149 | crates/perry-codegen/src/lower_call/new_alloc.rs:886-894 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–12 lines × 4) crates/perry-hir/src/js_transform/local_natives.rs:945— crates/perry-hir/src/js_transform/local_natives.rs:945-954 | crates/perry-hir/src/js_transform/local_natives.rs:976-987 | crates/perry-hir/src/js_transform/local_natives.rs:1001-1012 | crates/perry-hir/src/js_transform/local_natives.rs:1047-1056 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–12 lines × 3) crates/perry-codegen/src/stmt/loops.rs:3380— crates/perry-codegen/src/stmt/loops.rs:3380-3386 | crates/perry-codegen/src/stmt/loops.rs:3484-3495 | crates/perry-codegen/src/stmt/masked_window_region.rs:974-985 — before extracting anything, compare `crates/perry-codegen/src/stmt/loops.rs` and `crates/perry-codegen/src/stmt/masked_window_region.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 (2–12 lines × 4) crates/perry-hir/src/dynamic_import.rs:322— crates/perry-hir/src/dynamic_import.rs:322-333 | crates/perry-hir/src/dynamic_import.rs:394-405 | crates/perry-hir/src/dynamic_import.rs:453-464 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1132-1133 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–12 lines × 3) crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:147— crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:147-158 | crates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rs:469-477 | crates/perry-hir/src/lower/expr_call/intrinsics/namespace_static.rs:248-255 — 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–12 lines × 2) crates/perry-codegen/src/block.rs:1712— crates/perry-codegen/src/block.rs:1712-1723 | crates/perry-codegen/src/block.rs:1762-1768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–12 lines × 3) crates/perry-codegen/src/lower_call/direct_method_guard.rs:80— crates/perry-codegen/src/lower_call/direct_method_guard.rs:80-91 | crates/perry-codegen/src/lower_call/method_override.rs:292-294 | crates/perry-codegen/src/lower_call/method_override.rs:416-423 — before extracting anything, compare `crates/perry-codegen/src/lower_call/direct_method_guard.rs` and `crates/perry-codegen/src/lower_call/method_override.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. If that is what happened, the fix is to keep one copy and have the 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–12 lines × 2) crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1750— crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1750-1758 | crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs:1886-1897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 15) crates/perry-codegen/src/lower_call/early_branches.rs:787— crates/perry-codegen/src/lower_call/early_branches.rs:787-797 | crates/perry-codegen/src/lower_call/early_branches.rs:887-897 | crates/perry-codegen/src/lower_call/early_branches.rs:989-999 | crates/perry-codegen/src/lower_call/early_branches.rs:1097-1107 | crates/perry-codegen/src/lower_call/func_ref.rs:1129-1138 | crates/perry-codegen/src/lower_call/func_ref.rs:1203-1212 | crates/perry-codegen/src/lower_call/func_ref.rs:1279-1288 | crates/perry-codegen/src/lower_call/func_ref.rs:1357-1366 | crates/perry-codegen/src/lower_call/method_override.rs:1248-1257 | crates/perry-codegen/src/lower_call/method_override.rs:1338-1347 | crates/perry-codegen/src/lower_call/method_override.rs:1422-1431 | crates/perry-codegen/src/lower_call/method_override.rs:1508-1517 | crates/perry-codegen/src/lower_call/method_override.rs:1595-1604 | crates/perry-codegen/src/lower_call/scalar_method.rs:927-936 | crates/perry-codegen/src/lower_call/scalar_method.rs:1144-1153 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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 (11 lines × 7) crates/perry-codegen/src/lower_call/func_ref.rs:1140— crates/perry-codegen/src/lower_call/func_ref.rs:1140-1150 | crates/perry-codegen/src/lower_call/func_ref.rs:1214-1224 | crates/perry-codegen/src/lower_call/func_ref.rs:1290-1300 | crates/perry-codegen/src/lower_call/method_override.rs:1349-1359 | crates/perry-codegen/src/lower_call/method_override.rs:1433-1443 | crates/perry-codegen/src/lower_call/method_override.rs:1519-1529 | crates/perry-codegen/src/lower_call/method_override.rs:1606-1616 — before extracting anything, compare `crates/perry-codegen/src/lower_call/func_ref.rs` and `crates/perry-codegen/src/lower_call/method_override.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 4) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1322— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1322-1332 | crates/perry-hir/src/lower/expr_call/imported_array_methods.rs:267-276 | crates/perry-hir/src/lower/expr_call/inline_array_methods.rs:196-205 | crates/perry-hir/src/lower/expr_call/local_array_methods.rs:789-798 — before extracting anything, compare `crates/perry-hir/src/lower/expr_call/array_only_methods.rs` and `crates/perry-hir/src/lower/expr_call/imported_array_methods.rs` as WHOLE FILES: this scan already matched 9 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. If that is what happened, the fix is to keep one copy and have the 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–11 lines × 3) crates/perry-codegen/src/expr/calls/fs.rs:370— crates/perry-codegen/src/expr/calls/fs.rs:370-378 | crates/perry-codegen/src/lower_call/options/fetch.rs:556-564 | crates/perry-codegen/src/lower_call/options/fetch.rs:838-848 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–11 lines × 3) crates/perry-hir/src/lower/expr_function.rs:1560— crates/perry-hir/src/lower/expr_function.rs:1560-1567 | crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs:258-265 | crates/perry-hir/src/lower_decl/class_members.rs:406-416 — before extracting anything, compare `crates/perry-hir/src/lower/expr_function.rs` and `crates/perry-hir/src/lower_decl/body_stmt/nested_fn_decl.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 137 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–10 lines × 7) crates/perry-codegen/src/collectors/escape_news.rs:319— crates/perry-codegen/src/collectors/escape_news.rs:319-328 | crates/perry-codegen/src/collectors/hot_callees.rs:478-486 | crates/perry-codegen/src/collectors/i32_locals.rs:1283-1292 | crates/perry-codegen/src/collectors/index_uses.rs:182-191 | crates/perry-codegen/src/collectors/index_uses.rs:430-438 | crates/perry-codegen/src/collectors/mutation.rs:526-534 | crates/perry-codegen/src/collectors/refs.rs:246-255 — before extracting anything, compare `crates/perry-codegen/src/collectors/i32_locals.rs` and `crates/perry-codegen/src/collectors/refs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 477 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–10 lines × 7) crates/perry-codegen/src/expr/compare.rs:391— crates/perry-codegen/src/expr/compare.rs:391-397 | crates/perry-codegen/src/expr/compare.rs:688-694 | crates/perry-codegen/src/expr/compare.rs:1149-1155 | crates/perry-codegen/src/expr/layout_read.rs:703-708 | crates/perry-codegen/src/expr/proven_view_access.rs:458-465 | crates/perry-codegen/src/expr/u8_buffer_read.rs:431-436 | crates/perry-codegen/src/lower_string_method/char_code_at.rs:328-337 — before extracting anything, compare `crates/perry-codegen/src/expr/compare.rs` and `crates/perry-codegen/src/lower_string_method/char_code_at.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–10 lines × 6) crates/perry-hir/src/lower/expr_object.rs:1438— crates/perry-hir/src/lower/expr_object.rs:1438-1447 | crates/perry-hir/src/lower/expr_object.rs:1657-1666 | crates/perry-hir/src/lower/lower_expr/reactive_text.rs:161-169 | crates/perry-hir/src/lower/lower_expr/reactive_text.rs:202-210 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:239-247 | crates/perry-hir/src/lower/widget_decl/reactive_animate.rs:280-288 — before extracting anything, compare `crates/perry-hir/src/lower/lower_expr/reactive_text.rs` and `crates/perry-hir/src/lower/widget_decl/reactive_animate.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–10 lines × 4) crates/perry-hir/src/lower/expr_new.rs:1008— crates/perry-hir/src/lower/expr_new.rs:1008-1016 | crates/perry-hir/src/lower/expr_new.rs:1379-1388 | crates/perry-hir/src/lower/expr_new.rs:1494-1502 | crates/perry-hir/src/lower/expr_new.rs:1519-1527 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–10 lines × 3) crates/perry-codegen/src/expr/method_site.rs:750— crates/perry-codegen/src/expr/method_site.rs:750-756 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:54-60 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:150-159 — 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 (4–10 lines × 3) crates/perry-codegen/src/lower_call/direct_method_guard.rs:42— crates/perry-codegen/src/lower_call/direct_method_guard.rs:42-51 | crates/perry-codegen/src/lower_call/method_override.rs:264-267 | crates/perry-codegen/src/lower_call/method_override.rs:385-394 — before extracting anything, compare `crates/perry-codegen/src/lower_call/direct_method_guard.rs` and `crates/perry-codegen/src/lower_call/method_override.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. If that is what happened, the fix is to keep one copy and have the 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 × 16) crates/perry-hir/src/lower/expr_new.rs:159— crates/perry-hir/src/lower/expr_new.rs:159-167 | crates/perry-hir/src/lower/expr_new.rs:735-743 | crates/perry-hir/src/lower/expr_new.rs:980-988 | crates/perry-hir/src/lower/expr_new.rs:1007-1015 | crates/perry-hir/src/lower/expr_new.rs:1033-1041 | crates/perry-hir/src/lower/expr_new.rs:1142-1150 | crates/perry-hir/src/lower/expr_new.rs:1155-1163 | crates/perry-hir/src/lower/expr_new.rs:1176-1184 | crates/perry-hir/src/lower/expr_new.rs:1227-1235 | crates/perry-hir/src/lower/expr_new.rs:1253-1261 | crates/perry-hir/src/lower/expr_new.rs:1378-1386 | crates/perry-hir/src/lower/expr_new.rs:1440-1448 | crates/perry-hir/src/lower/expr_new.rs:1458-1466 | crates/perry-hir/src/lower/expr_new.rs:1493-1501 | crates/perry-hir/src/lower/expr_new.rs:1518-1526 | crates/perry-hir/src/lower/expr_new.rs:1554-1562 — all 16 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 14) crates/perry-codegen/src/expr/function_bind.rs:104— crates/perry-codegen/src/expr/function_bind.rs:104-111 | crates/perry-codegen/src/lower_call/early_branches.rs:558-566 | crates/perry-codegen/src/lower_call/early_branches.rs:830-838 | crates/perry-codegen/src/lower_call/early_branches.rs:931-939 | crates/perry-codegen/src/lower_call/early_branches.rs:1035-1043 | crates/perry-codegen/src/lower_call/early_branches.rs:1142-1150 | crates/perry-codegen/src/lower_call/early_branches.rs:1197-1205 | crates/perry-codegen/src/lower_call/func_ref.rs:236-244 | crates/perry-codegen/src/lower_call/func_ref.rs:1160-1168 | crates/perry-codegen/src/lower_call/func_ref.rs:1235-1243 | crates/perry-codegen/src/lower_call/func_ref.rs:1313-1321 | crates/perry-codegen/src/lower_call/func_ref.rs:1404-1412 | crates/perry-codegen/src/lower_call/property_get/imported_object.rs:181-189 | crates/perry-codegen/src/lower_conditional.rs:510-518 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 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 × 10) crates/perry-ext-net/src/payload_abi.rs:475— crates/perry-ext-net/src/payload_abi.rs:475-483 | crates/perry-ext-net/src/payload_abi.rs:497-505 | crates/perry-ext-net/src/payload_abi.rs:519-527 | crates/perry-ext-net/src/payload_abi.rs:541-549 | crates/perry-ext-net/src/payload_abi.rs:712-720 | crates/perry-ext-net/src/payload_abi.rs:734-742 | crates/perry-ext-net/src/payload_abi.rs:756-764 | crates/perry-ext-net/src/payload_abi.rs:778-786 | crates/perry-ext-net/src/payload_abi.rs:1060-1068 | crates/perry-ext-net/src/payload_abi.rs:1082-1090 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 9) crates/perry-codegen/src/expr/helpers.rs:378— crates/perry-codegen/src/expr/helpers.rs:378-386 | crates/perry-codegen/src/expr/this_super_call.rs:821-829 | crates/perry-codegen/src/lower_array_method.rs:1277-1284 | crates/perry-codegen/src/lower_call/method_override.rs:701-708 | crates/perry-codegen/src/lower_call/method_override.rs:1814-1821 | crates/perry-codegen/src/lower_call/new_helpers.rs:266-273 | crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:470-477 | crates/perry-codegen/src/lower_call/scalar_method.rs:830-837 | crates/perry-codegen/src/lower_call/web_storage.rs:45-52 — before extracting anything, compare `crates/perry-codegen/src/lower_call/method_override.rs` and `crates/perry-codegen/src/lower_call/scalar_method.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–9 lines × 5) crates/perry-codegen/src/codegen/closure.rs:1336— crates/perry-codegen/src/codegen/closure.rs:1336-1344 | crates/perry-codegen/src/codegen/entry.rs:941-947 | crates/perry-codegen/src/codegen/entry/module_init.rs:421-427 | crates/perry-codegen/src/codegen/method.rs:727-735 | crates/perry-codegen/src/codegen/method_static.rs:402-410 — before extracting anything, compare `crates/perry-codegen/src/codegen/closure.rs` and `crates/perry-codegen/src/codegen/entry.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–9 lines × 5) crates/perry-codegen/src/expr/math_simple.rs:326— crates/perry-codegen/src/expr/math_simple.rs:326-334 | crates/perry-codegen/src/lower_call/func_ref.rs:1153-1158 | crates/perry-codegen/src/lower_call/func_ref.rs:1228-1233 | crates/perry-codegen/src/lower_call/func_ref.rs:1306-1311 | crates/perry-codegen/src/lower_call/func_ref.rs:1397-1402 — before extracting anything, compare `crates/perry-codegen/src/expr/math_simple.rs` and `crates/perry-codegen/src/lower_call/func_ref.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 4) crates/perry-codegen/src/builtin_proto.rs:243— crates/perry-codegen/src/builtin_proto.rs:243-250 | crates/perry-codegen/src/expr/instance_misc1.rs:303-310 | crates/perry-codegen/src/expr/instance_misc1.rs:773-780 | crates/perry-codegen/src/lower_call/scalar_method.rs:990-998 — before extracting anything, compare `crates/perry-codegen/src/builtin_proto.rs` and `crates/perry-codegen/src/expr/instance_misc1.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (3–9 lines × 7) crates/perry-hir/src/destructuring/var_decl/native_new.rs:68— crates/perry-hir/src/destructuring/var_decl/native_new.rs:68-70 | crates/perry-hir/src/destructuring/var_decl/native_new.rs:198-200 | crates/perry-hir/src/destructuring/var_decl/native_new.rs:233-240 | crates/perry-hir/src/lower/module_decl.rs:813-815 | crates/perry-hir/src/lower/module_decl.rs:985-988 | crates/perry-hir/src/lower/module_decl.rs:1116-1124 | crates/perry-hir/src/lower/stmt.rs:532-534 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (4–9 lines × 4) crates/perry-hir/src/dynamic_code.rs:80— crates/perry-hir/src/dynamic_code.rs:80-84 | crates/perry-hir/src/lower/lower_module_fn.rs:789-797 | crates/perry-hir/src/lower/lower_module_fn.rs:811-819 | crates/perry-hir/src/lower/stmt.rs:137-140 — 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 (8 lines × 12) crates/perry-codegen/src/expr/calls/fs.rs:21— crates/perry-codegen/src/expr/calls/fs.rs:21-28 | crates/perry-codegen/src/expr/calls/fs.rs:39-46 | crates/perry-codegen/src/expr/calls/fs.rs:57-64 | crates/perry-codegen/src/expr/calls/fs.rs:74-81 | crates/perry-codegen/src/expr/calls/fs.rs:145-152 | crates/perry-codegen/src/expr/calls/fs.rs:182-189 | crates/perry-codegen/src/expr/calls/fs.rs:299-306 | crates/perry-codegen/src/expr/calls/fs.rs:316-323 | crates/perry-codegen/src/expr/calls/fs.rs:333-340 | crates/perry-codegen/src/expr/calls/fs.rs:350-357 | crates/perry-codegen/src/expr/calls/fs.rs:413-420 | crates/perry-codegen/src/expr/calls/fs.rs:430-437 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 11) crates/perry-codegen/src/lower_call/builtin.rs:85— crates/perry-codegen/src/lower_call/builtin.rs:85-92 | crates/perry-codegen/src/lower_call/builtin.rs:449-456 | crates/perry-codegen/src/lower_call/builtin.rs:731-738 | crates/perry-codegen/src/lower_call/builtin.rs:777-784 | crates/perry-codegen/src/lower_call/builtin.rs:798-805 | crates/perry-codegen/src/lower_call/builtin.rs:819-826 | crates/perry-codegen/src/lower_call/builtin.rs:872-879 | crates/perry-codegen/src/lower_call/builtin.rs:921-928 | crates/perry-codegen/src/lower_call/builtin.rs:1109-1116 | crates/perry-codegen/src/lower_string_method.rs:580-587 | crates/perry-codegen/src/lower_string_method.rs:768-775 — there are 11 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 11 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 7) crates/perry-codegen/src/expr/bigint_set.rs:108— crates/perry-codegen/src/expr/bigint_set.rs:108-116 | crates/perry-codegen/src/expr/bigint_set.rs:220-228 | crates/perry-codegen/src/expr/bigint_set.rs:287-294 | crates/perry-codegen/src/expr/logical_collections.rs:510-517 | crates/perry-codegen/src/expr/math_simple.rs:231-238 | crates/perry-codegen/src/expr/math_simple.rs:326-333 | crates/perry-codegen/src/expr/math_simple.rs:395-403 — before extracting anything, compare `crates/perry-codegen/src/expr/bigint_set.rs` and `crates/perry-codegen/src/expr/logical_collections.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–8 lines × 4) crates/perry-codegen/src/expr/this_super_call.rs:636— crates/perry-codegen/src/expr/this_super_call.rs:636-641 | crates/perry-codegen/src/lower_call/new.rs:1522-1529 | crates/perry-codegen/src/lower_call/new.rs:1542-1549 | crates/perry-codegen/src/lower_call/new.rs:1565-1572 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–8 lines × 3) crates/perry-ext-better-sqlite3/src/lib.rs:302— crates/perry-ext-better-sqlite3/src/lib.rs:302-304 | crates/perry-ext-better-sqlite3/src/lib.rs:355-362 | crates/perry-ext-better-sqlite3/src/lib.rs:422-429 — 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–8 lines × 3) crates/perry-hir/src/lower_types.rs:1414— crates/perry-hir/src/lower_types.rs:1414-1421 | crates/perry-hir/src/lower_types.rs:1427-1434 | crates/perry-hir/src/lower_types.rs:1439-1443 — 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 × 10) crates/perry-codegen/src/lower_call/early_branches.rs:799— crates/perry-codegen/src/lower_call/early_branches.rs:799-806 | crates/perry-codegen/src/lower_call/early_branches.rs:899-906 | crates/perry-codegen/src/lower_call/early_branches.rs:1001-1008 | crates/perry-codegen/src/lower_call/func_ref.rs:1140-1146 | crates/perry-codegen/src/lower_call/func_ref.rs:1214-1220 | crates/perry-codegen/src/lower_call/func_ref.rs:1290-1296 | crates/perry-codegen/src/lower_call/method_override.rs:1349-1355 | crates/perry-codegen/src/lower_call/method_override.rs:1433-1439 | crates/perry-codegen/src/lower_call/method_override.rs:1519-1525 | crates/perry-codegen/src/lower_call/method_override.rs:1606-1612 — before extracting anything, compare `crates/perry-codegen/src/lower_call/early_branches.rs` and `crates/perry-codegen/src/lower_call/func_ref.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 9) crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:26— crates/perry-codegen/src/codegen/string_pool/metadata_constants.rs:26-32 | crates/perry-codegen/src/expr/array_literal.rs:692-698 | crates/perry-codegen/src/expr/instance_misc1.rs:1610-1616 | crates/perry-codegen/src/expr/strings.rs:28-34 | crates/perry-codegen/src/expr/typed_feedback.rs:210-216 | crates/perry-codegen/src/expr/v8_interop.rs:79-85 | crates/perry-codegen/src/expr/v8_interop.rs:173-179 | crates/perry-codegen/src/module.rs:953-959 | crates/perry-codegen/src/strings.rs:336-342 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/expr/instance_misc1.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–7 lines × 7) crates/perry-codegen/src/codegen/method.rs:1353— crates/perry-codegen/src/codegen/method.rs:1353-1356 | crates/perry-codegen/src/expr/helpers.rs:376-377 | crates/perry-codegen/src/lower_array_method.rs:1268-1274 | crates/perry-codegen/src/lower_call/method_override.rs:1805-1811 | crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:461-467 | crates/perry-codegen/src/lower_call/scalar_method.rs:823-828 | crates/perry-codegen/src/lower_call/web_storage.rs:36-42 — before extracting anything, compare `crates/perry-codegen/src/lower_call/method_override.rs` and `crates/perry-codegen/src/lower_call/scalar_method.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–7 lines × 4) crates/perry-codegen/src/stmt/element_shape_loop.rs:1453— crates/perry-codegen/src/stmt/element_shape_loop.rs:1453-1455 | crates/perry-codegen/src/stmt/loops.rs:3829-3835 | crates/perry-codegen/src/stmt/loops.rs:6792-6798 | crates/perry-codegen/src/stmt/loops.rs:6836-6842 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (2–7 lines × 5) crates/perry-codegen/src/codegen/split_regions_facts.rs:552— crates/perry-codegen/src/codegen/split_regions_facts.rs:552-553 | crates/perry-hir/src/dynamic_import.rs:314-320 | crates/perry-hir/src/dynamic_import.rs:386-392 | crates/perry-hir/src/dynamic_import.rs:445-451 | crates/perry-hir/src/lower/shared_mutable_capture.rs:1130-1131 — before extracting anything, compare `crates/perry-codegen/src/codegen/split_regions_facts.rs` and `crates/perry-hir/src/lower/shared_mutable_capture.rs` as WHOLE FILES: this scan already matched 3 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 (6 lines × 12) crates/perry-codegen/src/expr/calls/fs.rs:21— crates/perry-codegen/src/expr/calls/fs.rs:21-26 | crates/perry-codegen/src/expr/calls/fs.rs:74-79 | crates/perry-codegen/src/expr/calls/fs.rs:145-150 | crates/perry-codegen/src/expr/calls/fs.rs:182-187 | crates/perry-codegen/src/expr/calls/fs.rs:205-210 | crates/perry-codegen/src/expr/calls/fs.rs:299-304 | crates/perry-codegen/src/expr/calls/fs.rs:316-321 | crates/perry-codegen/src/expr/calls/fs.rs:333-338 | crates/perry-codegen/src/expr/calls/fs.rs:350-355 | crates/perry-codegen/src/expr/calls/fs.rs:395-400 | crates/perry-codegen/src/expr/calls/fs.rs:413-418 | crates/perry-codegen/src/expr/calls/fs.rs:430-435 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5–6 lines × 7) crates/perry-codegen/src/codegen/method.rs:1357— crates/perry-codegen/src/codegen/method.rs:1357-1362 | crates/perry-codegen/src/expr/helpers.rs:378-382 | crates/perry-codegen/src/lower_array_method.rs:1277-1281 | crates/perry-codegen/src/lower_call/method_override.rs:701-705 | crates/perry-codegen/src/lower_call/method_override.rs:1814-1818 | crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs:470-474 | crates/perry-codegen/src/lower_call/web_storage.rs:45-49 — before extracting anything, compare `crates/perry-codegen/src/lower_call/property_get/static_dispatch.rs` and `crates/perry-codegen/src/lower_call/web_storage.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–6 lines × 5) crates/perry-codegen/src/expr/env_clones.rs:90— crates/perry-codegen/src/expr/env_clones.rs:90-94 | crates/perry-codegen/src/expr/misc_methods.rs:315-320 | crates/perry-codegen/src/expr/misc_methods.rs:363-368 | crates/perry-codegen/src/expr/string_regex_proc.rs:553-558 | crates/perry-codegen/src/expr/string_regex_proc.rs:573-578 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (4–6 lines × 8) crates/perry-codegen/src/expr/index_get.rs:781— crates/perry-codegen/src/expr/index_get.rs:781-784 | crates/perry-codegen/src/expr/index_set_guarded.rs:368-371 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:120-125 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:235-241 | crates/perry-codegen/src/expr/index_set_packed_loop.rs:429-437 | crates/perry-codegen/src/expr/masked_window.rs:54-57 | crates/perry-codegen/src/expr/masked_window.rs:317-320 | crates/perry-codegen/src/expr/ptr_numarray_access.rs:54-57 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5–6 lines × 2) crates/perry-codegen/src/expr/static_method.rs:138— crates/perry-codegen/src/expr/static_method.rs:138-142 | crates/perry-codegen/src/lower_conditional.rs:159-164 — 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 × 38) crates/perry-codegen/src/expr/array_literal.rs:310— crates/perry-codegen/src/expr/array_literal.rs:310-317 | crates/perry-codegen/src/expr/bigint_set.rs:85-91 | crates/perry-codegen/src/expr/bigint_set.rs:197-203 | crates/perry-codegen/src/expr/bigint_set.rs:264-270 | crates/perry-codegen/src/expr/checked_super.rs:120-124 | crates/perry-codegen/src/expr/class_env.rs:156-161 | crates/perry-codegen/src/expr/compare.rs:136-141 | crates/perry-codegen/src/expr/compare.rs:478-483 | crates/perry-codegen/src/expr/compare.rs:877-882 | crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs:48-52 | crates/perry-codegen/src/expr/inline_birth/shared.rs:140-144 | crates/perry-codegen/src/expr/instance_misc1.rs:285-290 | crates/perry-codegen/src/expr/instance_misc1.rs:745-750 | crates/perry-codegen/src/expr/logical_collections.rs:487-493 | crates/perry-codegen/src/expr/logical_collections.rs:1742-1746 | crates/perry-codegen/src/expr/math_simple.rs:208-214 | crates/perry-codegen/src/expr/math_simple.rs:303-309 | crates/perry-codegen/src/expr/math_simple.rs:372-378 | crates/perry-codegen/src/expr/pod_record.rs:560-566 | crates/perry-codegen/src/expr/property_get.rs:538-544 | crates/perry-codegen/src/expr/property_get/composed_ics.rs:66-70 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:702-710 | crates/perry-codegen/src/expr/property_get/helpers.rs:600-605 | crates/perry-codegen/src/expr/suffix_cursor.rs:59-63 | crates/perry-codegen/src/lower_call/new_alloc.rs:885-889 | crates/perry-codegen/src/lower_call/property_get/completed_object.rs:135-139 | crates/perry-codegen/src/lower_conditional.rs:110-115 | crates/perry-codegen/src/lower_string_concat.rs:288-293 | crates/perry-codegen/src/lower_string_method/char_code_at.rs:217-229 | crates/perry-codegen/src/native_value/materialize.rs:488-494 | crates/perry-codegen/src/stmt/loops.rs:551-557 | crates/perry-codegen/src/stmt/loops.rs:790-796 | crates/perry-codegen/src/stmt/loops.rs:3814-3820 | crates/perry-codegen/src/stmt/loops.rs:6784-6789 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:913-918 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1058-1063 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1231-1236 | crates/perry-codegen/src/stmt/string_length_loop.rs:209-214 — before extracting anything, compare `crates/perry-codegen/src/expr/array_literal.rs` and `crates/perry-codegen/src/expr/bigint_set.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.
Duplicated block (5 lines × 17) crates/perry-codegen/src/expr/env_clones.rs:115— crates/perry-codegen/src/expr/env_clones.rs:115-119 | crates/perry-codegen/src/expr/math_simple.rs:1241-1245 | crates/perry-codegen/src/expr/misc_methods.rs:338-342 | crates/perry-codegen/src/expr/misc_methods.rs:383-387 | crates/perry-codegen/src/expr/misc_methods.rs:405-409 | crates/perry-codegen/src/expr/misc_methods.rs:432-436 | crates/perry-codegen/src/expr/misc_methods.rs:494-498 | crates/perry-codegen/src/expr/misc_methods.rs:515-519 | crates/perry-codegen/src/expr/misc_methods.rs:536-540 | crates/perry-codegen/src/expr/misc_methods.rs:563-567 | crates/perry-codegen/src/expr/misc_methods.rs:639-643 | crates/perry-codegen/src/expr/os_uri_dates.rs:219-223 | crates/perry-codegen/src/expr/os_uri_dates.rs:249-253 | crates/perry-codegen/src/expr/os_uri_dates.rs:284-288 | crates/perry-codegen/src/expr/os_uri_dates.rs:344-348 | crates/perry-codegen/src/expr/string_regex_proc.rs:524-528 | crates/perry-codegen/src/expr/super_method.rs:97-101 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 16) crates/perry-codegen/src/expr/env_clones.rs:115— crates/perry-codegen/src/expr/env_clones.rs:115-119 | crates/perry-codegen/src/expr/math_simple.rs:1241-1245 | crates/perry-codegen/src/expr/misc_methods.rs:338-342 | crates/perry-codegen/src/expr/misc_methods.rs:383-387 | crates/perry-codegen/src/expr/misc_methods.rs:405-409 | crates/perry-codegen/src/expr/misc_methods.rs:432-436 | crates/perry-codegen/src/expr/misc_methods.rs:464-469 | crates/perry-codegen/src/expr/misc_methods.rs:494-498 | crates/perry-codegen/src/expr/misc_methods.rs:515-519 | crates/perry-codegen/src/expr/misc_methods.rs:536-540 | crates/perry-codegen/src/expr/misc_methods.rs:563-567 | crates/perry-codegen/src/expr/misc_methods.rs:601-606 | crates/perry-codegen/src/expr/misc_methods.rs:639-643 | crates/perry-codegen/src/expr/os_uri_dates.rs:219-223 | crates/perry-codegen/src/expr/string_regex_proc.rs:524-528 | crates/perry-codegen/src/expr/super_method.rs:97-101 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 15) crates/perry-codegen/src/expr/env_clones.rs:90— crates/perry-codegen/src/expr/env_clones.rs:90-94 | crates/perry-codegen/src/expr/misc_methods.rs:315-319 | crates/perry-codegen/src/expr/misc_methods.rs:363-367 | crates/perry-codegen/src/expr/misc_methods.rs:733-737 | crates/perry-codegen/src/expr/misc_methods.rs:871-875 | crates/perry-codegen/src/expr/misc_methods.rs:889-893 | crates/perry-codegen/src/expr/misc_methods.rs:921-925 | crates/perry-codegen/src/expr/misc_methods.rs:1052-1056 | crates/perry-codegen/src/expr/misc_methods.rs:1081-1085 | crates/perry-codegen/src/expr/os_uri_dates.rs:380-384 | crates/perry-codegen/src/expr/string_regex_proc.rs:62-66 | crates/perry-codegen/src/expr/string_regex_proc.rs:78-82 | crates/perry-codegen/src/expr/string_regex_proc.rs:324-328 | crates/perry-codegen/src/expr/string_regex_proc.rs:553-557 | crates/perry-codegen/src/expr/string_regex_proc.rs:573-577 — before extracting anything, compare `crates/perry-codegen/src/expr/env_clones.rs` and `crates/perry-codegen/src/expr/misc_methods.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (4–5 lines × 15) crates/perry-codegen/src/expr/calls/crypto_hash.rs:351— crates/perry-codegen/src/expr/calls/crypto_hash.rs:351-355 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:41-44 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:103-106 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:141-145 | crates/perry-codegen/src/expr/calls/crypto_kdf.rs:234-237 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:190-195 | crates/perry-codegen/src/expr/calls/crypto_keys.rs:220-224 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:51-54 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:274-277 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:399-403 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:458-461 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:595-599 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:630-633 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:655-658 | crates/perry-codegen/src/expr/calls/crypto_misc.rs:683-687 — before extracting anything, compare `crates/perry-codegen/src/expr/calls/crypto_kdf.rs` and `crates/perry-codegen/src/expr/calls/crypto_misc.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–5 lines × 7) crates/perry-codegen/src/expr/array_pop.rs:194— crates/perry-codegen/src/expr/array_pop.rs:194-196 | crates/perry-codegen/src/expr/array_push.rs:1361-1363 | crates/perry-codegen/src/expr/i32_fast_path.rs:1175-1179 | crates/perry-codegen/src/expr/i32_fast_path.rs:1238-1242 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:784-788 | crates/perry-codegen/src/expr/masked_window.rs:56-59 | crates/perry-codegen/src/expr/string_window.rs:58-60 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 8) crates/perry-codegen-arkts/src/widgets/calendar.rs:33— crates/perry-codegen-arkts/src/widgets/calendar.rs:33-53 | crates/perry-codegen-arkts/src/widgets/date_picker.rs:32-52 | crates/perry-codegen-arkts/src/widgets/inputs.rs:30-44 | crates/perry-codegen-arkts/src/widgets/inputs.rs:58-72 | crates/perry-codegen-arkts/src/widgets/inputs.rs:123-137 | crates/perry-codegen-arkts/src/widgets/inputs.rs:175-190 | crates/perry-codegen-arkts/src/widgets/inputs.rs:201-214 | crates/perry-codegen-arkts/src/widgets/inputs.rs:235-254 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 5) crates/perry-codegen/src/lower_call/extern_timers.rs:128— crates/perry-codegen/src/lower_call/extern_timers.rs:128-141 | crates/perry-codegen/src/lower_call/extern_timers.rs:165-178 | crates/perry-codegen/src/lower_call/extern_timers.rs:218-236 | crates/perry-codegen/src/lower_call/extern_timers.rs:243-256 | crates/perry-codegen/src/lower_call/extern_timers.rs:265-283 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 14) crates/perry-codegen/src/expr/misc_methods.rs:319— crates/perry-codegen/src/expr/misc_methods.rs:319-328 | crates/perry-codegen/src/expr/misc_methods.rs:345-360 | crates/perry-codegen/src/expr/misc_methods.rs:367-376 | crates/perry-codegen/src/expr/misc_methods.rs:388-397 | crates/perry-codegen/src/expr/misc_methods.rs:411-425 | crates/perry-codegen/src/expr/misc_methods.rs:437-450 | crates/perry-codegen/src/expr/misc_methods.rs:472-487 | crates/perry-codegen/src/expr/misc_methods.rs:499-508 | crates/perry-codegen/src/expr/misc_methods.rs:520-529 | crates/perry-codegen/src/expr/misc_methods.rs:541-554 | crates/perry-codegen/src/expr/misc_methods.rs:569-583 | crates/perry-codegen/src/expr/misc_methods.rs:611-628 | crates/perry-codegen/src/expr/string_regex_proc.rs:529-538 | crates/perry-codegen/src/expr/string_regex_proc.rs:557-566 — before extracting anything, compare `crates/perry-codegen/src/expr/misc_methods.rs` and `crates/perry-codegen/src/expr/string_regex_proc.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–12 lines × 3) crates/perry-codegen/src/lower_call/property_get/map_set.rs:357— crates/perry-codegen/src/lower_call/property_get/map_set.rs:357-368 | crates/perry-codegen/src/lower_call/property_get/map_set.rs:384-395 | crates/perry-codegen/src/lower_call/property_get/map_set.rs:414-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.
Duplicated block (11 lines × 11) crates/perry-codegen/src/block.rs:1458— crates/perry-codegen/src/block.rs:1458-1468 | crates/perry-codegen/src/block.rs:1471-1481 | crates/perry-codegen/src/block.rs:1484-1494 | crates/perry-codegen/src/block.rs:1500-1510 | crates/perry-codegen/src/block.rs:1515-1525 | crates/perry-codegen/src/block.rs:1528-1538 | crates/perry-codegen/src/block.rs:1541-1551 | crates/perry-codegen/src/block.rs:1554-1564 | crates/perry-codegen/src/block.rs:1567-1577 | crates/perry-codegen/src/block.rs:1580-1590 | crates/perry-codegen/src/block.rs:1593-1603 — 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 (5 lines × 43) crates/perry-codegen/src/builtin_proto.rs:212— crates/perry-codegen/src/builtin_proto.rs:212-217 | crates/perry-codegen/src/codegen/checked_integer.rs:378-382 | crates/perry-codegen/src/expr/array_literal.rs:310-317 | crates/perry-codegen/src/expr/bigint_set.rs:85-90 | crates/perry-codegen/src/expr/bigint_set.rs:197-202 | crates/perry-codegen/src/expr/bigint_set.rs:264-269 | crates/perry-codegen/src/expr/binary.rs:1053-1058 | crates/perry-codegen/src/expr/checked_super.rs:120-124 | crates/perry-codegen/src/expr/class_env.rs:156-161 | crates/perry-codegen/src/expr/class_first_evaluation.rs:90-99 | crates/perry-codegen/src/expr/compare.rs:478-483 | crates/perry-codegen/src/expr/compare.rs:877-882 | crates/perry-codegen/src/expr/family_slot.rs:279-284 | crates/perry-codegen/src/expr/folded_builtin_override.rs:851-856 | crates/perry-codegen/src/expr/index_get/symbol_ic.rs:37-41 | crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs:48-52 | crates/perry-codegen/src/expr/inline_birth/shared.rs:140-144 | crates/perry-codegen/src/expr/instance_misc1.rs:285-290 | crates/perry-codegen/src/expr/instance_misc1.rs:745-750 | crates/perry-codegen/src/expr/literals_vars.rs:857-862 | crates/perry-codegen/src/expr/literals_vars.rs:1111-1116 | crates/perry-codegen/src/expr/logical_collections.rs:487-492 | crates/perry-codegen/src/expr/logical_collections.rs:1742-1746 | crates/perry-codegen/src/expr/math_simple.rs:208-213 | crates/perry-codegen/src/expr/math_simple.rs:303-308 | crates/perry-codegen/src/expr/math_simple.rs:372-377 | crates/perry-codegen/src/expr/pod_record.rs:283-289 | crates/perry-codegen/src/expr/pod_record.rs:357-363 | crates/perry-codegen/src/expr/pod_record.rs:560-566 | crates/perry-codegen/src/expr/property_get/helpers.rs:600-605 | crates/perry-codegen/src/expr/suffix_cursor.rs:59-63 | crates/perry-codegen/src/expr/unary.rs:55-60 | crates/perry-codegen/src/lower_call/early_branches.rs:534-539 | crates/perry-codegen/src/lower_call/func_ref.rs:214-219 | crates/perry-codegen/src/lower_call/new_alloc.rs:885-889 | crates/perry-codegen/src/lower_string_concat.rs:288-293 | crates/perry-codegen/src/native_value/materialize.rs:488-493 | crates/perry-codegen/src/stmt/loops.rs:551-557 | crates/perry-codegen/src/stmt/loops.rs:790-796 | crates/perry-codegen/src/stmt/loops.rs:3814-3820 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:913-918 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1231-1236 | crates/perry-codegen/src/stmt/string_length_loop.rs:209-214 — before extracting anything, compare `crates/perry-codegen/src/builtin_proto.rs` and `crates/perry-codegen/src/expr/instance_misc1.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 5) crates/perry-codegen/src/block.rs:680— crates/perry-codegen/src/block.rs:680-689 | crates/perry-codegen/src/block.rs:721-730 | crates/perry-codegen/src/block.rs:734-743 | crates/perry-codegen/src/block.rs:747-756 | crates/perry-codegen/src/block.rs:760-769 — 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 × 53) crates/perry-codegen/src/builtin_proto.rs:212— crates/perry-codegen/src/builtin_proto.rs:212-217 | crates/perry-codegen/src/codegen/checked_integer.rs:378-382 | crates/perry-codegen/src/expr/array_literal.rs:310-317 | crates/perry-codegen/src/expr/array_literal.rs:434-439 | crates/perry-codegen/src/expr/bigint_set.rs:85-90 | crates/perry-codegen/src/expr/bigint_set.rs:197-202 | crates/perry-codegen/src/expr/bigint_set.rs:264-269 | crates/perry-codegen/src/expr/binary.rs:1053-1058 | crates/perry-codegen/src/expr/checked_super.rs:120-124 | crates/perry-codegen/src/expr/class_env.rs:156-161 | crates/perry-codegen/src/expr/class_first_evaluation.rs:90-99 | crates/perry-codegen/src/expr/collection_receiver.rs:67-72 | crates/perry-codegen/src/expr/compare.rs:478-483 | crates/perry-codegen/src/expr/compare.rs:877-882 | crates/perry-codegen/src/expr/family_slot.rs:279-284 | crates/perry-codegen/src/expr/folded_builtin_override.rs:851-856 | crates/perry-codegen/src/expr/index_get/symbol_ic.rs:37-41 | crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs:48-52 | crates/perry-codegen/src/expr/inline_birth/shared.rs:140-144 | crates/perry-codegen/src/expr/instance_misc1.rs:285-290 | crates/perry-codegen/src/expr/instance_misc1.rs:745-750 | crates/perry-codegen/src/expr/literals_vars.rs:857-862 | crates/perry-codegen/src/expr/literals_vars.rs:1111-1116 | crates/perry-codegen/src/expr/logical_collections.rs:487-492 | crates/perry-codegen/src/expr/logical_collections.rs:1742-1746 | crates/perry-codegen/src/expr/math_simple.rs:208-213 | crates/perry-codegen/src/expr/math_simple.rs:303-308 | crates/perry-codegen/src/expr/math_simple.rs:372-377 | crates/perry-codegen/src/expr/pod_record.rs:49-57 | crates/perry-codegen/src/expr/pod_record.rs:283-289 | crates/perry-codegen/src/expr/pod_record.rs:357-363 | crates/perry-codegen/src/expr/pod_record.rs:560-566 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:182-189 | crates/perry-codegen/src/expr/property_get/helpers.rs:600-605 | crates/perry-codegen/src/expr/static_field_meta.rs:139-143 | crates/perry-codegen/src/expr/static_method.rs:484-488 | crates/perry-codegen/src/expr/suffix_cursor.rs:59-63 | crates/perry-codegen/src/expr/unary.rs:55-60 | crates/perry-codegen/src/lower_call/early_branches.rs:534-539 | crates/perry-codegen/src/lower_call/extern_func/pod_params.rs:307-313 | crates/perry-codegen/src/lower_call/func_ref.rs:214-219 | crates/perry-codegen/src/lower_call/new_alloc.rs:885-889 | crates/perry-codegen/src/lower_conditional.rs:364-370 | crates/perry-codegen/src/lower_string_concat.rs:288-293 | crates/perry-codegen/src/native_value/materialize.rs:488-493 | crates/perry-codegen/src/stmt/if_stmt.rs:183-191 | crates/perry-codegen/src/stmt/loops.rs:551-557 | crates/perry-codegen/src/stmt/loops.rs:790-796 | crates/perry-codegen/src/stmt/loops.rs:3814-3820 | crates/perry-codegen/src/stmt/number_local_loop.rs:456-461 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:913-918 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1231-1236 | crates/perry-codegen/src/stmt/string_length_loop.rs:209-214 — before extracting anything, compare `crates/perry-codegen/src/builtin_proto.rs` and `crates/perry-codegen/src/expr/instance_misc1.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 29) crates/perry-codegen/src/expr/calls.rs:193— crates/perry-codegen/src/expr/calls.rs:193-201 | crates/perry-codegen/src/expr/calls.rs:254-262 | crates/perry-codegen/src/expr/calls.rs:268-276 | crates/perry-codegen/src/expr/calls.rs:282-290 | crates/perry-codegen/src/expr/calls.rs:296-304 | crates/perry-codegen/src/expr/calls.rs:399-407 | crates/perry-codegen/src/expr/calls.rs:412-420 | crates/perry-codegen/src/expr/calls.rs:425-433 | crates/perry-codegen/src/expr/calls.rs:443-451 | crates/perry-codegen/src/expr/calls.rs:457-465 | crates/perry-codegen/src/expr/calls.rs:504-512 | crates/perry-codegen/src/expr/calls.rs:517-525 | crates/perry-codegen/src/expr/calls.rs:531-539 | crates/perry-codegen/src/expr/calls.rs:545-553 | crates/perry-codegen/src/expr/calls.rs:560-568 | crates/perry-codegen/src/expr/calls.rs:572-580 | crates/perry-codegen/src/expr/calls.rs:605-613 | crates/perry-codegen/src/expr/calls.rs:620-628 | crates/perry-codegen/src/expr/calls.rs:635-643 | crates/perry-codegen/src/expr/calls.rs:648-656 | crates/perry-codegen/src/expr/calls.rs:661-669 | crates/perry-codegen/src/expr/calls.rs:674-682 | crates/perry-codegen/src/expr/calls.rs:687-695 | crates/perry-codegen/src/expr/calls.rs:700-708 | crates/perry-codegen/src/expr/calls.rs:717-725 | crates/perry-codegen/src/expr/calls.rs:730-738 | crates/perry-codegen/src/expr/calls.rs:747-755 | crates/perry-codegen/src/expr/calls.rs:762-770 | crates/perry-codegen/src/expr/calls.rs:778-786 — all 29 copies are in the same file, so extract the block into one function there and call 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 × 15) crates/perry-codegen/src/codegen/helpers.rs:265— crates/perry-codegen/src/codegen/helpers.rs:265-272 | crates/perry-codegen/src/codegen/helpers.rs:514-521 | crates/perry-codegen/src/codegen/helpers.rs:1663-1670 | crates/perry-codegen/src/codegen/spec_abi.rs:50-57 | crates/perry-codegen/src/collectors/definite_init.rs:69-76 | crates/perry-codegen/src/collectors/proven_this.rs:130-137 | crates/perry-codegen/src/collectors/ptr_numarray.rs:113-120 | crates/perry-codegen/src/collectors/ptr_shape.rs:152-159 | crates/perry-codegen/src/collectors/typed_locals.rs:42-49 | crates/perry-codegen/src/expr/mod.rs:4810-4817 | crates/perry-codegen/src/expr/repsel_gates.rs:90-97 | crates/perry-codegen/src/expr/slot_rep.rs:227-234 | crates/perry-codegen/src/expr/slot_rep.rs:243-250 | crates/perry-codegen/src/lower_call/method_override.rs:232-239 | crates/perry-codegen/src/stmt/stable_packed_accumulator.rs:17-24 — before extracting anything, compare `crates/perry-codegen/src/collectors/ptr_numarray.rs` and `crates/perry-codegen/src/collectors/ptr_shape.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 55) crates/perry-codegen/src/builtin_proto.rs:211— crates/perry-codegen/src/builtin_proto.rs:211-215 | crates/perry-codegen/src/codegen/checked_integer.rs:377-381 | crates/perry-codegen/src/expr/array_literal.rs:309-314 | crates/perry-codegen/src/expr/array_literal.rs:433-437 | crates/perry-codegen/src/expr/bigint_set.rs:84-88 | crates/perry-codegen/src/expr/bigint_set.rs:196-200 | crates/perry-codegen/src/expr/bigint_set.rs:263-267 | crates/perry-codegen/src/expr/binary.rs:1052-1056 | crates/perry-codegen/src/expr/checked_super.rs:119-123 | crates/perry-codegen/src/expr/class_env.rs:155-159 | crates/perry-codegen/src/expr/class_first_evaluation.rs:89-93 | crates/perry-codegen/src/expr/collection_receiver.rs:66-70 | crates/perry-codegen/src/expr/compare.rs:477-481 | crates/perry-codegen/src/expr/compare.rs:876-880 | crates/perry-codegen/src/expr/family_slot.rs:278-282 | crates/perry-codegen/src/expr/folded_builtin_override.rs:850-854 | crates/perry-codegen/src/expr/index_get/symbol_ic.rs:36-40 | crates/perry-codegen/src/expr/inline_birth/fixed_alloc.rs:47-51 | crates/perry-codegen/src/expr/inline_birth/shared.rs:139-143 | crates/perry-codegen/src/expr/instance_misc1.rs:284-288 | crates/perry-codegen/src/expr/instance_misc1.rs:744-748 | crates/perry-codegen/src/expr/literals_vars.rs:856-860 | crates/perry-codegen/src/expr/literals_vars.rs:1110-1114 | crates/perry-codegen/src/expr/logical_collections.rs:486-490 | crates/perry-codegen/src/expr/logical_collections.rs:1741-1745 | crates/perry-codegen/src/expr/math_simple.rs:207-211 | crates/perry-codegen/src/expr/math_simple.rs:302-306 | crates/perry-codegen/src/expr/math_simple.rs:371-375 | crates/perry-codegen/src/expr/pod_record.rs:48-53 | crates/perry-codegen/src/expr/pod_record.rs:282-287 | crates/perry-codegen/src/expr/pod_record.rs:356-361 | crates/perry-codegen/src/expr/pod_record.rs:559-564 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:181-185 | crates/perry-codegen/src/expr/property_get/helpers.rs:599-603 | crates/perry-codegen/src/expr/static_field_meta.rs:138-142 | crates/perry-codegen/src/expr/static_method.rs:483-487 | crates/perry-codegen/src/expr/suffix_cursor.rs:58-62 | crates/perry-codegen/src/expr/unary.rs:54-58 | crates/perry-codegen/src/lower_call/early_branches.rs:533-537 | crates/perry-codegen/src/lower_call/extern_func/pod_params.rs:306-311 | crates/perry-codegen/src/lower_call/func_ref.rs:213-217 | crates/perry-codegen/src/lower_call/new_alloc.rs:884-888 | crates/perry-codegen/src/lower_conditional.rs:362-368 | crates/perry-codegen/src/lower_string_concat.rs:287-291 | crates/perry-codegen/src/native_value/materialize.rs:487-491 | crates/perry-codegen/src/stmt/class_first_loop.rs:42-46 | crates/perry-codegen/src/stmt/class_first_loop.rs:93-97 | crates/perry-codegen/src/stmt/if_stmt.rs:181-188 | crates/perry-codegen/src/stmt/loops.rs:550-555 | crates/perry-codegen/src/stmt/loops.rs:789-794 | crates/perry-codegen/src/stmt/loops.rs:3813-3818 | crates/perry-codegen/src/stmt/number_local_loop.rs:455-459 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:912-916 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1230-1234 | crates/perry-codegen/src/stmt/string_length_loop.rs:208-212 — before extracting anything, compare `crates/perry-codegen/src/builtin_proto.rs` and `crates/perry-codegen/src/expr/instance_misc1.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 35) crates/perry-codegen/src/codegen/entry.rs:1251— crates/perry-codegen/src/codegen/entry.rs:1251-1256 | crates/perry-codegen/src/codegen/global_transfer.rs:217-222 | crates/perry-codegen/src/concat_site_cache.rs:197-202 | crates/perry-codegen/src/expr/array_pop.rs:60-65 | crates/perry-codegen/src/expr/array_push.rs:1124-1130 | crates/perry-codegen/src/expr/class_field_push.rs:30-35 | crates/perry-codegen/src/expr/compare.rs:246-252 | crates/perry-codegen/src/expr/compare.rs:605-610 | crates/perry-codegen/src/expr/compare.rs:956-961 | crates/perry-codegen/src/expr/compare.rs:1093-1098 | crates/perry-codegen/src/expr/compare_short_string.rs:19-24 | crates/perry-codegen/src/expr/i32_fast_path.rs:671-676 | crates/perry-codegen/src/expr/index.rs:138-144 | crates/perry-codegen/src/expr/index_get/guarded_array.rs:933-938 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:145-150 | crates/perry-codegen/src/expr/index_get/inline_dyn_typed_array.rs:801-806 | crates/perry-codegen/src/expr/index_set_typed_array.rs:289-294 | crates/perry-codegen/src/expr/layout_read.rs:242-247 | crates/perry-codegen/src/expr/layout_read.rs:800-807 | crates/perry-codegen/src/expr/property_get.rs:535-540 | crates/perry-codegen/src/expr/property_get/generic_dispatch.rs:566-571 | crates/perry-codegen/src/expr/shadow_inline.rs:140-145 | crates/perry-codegen/src/expr/ta_element_read.rs:232-237 | crates/perry-codegen/src/expr/ta_param_f64_read.rs:253-258 | crates/perry-codegen/src/expr/typed_array_rmw.rs:291-296 | crates/perry-codegen/src/lower_string_method/char_code_at.rs:210-215 | crates/perry-codegen/src/proto_constants.rs:230-235 | crates/perry-codegen/src/proto_constants.rs:567-572 | crates/perry-codegen/src/stmt/loops.rs:3877-3882 | crates/perry-codegen/src/stmt/loops.rs:5326-5331 | crates/perry-codegen/src/stmt/masked_window_region.rs:920-925 | crates/perry-codegen/src/stmt/region_loop/guard.rs:131-136 | crates/perry-codegen/src/stmt/region_loop/guard.rs:623-628 | crates/perry-codegen/src/stmt/stable_packed_loop.rs:1054-1059 | crates/perry-codegen/src/stmt/versioned_indexed_loop.rs:486-491 — before extracting anything, compare `crates/perry-codegen/src/expr/array_pop.rs` and `crates/perry-codegen/src/expr/class_field_push.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 (3–6 lines × 6) crates/perry-hir/src/lower/expr_call/array_only_methods.rs:955— crates/perry-hir/src/lower/expr_call/array_only_methods.rs:955-957 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:959-964 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:991-995 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:996-1001 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1005-1010 | crates/perry-hir/src/lower/expr_call/array_only_methods.rs:1014-1019 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 20) crates/perry-codegen/src/expr/array_methods.rs:336— crates/perry-codegen/src/expr/array_methods.rs:336-340 | crates/perry-codegen/src/expr/arrays_finds.rs:725-729 | crates/perry-codegen/src/expr/env_clones.rs:34-38 | crates/perry-codegen/src/expr/os_uri_dates.rs:144-148 | crates/perry-codegen/src/expr/os_uri_dates.rs:150-154 | crates/perry-codegen/src/expr/os_uri_dates.rs:156-160 | crates/perry-codegen/src/expr/os_uri_dates.rs:162-166 | crates/perry-codegen/src/expr/os_uri_dates.rs:168-172 | crates/perry-codegen/src/expr/os_uri_dates.rs:174-178 | crates/perry-codegen/src/expr/os_uri_dates.rs:180-184 | crates/perry-codegen/src/expr/os_uri_dates.rs:186-190 | crates/perry-codegen/src/expr/os_uri_dates.rs:192-196 | crates/perry-codegen/src/expr/os_uri_dates.rs:198-202 | crates/perry-codegen/src/expr/string_regex_proc.rs:33-37 | crates/perry-codegen/src/expr/string_regex_proc.rs:303-307 | crates/perry-codegen/src/expr/string_regex_proc.rs:310-314 | crates/perry-codegen/src/expr/string_regex_proc.rs:393-397 | crates/perry-codegen/src/expr/string_regex_proc.rs:399-403 | crates/perry-codegen/src/expr/string_regex_proc.rs:487-491 | crates/perry-codegen/src/expr/string_regex_proc.rs:588-592 — before extracting anything, compare `crates/perry-codegen/src/expr/arrays_finds.rs` and `crates/perry-codegen/src/expr/string_regex_proc.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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 (87 lines × 2) android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:124— android-build/app/src/main/java/com/perry/app/HoneEditorView.kt:124-210 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/HoneEditorView.kt:124-210 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/HoneEditorView.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/HoneEditorView.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (43 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:524— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:524-566 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:675-717 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (36–38 lines × 2) android-build/app/src/main/java/com/perry/app/PerryBridge.kt:825— android-build/app/src/main/java/com/perry/app/PerryBridge.kt:825-860 | crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:1171-1208 — before extracting anything, compare `android-build/app/src/main/java/com/perry/app/PerryBridge.kt` and `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt` as WHOLE FILES: this scan already matched 74 separate duplicated blocks between them, totalling at least 1129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `android-build/app/src/main/java/com/perry/app/PerryBridge.kt:825` 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 (37 lines × 2) docs/audits/gc-rss-instructions-2026-10-03/qb6-current0ed-build-v14.py:70— docs/audits/gc-rss-instructions-2026-10-03/qb6-current0ed-build-v14.py:70-106 | docs/audits/gc-rss-instructions-2026-10-03/qb6-currente532-build-v1.py:61-97 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/qb6-current0ed-build-v14.py` and `docs/audits/gc-rss-instructions-2026-10-03/qb6-currente532-build-v1.py` as WHOLE FILES: 82% 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. If that is what happened, the fix is to keep one copy and have the 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 `docs/audits/gc-rss-instructions-2026-10-03/qb6-current0ed-build-v14.py: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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (24–25 lines × 2) scripts/gc_root_dominance_check.py:2737— scripts/gc_root_dominance_check.py:2737-2760 | scripts/gc_root_dominance_check.py:5691-5715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/gc_root_dominance_check.py:2737` 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 (21–23 lines × 3) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:38— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:38-58 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:38-58 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:38-60 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–18 lines × 2) scripts/native_export_collisions.py:177— scripts/native_export_collisions.py:177-194 | scripts/native_export_collisions.py:239-249 — both copies are in the same file, so extract the 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 (14–18 lines × 2) scripts/sso_unbox_inventory.py:584— scripts/sso_unbox_inventory.py:584-597 | scripts/string_payload_access_inventory.py:426-443 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `scripts/sso_unbox_inventory.py:584` it does not close everything it opens, so those 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–17 lines × 2) scripts/thread_exit_address_globals.py:676— scripts/thread_exit_address_globals.py:676-692 | scripts/thread_exit_address_globals.py:792-803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/thread_exit_address_globals.py:676` 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 × 8) docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:59— docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:59-71 | docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:84-96 | docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:84-96 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:83-95 | docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-v79-auto.py:67-79 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:83-95 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:83-95 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:93-105 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py` and `docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py` as WHOLE FILES: 84% 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 3 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. If that is what happened, the fix is to keep one copy and have the 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 (4–9 lines × 7) scripts/component_async_acceptance.py:54— scripts/component_async_acceptance.py:54-57 | scripts/component_async_guest_cancellation_acceptance.py:32-35 | scripts/component_async_guest_exports_acceptance.py:45-48 | scripts/component_persistent_acceptance.py:45-48 | scripts/component_producer_acceptance.py:54-62 | scripts/component_reader_acceptance.py:52-60 | scripts/component_scheduler_wake_acceptance.py:40-43 — before extracting anything, compare `scripts/component_async_acceptance.py` and `scripts/component_persistent_acceptance.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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–8 lines × 4) scripts/component_async_compound_resources_acceptance.py:18— scripts/component_async_compound_resources_acceptance.py:18-25 | scripts/component_async_guest_cancellation_acceptance.py:17-20 | scripts/component_async_guest_resources_acceptance.py:22-29 | scripts/component_async_resource_cancel_acceptance.py:18-25 — before extracting anything, compare `scripts/component_async_compound_resources_acceptance.py` and `scripts/component_async_resource_cancel_acceptance.py` as WHOLE FILES: this scan already matched 5 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. 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–7 lines × 3) docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:111— docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py:111-117 | docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:110-111 | docs/audits/gc-rss-instructions-2026-10-03/gc-final-instruction-profile.py:113-119 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/gc-current0ed-instruction-profile-v21.py` and `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `docs/audits/gc-rss-instructions-2026-10-03/gc-currentc170-regression-profile-v23.py:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) scripts/turnloop_p0_loop_stats.py:55— scripts/turnloop_p0_loop_stats.py:55-61 | scripts/turnloop_p0_native_probe.py:124-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (2–6 lines × 4) scripts/buffer_b1_validate.py:171— scripts/buffer_b1_validate.py:171-176 | scripts/buffer_b4_validate.py:183-188 | scripts/buffer_b5_validate.py:39-40 | scripts/buffer_b5_validate.py:51-52 — before extracting anything, compare `scripts/buffer_b1_validate.py` and `scripts/buffer_b4_validate.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `scripts/buffer_b5_validate.py:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 9) docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:39— docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:39-42 | docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:45-47 | docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:66-70 | docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:66-70 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:65-69 | docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-v79-auto.py:49-53 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:65-69 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:65-69 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:75-79 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py` and `docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py` as WHOLE FILES: 84% 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 3 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. If that is what happened, the fix is to keep one copy and have the 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. 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, `docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:43` calls `exists`, `disk_usage` and `docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:70` 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 × 8) docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:72— docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py:72-74 | docs/audits/gc-rss-instructions-2026-10-03/primary-entry-once-main07-v46-auto.py:97-99 | docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py:97-99 | docs/audits/gc-rss-instructions-2026-10-03/primary-learned-floor-main07-v60-auto.py:96-98 | docs/audits/gc-rss-instructions-2026-10-03/primary-mainad0-v79-auto.py:82-86 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69-auto.py:96-98 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r1-auto.py:96-98 | docs/audits/gc-rss-instructions-2026-10-03/primary-map-prefix-main07-v69r2-auto.py:108-112 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/latest-main2026-normal-auto-driver.py` and `docs/audits/gc-rss-instructions-2026-10-03/primary-lazy-rss-main07-v52-auto.py` as WHOLE FILES: 84% 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 3 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. If that is what happened, the fix is to keep one copy and have the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. 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–20 lines × 8) docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:13— docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:13-15 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:16-16 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:17-18 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:19-21 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:22-23 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:24-26 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28r1.py:10-29 | docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28r2.py:10-29 — before extracting anything, compare `docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28r1.py` and `docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28r2.py` as WHOLE FILES: 94% 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. If that is what happened, the fix is to keep one copy and have the 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 `docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:17` 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, `docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:15` calls `match`, `split`, `dict` and `docs/audits/gc-rss-instructions-2026-10-03/currentc170-peak-mappings-v28.py:18` 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.
Duplication concentrated across 2 sibling directories (22 clone groups) crates/perry-codegen-js/src/web_runtime.js:3423— 22 duplicated blocks under crates/ have copies in at least two of the sibling directories perry-codegen-js, perry-codegen-wasm — 18 of them are reported below, and 4 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 22 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 22 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 22 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.
Duplicated block (166 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:3423— crates/perry-codegen-js/src/web_runtime.js:3423 · crates/perry-codegen-wasm/src/wasm_runtime.js:3933 — 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 (75 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:1827— crates/perry-codegen-js/src/web_runtime.js:1827 · crates/perry-codegen-wasm/src/wasm_runtime.js:3645 — 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 (52 lines × 2 locations) crates/perry-codegen-js/src/web_runtime.js:1416— crates/perry-codegen-js/src/web_runtime.js:1416 · crates/perry-codegen-wasm/src/wasm_runtime.js:3521 — 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 (46 matched lines × 2 locations) · ×1
Duplicated block with local edits (46 matched lines × 2 locations) scripts/turnloop/apps/mysql_parity.ts:25— scripts/turnloop/apps/mysql_parity.ts:25 · scripts/turnloop/apps/mysql_pool_parity.ts:18 — the two spans are one implementation copied and then locally edited — 379 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) scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:20— scripts/turnloop/apps/_helpers/p9_worker_acceptance_worker.ts:20 · scripts/turnloop/apps/p9_worker_agent_acceptance.ts:36 — 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 (39 lines × 4 locations) scripts/test-exported-local-storage.mjs:9— scripts/test-exported-local-storage.mjs:9 · scripts/test-imported-value-class-collision.mjs:9 · scripts/test-object-array-methods.mjs:9 · scripts/test-string-static-spread.mjs:9 — the 4 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. There is one copy in each of 4 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication· Duplicated block with local edits (27 matched lines × 2 locations) · ×1
Duplicated block with local edits (27 matched lines × 2 locations) upstream/actions/actions/upload-artifact/src/merge/input-helper.ts:9— upstream/actions/actions/upload-artifact/src/merge/input-helper.ts:9 · upstream/actions/actions/upload-artifact/src/upload/input-helper.ts:9 — the two spans are one implementation copied and then locally edited — 177 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 (25 lines × 2 locations) crates/perry-codegen-wasm/src/wasm_runtime.js:2518— crates/perry-codegen-wasm/src/wasm_runtime.js:2518 · crates/perry-codegen-wasm/src/wasm_runtime.js:2547 — both copies are in the same file, so extract the block into 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 × 5 locations) scripts/test-exported-local-storage.mjs:25— scripts/test-exported-local-storage.mjs:25 · scripts/test-import-meta-require-value.mjs:25 · scripts/test-imported-value-class-collision.mjs:26 · scripts/test-object-array-methods.mjs:26 · +1 more site(s) not listed — the 5 copies are spread across 5 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 (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) scripts/turnloop/apps/_helpers/p9_worker_gc_stress_worker.ts:17— scripts/turnloop/apps/_helpers/p9_worker_gc_stress_worker.ts:17 · scripts/turnloop/apps/p9_worker_gc_stress.ts:22 — the two spans are one implementation copied and then locally edited — 205 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 (22 lines × 2 locations) scripts/turnloop/apps/mongo_parity.ts:57— scripts/turnloop/apps/mongo_parity.ts:57 · scripts/turnloop/apps/mongo_tls_parity.ts:72 — 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 (21 lines × 2 locations) scripts/turnloop/apps/mongo_parity.ts:17— scripts/turnloop/apps/mongo_parity.ts:17 · scripts/turnloop/apps/mongo_tls_parity.ts:32 — 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 (20 matched lines × 2 locations) · ×1
Duplicated block with local edits (20 matched lines × 2 locations) scripts/test-export-dollar-underscore-collision.mjs:20— scripts/test-export-dollar-underscore-collision.mjs:20 · scripts/test-namespace-getter-binding-identity.mjs:30 — the two spans are one implementation copied and then locally edited — 260 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 (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) upstream/actions/actions/download-artifact/src/download-artifact.ts:149— upstream/actions/actions/download-artifact/src/download-artifact.ts:149 · upstream/actions/actions/upload-artifact/src/merge/merge-artifacts.ts:23 — the two spans are one implementation copied and then locally edited — 121 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 (16 lines × 3 locations) scripts/turnloop/apps/db_thread_census.ts:145— scripts/turnloop/apps/db_thread_census.ts:145 · scripts/turnloop/apps/pg_thread_census.ts:73 · scripts/turnloop/apps/pg_thread_census.ts:115 — the 3 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 (14 matched lines × 2 locations) · ×1
Duplicated block with local edits (14 matched lines × 2 locations) scripts/turnloop/apps/p9_socket_concurrency.ts:55— scripts/turnloop/apps/p9_socket_concurrency.ts:55 · scripts/turnloop/apps/p9_worker_message_fanin.ts:29 — the two spans are one implementation copied and then locally edited — 94 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.
Boundary violation [package:undeclared-workspace-dep] packages/perry-solid/src/index.ts:1— packages/perry-solid/src/index.ts:1 imports perry/ui, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies.
R2 · Cyclomatic Complexity· Complex function big (cyclomatic 140, cognitive 145) · ×1
Complex function big (cyclomatic 140, cognitive 145) test-files/test_gap_split_regions.ts:10— big has cyclomatic complexity 140 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 60, cognitive 76) · ×1
Complex function main (cyclomatic 60, cognitive 76) upstream/actions/jdx/mr-boxington-action/src/index.ts:330— main has cyclomatic complexity 60 and cognitive complexity 76; 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 findConfigurationObject (cyclomatic 58, cognitive 37) upstream/actions/actions/configure-pages/src/config-parser.js:138— findConfigurationObject has cyclomatic complexity 58 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 (top-level) (cyclomatic 56, cognitive 55) test-files/test_gap_builtin_constructor_statics2_inherited.ts:2— (top-level) has cyclomatic complexity 56 and cognitive complexity 55; 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 _perryCodeToKey (cyclomatic 55, cognitive 29) crates/perry-codegen-js/src/web_runtime.js:1831— _perryCodeToKey has cyclomatic complexity 55 and cognitive complexity 29; 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 __perryCodeToKey (cyclomatic 55, cognitive 29) crates/perry-codegen-wasm/src/wasm_runtime.js:3652— __perryCodeToKey has cyclomatic complexity 55 and cognitive complexity 29; 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 sloppyArm (cyclomatic 45, cognitive 44) test-files/test_gap_9459_property_set_strictness.cts:148— sloppyArm has cyclomatic complexity 45 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function strictArm (cyclomatic 45, cognitive 44) test-files/test_gap_9459_property_set_strictness.cts:633— strictArm has cyclomatic complexity 45 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _mapKeyToAction (cyclomatic 45, cognitive 43) crates/perry-codegen-js/src/web_runtime.js:2245— _mapKeyToAction has cyclomatic complexity 45 and cognitive complexity 43; 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 namedColor (cyclomatic 40, cognitive 39) packages/perry-styling/src/color.ts:155— namedColor has cyclomatic complexity 40 and cognitive complexity 39; 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.
R2 · Cyclomatic Complexity· Complex function run (cyclomatic 37, cognitive 70) · ×1
Complex function run (cyclomatic 37, cognitive 70) test-files/_helpers/fake_mongo_server.ts:79— run has cyclomatic complexity 37 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 getSource (cyclomatic 35, cognitive 53) upstream/actions/actions/checkout/src/git-source-provider.ts:18— getSource has cyclomatic complexity 35 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 generateTheme (cyclomatic 34, cognitive 66) packages/perry-styling/src/generator.ts:52— generateTheme has cyclomatic complexity 34 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 ensureTagAndRelease (cyclomatic 33, cognitive 51) scripts/publish/release.mts:123— ensureTagAndRelease has cyclomatic complexity 33 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 getInputs (cyclomatic 33, cognitive 28) upstream/actions/actions/checkout/src/input-helper.ts:9— getInputs has cyclomatic complexity 33 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
R3 · Large Files· crates/perry-codegen-wasm/src/wasm_runtime.js · ×1
crates/perry-codegen-wasm/src/wasm_runtime.js: 4745 lines of code crates/perry-codegen-wasm/src/wasm_runtime.js:1— crates/perry-codegen-wasm/src/wasm_runtime.js has 4745 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· crates/perry-codegen-js/src/web_runtime.js · ×1
crates/perry-codegen-js/src/web_runtime.js: 3805 lines of code crates/perry-codegen-js/src/web_runtime.js:1— crates/perry-codegen-js/src/web_runtime.js has 3805 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· test-files/test_gap_13049_chunked_literal_births.ts · ×1
test-files/test_gap_13049_chunked_literal_births.ts: 2985 lines of code test-files/test_gap_13049_chunked_literal_births.ts:1— test-files/test_gap_13049_chunked_literal_births.ts has 2985 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· test-files/test_gap_element_receiver_regions.ts · ×1
test-files/test_gap_element_receiver_regions.ts: 1769 lines of code test-files/test_gap_element_receiver_regions.ts:1— test-files/test_gap_element_receiver_regions.ts has 1769 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· test-files/test_gap_array_layout_multi_unit.ts · ×1
test-files/test_gap_array_layout_multi_unit.ts: 1232 lines of code test-files/test_gap_array_layout_multi_unit.ts:1— test-files/test_gap_array_layout_multi_unit.ts has 1232 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· test-files/test_gap_10418_bigint_bitwise_typing.ts · ×1
test-files/test_gap_10418_bigint_bitwise_typing.ts: 1017 lines of code test-files/test_gap_10418_bigint_bitwise_typing.ts:1— test-files/test_gap_10418_bigint_bitwise_typing.ts has 1017 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· test-files/test_gap_10420_call_arity_limits.ts · ×1
test-files/test_gap_10420_call_arity_limits.ts: 944 lines of code test-files/test_gap_10420_call_arity_limits.ts:1— test-files/test_gap_10420_call_arity_limits.ts has 944 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· upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts · ×1
upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts: 917 lines of code upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts:1— upstream/actions/jdx/mr-boxington-action/src/objects-cache.ts has 917 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· test-files/test_gap_builtin_constructor_statics2_inherited.ts · ×1
test-files/test_gap_builtin_constructor_statics2_inherited.ts: 894 lines of code test-files/test_gap_builtin_constructor_statics2_inherited.ts:1— test-files/test_gap_builtin_constructor_statics2_inherited.ts has 894 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· test-files/test_gap_forward_class_binding_class_captures.ts · ×1
test-files/test_gap_forward_class_binding_class_captures.ts: 710 lines of code test-files/test_gap_forward_class_binding_class_captures.ts:1— test-files/test_gap_forward_class_binding_class_captures.ts has 710 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· upstream/actions/jdx/mr-boxington-action/src/index.ts · ×1
upstream/actions/jdx/mr-boxington-action/src/index.ts: 684 lines of code upstream/actions/jdx/mr-boxington-action/src/index.ts:1— upstream/actions/jdx/mr-boxington-action/src/index.ts has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 661 lines of code REDACTED:1— REDACTED has 661 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· upstream/actions/actions/checkout/src/git-command-manager.ts · ×1
upstream/actions/actions/checkout/src/git-command-manager.ts: 655 lines of code upstream/actions/actions/checkout/src/git-command-manager.ts:1— upstream/actions/actions/checkout/src/git-command-manager.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· test-files/test_gap_gc_11929_stable_home_marking.ts · ×1
test-files/test_gap_gc_11929_stable_home_marking.ts: 626 lines of code test-files/test_gap_gc_11929_stable_home_marking.ts:1— test-files/test_gap_gc_11929_stable_home_marking.ts has 626 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· test-files/test_gap_json_record_loop_clone.ts · ×1
test-files/test_gap_json_record_loop_clone.ts: 612 lines of code test-files/test_gap_json_record_loop_clone.ts:1— test-files/test_gap_json_record_loop_clone.ts has 612 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· test-files/test_gap_split_regions.ts · ×1
test-files/test_gap_split_regions.ts: 600 lines of code test-files/test_gap_split_regions.ts:1— test-files/test_gap_split_regions.ts has 600 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· test-files/test_gap_10476_builtin_named_guarded_receivers.ts · ×1
test-files/test_gap_10476_builtin_named_guarded_receivers.ts: 590 lines of code test-files/test_gap_10476_builtin_named_guarded_receivers.ts:1— test-files/test_gap_10476_builtin_named_guarded_receivers.ts has 590 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· test-files/test_gap_typed_array_compound_update.ts · ×1
test-files/test_gap_typed_array_compound_update.ts: 562 lines of code test-files/test_gap_typed_array_compound_update.ts:1— test-files/test_gap_typed_array_compound_update.ts has 562 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· test-files/test_gap_10894_typed_array_generic_annotation.ts · ×1
test-files/test_gap_10894_typed_array_generic_annotation.ts: 558 lines of code test-files/test_gap_10894_typed_array_generic_annotation.ts:1— test-files/test_gap_10894_typed_array_generic_annotation.ts has 558 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· upstream/actions/actions/checkout/src/git-auth-helper.ts · ×1
upstream/actions/actions/checkout/src/git-auth-helper.ts: 538 lines of code upstream/actions/actions/checkout/src/git-auth-helper.ts:1— upstream/actions/actions/checkout/src/git-auth-helper.ts has 538 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· test-files/test_gap_9445_implicit_this_restore_sweep.ts · ×1
test-files/test_gap_9445_implicit_this_restore_sweep.ts: 521 lines of code test-files/test_gap_9445_implicit_this_restore_sweep.ts:1— test-files/test_gap_9445_implicit_this_restore_sweep.ts has 521 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· test-files/test_gap_dynamic_get_matrix.ts · ×1
test-files/test_gap_dynamic_get_matrix.ts: 506 lines of code test-files/test_gap_dynamic_get_matrix.ts:1— test-files/test_gap_dynamic_get_matrix.ts has 506 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· upstream/actions/jdx/mr-boxington-action/src/lib.ts · ×1
upstream/actions/jdx/mr-boxington-action/src/lib.ts: 498 lines of code upstream/actions/jdx/mr-boxington-action/src/lib.ts:1— upstream/actions/jdx/mr-boxington-action/src/lib.ts has 498 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· test-files/test_gap_10419_generator_loop_header_yield.ts · ×1
test-files/test_gap_10419_generator_loop_header_yield.ts: 493 lines of code test-files/test_gap_10419_generator_loop_header_yield.ts:1— test-files/test_gap_10419_generator_loop_header_yield.ts has 493 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/perry-updater/src/index.ts · ×1
packages/perry-updater/src/index.ts: 472 lines of code packages/perry-updater/src/index.ts:1— packages/perry-updater/src/index.ts has 472 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· test-files/test_gap_repsel_element_shape_loop_clone.ts · ×1
test-files/test_gap_repsel_element_shape_loop_clone.ts: 471 lines of code test-files/test_gap_repsel_element_shape_loop_clone.ts:1— test-files/test_gap_repsel_element_shape_loop_clone.ts has 471 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· test-files/_helpers/h2_wire.ts · ×1
test-files/_helpers/h2_wire.ts: 459 lines of code test-files/_helpers/h2_wire.ts:1— test-files/_helpers/h2_wire.ts has 459 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· test-files/test_gap_repsel_ptr_shape_locals.ts · ×1
test-files/test_gap_repsel_ptr_shape_locals.ts: 448 lines of code test-files/test_gap_repsel_ptr_shape_locals.ts:1— test-files/test_gap_repsel_ptr_shape_locals.ts has 448 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· test-files/test_gap_typed_array_guarded_view_keys.ts · ×1
test-files/test_gap_typed_array_guarded_view_keys.ts: 446 lines of code test-files/test_gap_typed_array_guarded_view_keys.ts:1— test-files/test_gap_typed_array_guarded_view_keys.ts has 446 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· test-files/test_gap_lblk_labeled_blocks.ts · ×1
test-files/test_gap_lblk_labeled_blocks.ts: 432 lines of code test-files/test_gap_lblk_labeled_blocks.ts:1— test-files/test_gap_lblk_labeled_blocks.ts has 432 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· test-files/test_issue_945_scalar_method_guards.ts · ×1
test-files/test_issue_945_scalar_method_guards.ts: 430 lines of code test-files/test_issue_945_scalar_method_guards.ts:1— test-files/test_issue_945_scalar_method_guards.ts has 430 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· example-code/forgejo-deployment/main.ts · ×1
example-code/forgejo-deployment/main.ts: 427 lines of code example-code/forgejo-deployment/main.ts:1— example-code/forgejo-deployment/main.ts has 427 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· test-files/test_gap_received_value_diagnostics.ts · ×1
test-files/test_gap_received_value_diagnostics.ts: 424 lines of code test-files/test_gap_received_value_diagnostics.ts:1— test-files/test_gap_received_value_diagnostics.ts has 424 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· test-files/test_issue_5893_private_brand_freshness.ts · ×1
test-files/test_issue_5893_private_brand_freshness.ts: 415 lines of code test-files/test_issue_5893_private_brand_freshness.ts:1— test-files/test_issue_5893_private_brand_freshness.ts has 415 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· test-files/test_ffi_surface_runtime_core.ts · ×1
test-files/test_ffi_surface_runtime_core.ts: 409 lines of code test-files/test_ffi_surface_runtime_core.ts:1— test-files/test_ffi_surface_runtime_core.ts has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Unused dependency 'run-local-ci' — Declared in the root 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 'slugify' — Declared in the root 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.
Third-party script without Subresource Integrity docs/theme/head.hbs:2— `https://pa.skelpo.com/js/pa-R_kbATcyJ91THVHqtLpnN.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository.
X28 · Index access outside its own emptiness guard· Index access outside its own emptiness guard · ×1
Index access outside its own emptiness guard scripts/measure_linux_rss_ab.py:295— This condition tests `fields` for emptiness and then indexes it on a branch that test does not reach. `fields[2]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `fields` being empty — so an empty `fields` indexes position 2 of nothing and throws. This same condition already shows the intended bracketing: `fields[4]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `fields` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `fields`.
Classify ADR enforcement: 0000-ci-fast-feedback changelog.d/0000-ci-fast-feedback.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 0000-sqlite-handle-properties changelog.d/0000-sqlite-handle-properties.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 0000-sqlite-run-row-returning changelog.d/0000-sqlite-run-row-returning.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 2879-concat-typed-array-not-spreadable changelog.d/2879-concat-typed-array-not-spreadable.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 4644-retained-growth-verifier changelog.d/4644-retained-growth-verifier.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 4975-http-header-array changelog.d/4975-http-header-array.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 5694-state-value-native changelog.d/5694-state-value-native.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 5716-native-binding-governance changelog.d/5716-native-binding-governance.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 5731-embed-project-root changelog.d/5731-embed-project-root.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 5742-android-x86-64 changelog.d/5742-android-x86-64.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 5756-tanstack-start-compat changelog.d/5756-tanstack-start-compat.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 5884-windows-bloomview-dpi changelog.d/5884-windows-bloomview-dpi.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6352-clang-minimum-version changelog.d/6352-clang-minimum-version.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6744-rand-0.10.1 changelog.d/6744-rand-0.10.1.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6745-wasm-encoder-0.254.0 changelog.d/6745-wasm-encoder-0.254.0.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6746-cbc-0.2.1 changelog.d/6746-cbc-0.2.1.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6747-png-0.18.1 changelog.d/6747-png-0.18.1.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6754-workspace-lints changelog.d/6754-workspace-lints.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6755-gap-snapshot-ratchet changelog.d/6755-gap-snapshot-ratchet.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6758-workspace-architecture changelog.d/6758-workspace-architecture.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6760-merge-types-into-hir changelog.d/6760-merge-types-into-hir.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6761-multiplatform-workspace changelog.d/6761-multiplatform-workspace.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6762-parity-fork-containment changelog.d/6762-parity-fork-containment.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6764-async-hooks-final changelog.d/6764-async-hooks-final.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 6784-diagnostics-worker-dispatch changelog.d/6784-diagnostics-worker-dispatch.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/save-cache.ts:69— `info` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/save-cache.ts:157— `info` at line 157 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/save-cache.ts:161— `info` at line 161 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/save-cache.ts:163— `info` at line 163 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:101— `info` at line 101 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:146— `info` at line 146 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:177— `info` at line 177 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:184— `info` at line 184 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:186— `info` at line 186 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:191— `info` at line 191 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:200— `info` at line 200 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:203— `info` at line 203 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:206— `info` at line 206 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:214— `info` at line 214 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:220— `info` at line 220 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:225— `info` at line 225 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:232— `info` at line 232 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:244— `info` at line 244 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/setup-uv.ts:276— `info` at line 276 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/update-known-checksums.ts:27— `info` at line 27 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:71— `info` at line 71 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:74— `info` at line 74 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:90— `info` at line 90 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:183— `info` at line 183 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging upstream/actions/astral-sh/setup-uv/src/utils/inputs.ts:259— `info` at line 259 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
+ 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 upstream/actions/actions/cache/src/saveImpl.ts:94— `upstream/actions/actions/cache/src/saveImpl.ts` 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.
Console output used as the logging channel upstream/actions/actions/cache/src/saveImpl.ts:114— `upstream/actions/actions/cache/src/saveImpl.ts` reports through `console.*` at line 114 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 upstream/actions/Swatinem/rust-cache/src/workspace.ts:35— `upstream/actions/Swatinem/rust-cache/src/workspace.ts` reports through `console.*` at line 35 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 experiments/llvm-inprocess-spike/spike.ts:9— `experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 9 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 experiments/llvm-inprocess-spike/spike.ts:10— `experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 10 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 experiments/llvm-inprocess-spike/spike.ts:15— `experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 15 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 experiments/llvm-inprocess-spike/spike.ts:28— `experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 28 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 experiments/llvm-inprocess-spike/spike.ts:31— `experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 31 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 experiments/llvm-inprocess-spike/spike.ts:35— `experiments/llvm-inprocess-spike/spike.ts` reports through `console.*` at line 35 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 crates/perry-hir/src/realm_fixtures/non_top.ts:12— `crates/perry-hir/src/realm_fixtures/non_top.ts` reports through `console.*` at line 12 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 crates/perry-codegen-wasm/src/wasm_runtime.js:146— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 146 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 crates/perry-codegen-wasm/src/wasm_runtime.js:147— `crates/perry-codegen-wasm/src/wasm_runtime.js` 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 crates/perry-codegen-wasm/src/wasm_runtime.js:148— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 148 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 crates/perry-codegen-wasm/src/wasm_runtime.js:977— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 977 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 crates/perry-codegen-wasm/src/wasm_runtime.js:1617— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1617 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 crates/perry-codegen-wasm/src/wasm_runtime.js:1618— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1618 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 crates/perry-codegen-wasm/src/wasm_runtime.js:1619— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1619 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 crates/perry-codegen-wasm/src/wasm_runtime.js:1620— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 1620 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 crates/perry-codegen-wasm/src/wasm_runtime.js:2678— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 2678 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 crates/perry-codegen-wasm/src/wasm_runtime.js:3924— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 3924 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 crates/perry-codegen-wasm/src/wasm_runtime.js:3934— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 3934 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 crates/perry-codegen-wasm/src/wasm_runtime.js:4144— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4144 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 crates/perry-codegen-wasm/src/wasm_runtime.js:4186— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4186 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 crates/perry-codegen-wasm/src/wasm_runtime.js:4205— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4205 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 crates/perry-codegen-wasm/src/wasm_runtime.js:4306— `crates/perry-codegen-wasm/src/wasm_runtime.js` reports through `console.*` at line 4306 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/perry/src/commands/compile/collect_modules/source_prep.rs:444— `bytes` 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/perry/src/compat_reports.rs:267— `load` turns every `Err` into `Self::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/cjs_wrap/extract_exports.rs:259— `extract_object_literal_exports_from_require` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/cjs_wrap/wrap.rs:1882— `cyclic_missing_property_names` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/embed.rs:132— `resolve_bunfs_literal_assets` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/embed.rs:188— `read_package_json_embed` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/embed.rs:208— `read_perry_toml_embed` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/library_search.rs:988— `winget_lib_candidates` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/compile/widget_build.rs:75— `read_widget_entries` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/install/lifecycle.rs:98— `read_user_allowscripts` turns every `Err` into `BTreeSet::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry/src/commands/publish/tarball.rs:197— `resolve_file_deps` 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/perry-codegen/src/codegen/static_shape_ids.rs:833— `compatible_final_layouts` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry-codegen/src/layout_desc.rs:252— `image_colour_flags` 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/perry-codegen/src/linker_temp.rs:163— `reap_stale_llvm_scratch` 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/perry-codegen/src/statepoint_report.rs:97— `take_gc_map` turns every `Err` into `GcMapTotals::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/perry-ext-http/src/agent.rs:605— `request_key` turns every `Err` into `"localhost::".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/perry-ext-http/src/server/http2_server/pump.rs:177— `process_pending_h2_events` 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/perry-ext-http/src/server/request.rs:350— `combined_headers_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/perry-ext-http/src/server/request.rs:364— `js_node_http_im_raw_headers_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/perry-ext-http/src/server/request.rs:383— `js_node_http_im_headers_distinct_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/perry-ext-http/src/server/request.rs:395— `js_node_http_im_trailers_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/perry-ext-http/src/server/request.rs:420— `js_node_http_im_trailers_distinct_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/perry-ext-net/src/payload_server.rs:478— `address_json` turns every `Err` into `"null".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/perry-ext-sharp/src/lib.rs:216— `open_image_path` 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/perry-ext-sharp/src/lib.rs:228— `decode_image_bytes` 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.
Duplicated predicate .github/actions/perry/actions/checkout/src/unsafe-pr-checkout-helper.ts:64— `!!input.commit && prShas.includes(input.commit.toLowerCase())` appears character-identically in 2 files — .github/actions/perry/actions/checkout/src/unsafe-pr-checkout-helper.ts, upstream/actions/actions/checkout/src/unsafe-pr-checkout-helper.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 .github/actions/perry/astral-sh/setup-uv/src/utils/python-runtime.ts:29— `!Array.isArray(pythons) || pythons.length !== 1 || typeof pythons[0]?.key !== "string" || pythons[0].key === ""` appears character-identically in 2 files — .github/actions/perry/astral-sh/setup-uv/src/utils/python-runtime.ts, upstream/actions/astral-sh/setup-uv/src/utils/python-runtime.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 .github/actions/perry/astral-sh/setup-uv/src/utils/config-file.ts:8— `!fs.existsSync(filePath) || !filePath.endsWith(".toml")` appears character-identically in 2 files — .github/actions/perry/astral-sh/setup-uv/src/utils/config-file.ts, upstream/actions/astral-sh/setup-uv/src/utils/config-file.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 .github/actions/perry/actions/checkout/src/git-directory-helper.ts:28— `!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) || repositoryUrl !== (await git.tryGetFetchUrl())` appears character-identically in 2 files — .github/actions/perry/actions/checkout/src/git-directory-helper.ts, upstream/actions/actions/checkout/src/git-directory-helper.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 .github/actions/perry/actions/upload-artifact/src/upload/upload-artifact.ts:61— `!inputs.archive && searchResult.filesToUpload.length > 1` appears character-identically in 2 files — .github/actions/perry/actions/upload-artifact/src/upload/upload-artifact.ts, upstream/actions/actions/upload-artifact/src/upload/upload-artifact.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 .github/actions/perry/actions/cache/src/utils/actionUtils.ts:16— `!isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost` appears character-identically in 6 files — .github/actions/perry/actions/cache/src/utils/actionUtils.ts, .github/actions/perry/actions/checkout/src/url-helper.ts, .github/actions/perry/actions/setup-node/src/cache-utils.ts, upstream/actions/actions/cache/src/utils/actionUtils.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 scripts/soak/external-tools.mts:121— `!isValidIsoDate(published) || !isValidIsoDate(removable)` appears character-identically in 2 files — scripts/soak/external-tools.mts, scripts/soak/soak.mts. 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 .github/actions/perry/oven-sh/setup-bun/src/action.ts:81— `!options.customUrl && existsSync(bunPath)` appears character-identically in 2 files — .github/actions/perry/oven-sh/setup-bun/src/action.ts, upstream/actions/oven-sh/setup-bun/src/action.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 .github/actions/perry/Swatinem/rust-cache/src/config.ts:61— `!placeholderMatches || placeholderMatches.length !== 1` appears character-identically in 2 files — .github/actions/perry/Swatinem/rust-cache/src/config.ts, upstream/actions/Swatinem/rust-cache/src/config.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 .github/actions/perry/actions/checkout/src/unsafe-pr-checkout-helper.ts:67— `!repositoryMatchesPrHead && !refMatchesPullPattern && !commitMatchesPrHeadSha` appears character-identically in 2 files — .github/actions/perry/actions/checkout/src/unsafe-pr-checkout-helper.ts, upstream/actions/actions/checkout/src/unsafe-pr-checkout-helper.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 .github/actions/perry/actions/checkout/src/git-source-provider.ts:332— `!repositoryPath || !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))` appears character-identically in 2 files — .github/actions/perry/actions/checkout/src/git-source-provider.ts, upstream/actions/actions/checkout/src/git-source-provider.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 .github/actions/perry/actions/setup-node/src/authutil.ts:21— `!scope && registryUrl.indexOf('npm.pkg.github.com') > -1` appears character-identically in 2 files — .github/actions/perry/actions/setup-node/src/authutil.ts, upstream/actions/actions/setup-node/src/authutil.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 .github/actions/perry/actions/checkout/src/misc/generate-docs.ts:75— `!segment.endsWith(' ') && !segment.endsWith('\n') && segment` appears character-identically in 2 files — .github/actions/perry/actions/checkout/src/misc/generate-docs.ts, upstream/actions/actions/checkout/src/misc/generate-docs.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 .github/actions/perry/actions/deploy-pages/src/internal/deployment.js:241— `!this.deploymentInfo || this.deploymentInfo.pending !== true` appears character-identically in 2 files — .github/actions/perry/actions/deploy-pages/src/internal/deployment.js, upstream/actions/actions/deploy-pages/src/internal/deployment.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 .github/actions/perry/oven-sh/setup-bun/src/action.ts:204— `!version || /latest|canary|action/i.test(version)` appears character-identically in 2 files — .github/actions/perry/oven-sh/setup-bun/src/action.ts, upstream/actions/oven-sh/setup-bun/src/action.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 .github/actions/perry/actions/checkout/src/github-api-helper.ts:107— `(err as any)?.status === 404 && repo.toUpperCase().endsWith('.WIKI')` appears character-identically in 2 files — .github/actions/perry/actions/checkout/src/github-api-helper.ts, upstream/actions/actions/checkout/src/github-api-helper.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 .github/actions/perry/Swatinem/rust-cache/src/config.ts:226— `(parsed.version !== 3 && parsed.version !== 4) || !("package" in parsed)` appears character-identically in 2 files — .github/actions/perry/Swatinem/rust-cache/src/config.ts, upstream/actions/Swatinem/rust-cache/src/config.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 .github/actions/perry/oven-sh/setup-bun/src/action.ts:223— `/^bun/.test(name) && entry.isDirectory()` appears character-identically in 2 files — .github/actions/perry/oven-sh/setup-bun/src/action.ts, upstream/actions/oven-sh/setup-bun/src/action.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 .github/actions/perry/actions/deploy-pages/src/internal/deployment.js:152— `Number.isFinite(reportingIntervalInput) && reportingIntervalInput > 0` appears character-identically in 2 files — .github/actions/perry/actions/deploy-pages/src/internal/deployment.js, upstream/actions/actions/deploy-pages/src/internal/deployment.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 .github/actions/perry/actions/cache/src/utils/actionUtils.ts:36— `RefKey in process.env && Boolean(process.env[RefKey])` appears character-identically in 2 files — .github/actions/perry/actions/cache/src/utils/actionUtils.ts, upstream/actions/actions/cache/src/utils/actionUtils.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 .github/actions/perry/actions/configure-pages/src/config-parser.js:188— `allowWrappingCall && defaultExport && defaultExport.declaration.type === 'CallExpression' && defaultExport.declaration.arguments.length > 0 …` appears character-identically in 2 files — .github/actions/perry/actions/configure-pages/src/config-parser.js, upstream/actions/actions/configure-pages/src/config-parser.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 .github/actions/perry/actions/configure-pages/src/config-parser.js:150— `allowWrappingCall && defaultExport && defaultExport.declaration.type === 'CallExpression' && defaultExport.declaration.arguments.length > 0 …` appears character-identically in 2 files — .github/actions/perry/actions/configure-pages/src/config-parser.js, upstream/actions/actions/configure-pages/src/config-parser.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 .github/actions/perry/actions/configure-pages/src/config-parser.js:172— `allowWrappingCall && identifierInitialization && identifierInitialization.type === 'CallExpression' && identifierInitialization.arguments.le…` appears character-identically in 2 files — .github/actions/perry/actions/configure-pages/src/config-parser.js, upstream/actions/actions/configure-pages/src/config-parser.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 .github/actions/perry/actions/configure-pages/src/config-parser.js:263— `allowWrappingCall && moduleExport && moduleExport.expression.right.type === 'CallExpression' && moduleExport.expression.right.arguments.leng…` appears character-identically in 2 files — .github/actions/perry/actions/configure-pages/src/config-parser.js, upstream/actions/actions/configure-pages/src/config-parser.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 .github/actions/perry/actions/configure-pages/src/config-parser.js:227— `allowWrappingCall && moduleExport && moduleExport.expression.right.type === 'CallExpression' && moduleExport.expression.right.arguments.leng…` appears character-identically in 2 files — .github/actions/perry/actions/configure-pages/src/config-parser.js, upstream/actions/actions/configure-pages/src/config-parser.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.
Subsumed condition operand crates/perry-wpfacts/src/tests/unit_ctor.rs:298— `src.contains("make()")` can never decide this `&&` — every value satisfying `src.contains("t.make()")` also satisfies `src.contains("make()")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-hir/tests/array_destructuring_fast_path.rs:220— `dump.contains("ArraySpread")` can never decide this `||` — every value satisfying `dump.contains("ArraySpread")` also satisfies `dump.contains("Spread")`, 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/perry-hir/src/lower/lower_module_fn.rs:304— `name.contains("node_modules/@tanstack/react-router/")` can never decide this `||` — every value satisfying `name.contains("node_modules/@tanstack/react-router/")` also satisfies `name.contains("node_modules/@tanstack/react-")`, 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/perry-codegen/tests/native_proof_regressions.rs:16591— `probe.ends_with(", double %arg2)")` can never decide this `||` — every value satisfying `probe.ends_with(", double %arg2)")` also satisfies `probe.contains(", double %")`, 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/perry-codegen/tests/native_proof_regressions.rs:15106— `ir.contains("or i32")` can never decide this `&&` — every value satisfying `ir.contains("xor i32")` also satisfies `ir.contains("or i32")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-codegen/tests/native_proof_regressions.rs:15217— `ir.contains("or i32")` can never decide this `&&` — every value satisfying `ir.contains("xor i32")` also satisfies `ir.contains("or i32")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-codegen/src/ext_registry.rs:900— `err.contains("crypto")` can never decide this `&&` — every value satisfying `err.contains("`js_crypto_`")` also satisfies `err.contains("crypto")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-codegen/src/linker.rs:1621— `default.contains("w64-mingw")` can never decide this `||` — every value satisfying `default.contains("w64-mingw")` also satisfies `default.contains("mingw")`, 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/perry-codegen/src/linker.rs:1653— `t.contains("w64-mingw")` can never decide this `||` — every value satisfying `t.contains("w64-mingw")` also satisfies `t.contains("mingw")`, 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/perry-codegen/src/expr/region_loop_tests.rs:1052— `ir.contains("rloop.recheck")` can never decide this `&&` — every value satisfying `ir.contains("br i1 true, label %rloop.recheck")` also satisfies `ir.contains("rloop.recheck")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-codegen/src/expr/region_loop_tests.rs:1086— `ir.contains("rloop.recheck")` can never decide this `&&` — every value satisfying `ir.contains("br i1 true, label %rloop.recheck")` also satisfies `ir.contains("rloop.recheck")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-codegen/src/collectors/proven_this_routing_tests.rs:954— `ir.contains("$typed_f64_recv")` can never decide this `||` — every value satisfying `ir.contains("$typed_f64_recv")` also satisfies `ir.contains("$typed_f64")`, 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/perry-codegen/src/collectors/proven_this_routing_tests.rs:1175— `probe.contains(", 2")` can never decide this `&&` — every value satisfying `probe.contains(", 268435456")` also satisfies `probe.contains(", 2")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry-codegen/src/codegen/index_method_clone_tests.rs:930— `iterate.contains("versioned_index.loop.slow.preheader")` can never decide this `&&` — every value satisfying `iterate.contains("label %versioned_index.loop.slow.preheader")` also satisfies `iterate.contains("versioned_index.loop.slow.preheader")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry/src/commands/sanitize.rs:379— `trimmed.starts_with("///")` can never decide this `||` — every value satisfying `trimmed.starts_with("///")` also satisfies `trimmed.starts_with("//")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/perry/src/commands/compile/cjs_wrap/extract_requires.rs:241— `rest.starts_with("===")` can never decide this `||` — every value satisfying `rest.starts_with("===")` also satisfies `rest.starts_with("==")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Silent fallback default in catch crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryActivity.kt:135— `getDangerousPermissionsToRequest` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt:766— `registerWatchListener` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch android-build/app/src/main/java/com/perry/app/PerryActivity.kt:90— `getDangerousPermissionsToRequest` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch android-build/app/src/main/java/com/perry/app/PerryBridge.kt:615— `registerWatchListener` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Orphaned file crates/perry-container-compose/src/yaml.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/perry-runtime/src/url/url_pattern.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file scripts/gen_feature_matrix.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Hand-rolled JSON/XML parsing via regex scripts/check_npm_publish_freshness.py:184— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex scripts/package_bench.py:139— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex scripts/parity_normalize.py:80— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
README/code drift docs/turnloop/p12-report.md:297— docs/turnloop/p12-report.md names MongoDB 8, but the manifest declares `mongodb` 7.5.0. 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 docs/src/internals/weakmap-owned-index-validation.md:63— docs/src/internals/weakmap-owned-index-validation.md names Zod 3, but the manifest declares `zod` ^4.3.5. 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.
R7 · Dead Code· Unused private field '#hidden' · ×2
Unused private field '#hidden' test-files/test_gap_own_names_clone_snapshot.ts:35— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
Unused private field '#hidden' test-files/test_gap_shape_driven_structured_clone.ts:5— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
R7 · Dead Code· Unused module-local declaration 'wide' · ×2
Unused module-local declaration 'wide' test-files/test_gap_stale_array_format_json.ts:63— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'wide' test-files/test_gap_stale_array_inspect.ts:63— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Fat interface: IGitCommandManager (38 required operations) upstream/actions/actions/checkout/src/git-command-manager.ts:18— `IGitCommandManager` declares 38 required operations: `branchDelete`, `branchExists`, `branchList`, `disableSparseCheckout`, `sparseCheckout`, `sparseCheckoutNonConeMode`, `checkout`, `checkoutDetach`, `config`, `configExists`, `fetch`, `getDefaultBranch`, `getSubmoduleConfigPaths`, `getWorkingDirectory`, `init`, `isDetached`, `lfsFetch`, `lfsInstall`, `log1`, `remoteAdd`, `removeEnvironmentVariable`, `revParse`, `setEnvironmentVariable`, `shaExists`, `submoduleForeach`, `submoduleSync`, `submoduleUpdate`, `submoduleStatus`, `tagExists`, `tryClean`, `tryConfigUnset`, `tryConfigUnsetValue`, `tryDisableAutomaticGarbageCollection`, `tryGetFetchUrl`, `tryGetConfigValues`, `tryGetConfigKeys`, `tryReset`, `version`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 9 of 95 project(s) overshoot their size bounds, lowering Project Cohesion to 8.1/10. The most over is `crates/perry-runtime` (717862 LoC, 1629 module-visible types across 144 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 3 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: crates/perry-container-compose/src/yaml.rs, crates/perry-runtime/src/url/url_pattern.rs, scripts/gen_feature_matrix.py (7 orphaned of 3000 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 3000 of the 14690 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
Logging is not universal — Only 7/22 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `.`, `crates/perry-component-host`, `crates/perry-component-io` and 10 more.
Unused export 'gitShortSha' scripts/publish/shared.mts:233— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'provenanceAllowed' · ×1
Unused export 'provenanceAllowed' scripts/publish/shared.mts:290— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isknownVersion' · ×1
Unused export 'isknownVersion' REDACTED:67— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MANIFEST_FETCH_ATTEMPTS' · ×1
Unused export 'MANIFEST_FETCH_ATTEMPTS' upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:34— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'clearManifestCache' · ×1
Unused export 'clearManifestCache' upstream/actions/astral-sh/setup-uv/src/download/manifest.ts:160— Nothing imports this binding — it is safe to review for removal.
Unused export 'error' upstream/actions/astral-sh/setup-uv/src/utils/logging.ts:20— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'getUvVersionFromFile' · ×1
Unused export 'getUvVersionFromFile' upstream/actions/astral-sh/setup-uv/src/version/file-parser.ts:101— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'getUvVersionFromRequirementsFile' · ×1
Unused export 'getUvVersionFromRequirementsFile' upstream/actions/astral-sh/setup-uv/src/version/requirements-file.ts:4— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused module-local declaration 'hasFlag' · ×1
Unused module-local declaration 'hasFlag' packages/perry-styling/src/cli.ts:26— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'outerValue' · ×1
Unused module-local declaration 'outerValue' test-files/fixtures/cjs-eval-with.cjs:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'RequestMethod' · ×1
Unused module-local declaration 'RequestMethod' REDACTED:16— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused private field '#i' test-files/test_gap_11142_class_self_binding_static_factory.ts:177— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
Unused private field '#f' test-files/test_gap_11791_private_error_texts.ts:23— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
Unused private method '#mm' test-files/test_gap_11791_private_error_texts.ts:24— Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used.
R7 · Dead Code· Unused private field '#label' · ×1
Unused private field '#label' test-files/test_gap_11791_private_transfer.ts:9— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
R7 · Dead Code· Unused module-local declaration 'attempt' · ×1
Unused module-local declaration 'attempt' test-files/test_gap_native_module_misc_modules.ts:13— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'URLSearchParams' · ×1
Unused module-local declaration 'URLSearchParams' REDACTED:60— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'Gadget' · ×1
Unused module-local declaration 'Gadget' REDACTED:93— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'str' · ×1
Unused module-local declaration 'str' test-files/test_gap_stale_array_format_json.ts:60— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'obj' · ×1
Unused module-local declaration 'obj' test-files/test_gap_stale_array_format_json.ts:64— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'pair' · ×1
Unused module-local declaration 'pair' test-files/test_gap_stale_array_format_json.ts:65— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'code' · ×1
Unused module-local declaration 'code' test-files/test_gap_stale_array_format_json.ts:66— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'byte' · ×1
Unused module-local declaration 'byte' test-files/test_gap_stale_array_format_json.ts:67— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
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 6/13 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 9/10 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) reduce the strict null checking score — ~1.8 `!` null assertions per 1k TypeScript source lines — 45 assertion(s) across the 24700 source line(s) of the 243 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: scripts/soak/external-tools.mts (14), scripts/soak/soak.mts (10), scripts/soak/update-deps.mts (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Silent fallback default on parse failure test-compat/npm-sweep/run.py:319— `read_resolved_version` returns `''` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Skipped (documented): todo body test-parity/node-suite/test/runner/todo.ts:3— Skipped with a documented reason — a deferral, not lazy debt: declared with test.todo — a placeholder that registers a name and runs nothing
Skipped (documented): (unnamed test) test-parity/node-suite/test/runner/registration/callback-overloads.ts:3— 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) test-parity/node-suite/test/runner/registration/callback-overloads.ts:7— 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): test without callback test-parity/node-suite/test/runner/registration/missing-callback.ts:4— 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) test-parity/node-suite/test/runner/registration/options-validation.ts:12— 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) test-parity/node-suite/test/runner/registration/options-validation.ts:13— 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) test-parity/node-suite/test/runner/registration/options-validation.ts:14— 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) test-parity/node-suite/test/runner/registration/options-validation.ts:15— 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): runtime skip cleanup test-parity/node-suite/test/runner/hooks/runtime-skip-after-each.ts:6— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): runtime skip test-parity/node-suite/test/runner/context/runtime-directives.ts:3— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): the repo REDACTED prebake (when present) matches the tracked pins scripts/soak/external-tools.test.mts:111— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): installTool resolves the sfw flavor from SOCKET_SECURITY_KEY scripts/soak/external-tools.test.mts:239— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 12 file(s) — `.github/actions/perry/astral-sh/setup-uv/src/download/checksum/known-checksums.ts`, `crates/perry-ui-android/template/app/src/main/java/com/perry/app/PerryBridge.kt`, `crates/perry-ui-ios/swift/PerryNowPlaying.swift`, `crates/perry-ui-visionos/swift/PerryVisionApp.swift`, `docs/api/perry.d.ts`, … (+7 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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 01a1824d-e4ca-7ab6-8745-658ba6dd4aa0 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 1477 · Warnings: 10533 · Recommendations: 1943 · Info: 12 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 11:38 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.