Public report of swc-project/swc, published 14 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard. This copy doesn't carry the survey's signed record. How a survey is checked →

swc-project/swc

Measured 14 November 2026, 07:11 UTC, at code version 73ae06b

First survey, so nothing to compare with yet
CAI score 60out of 100 At risk

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

A very large codebase: 1,676,744 lines of product code in 188 projects, tests not counted · Estimated rebuild effort: about 19.3 person-years · Weakest lens: Production Readiness, 51

Findings by how serious they are

93 critical 2315 serious 1297 minor

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

This survey was produced by

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

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

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

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

61of 61 dimensions measured by tools.
3601of 3705 findings point to an exact file and line, so you can open each one in the code. The other 104 concern the repository as a whole, such as missing documentation.
61dimensions across 6 lenses, read from 1,676,744 lines of product code in 188 projects.
Chapters

Executive summary

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

Production Readiness, at 51, is the weakest lens and counts most in the score. The best first step is making the six tests that check nothing check their results, worth about 5 points. Tidying the declared packages would lift Production Readiness itself, worth about 4 points. Raising Production Readiness to 70 would lift the score to about 65.

Nineteen known security holes in the packages the code depends on can be used by attackers. Four automatic updates take new releases before a bad one can be spotted, and fifty-two parts of the code are no longer understood by anyone working on it. Updating the vulnerable packages, setting a waiting period for automatic updates and having someone learn the forgotten files would close these risks. The four pipeline steps that run downloads without checking them need each download checked against a known checksum first. The three places where the code runs text as code or as a command need a direct call instead. The six tests that check nothing need to check the result they produce.

The product code is 1,676,744 lines, about €2,800,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 51 · counts for 46%Code Health 52 · counts for 25%Security and Compliance 75 · counts for 14%Maturity 87 · counts for 8%Performance 90 · counts for 4%Architecture 95 · counts for 2%

If Production Readiness rose from 51 to 70, the lowest score rated Strong, the score would rise from 60 to about 65.

Code composition: what the lines of code are
Product code 64%Tests 36%
Rebuild cost: about €2,800,000 · Estimate
Cost to rebuild€930,000 to €4,700,000, for 15,580 to 49,425 hours of work, about 19.3 person-years for 11 to 37 engineers
Difficulty of the problemStandard, 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.8 at a score of 60. 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.
SizeVery large: 1,676,744 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 6 No assertions (empty test) finding(s) in Test Quality — start with hono.types.test.ts (3), Playground-itest.js, IntersectionObserver-itest.js.
Raises the score by about 5 points · Low effort · Test Quality
2
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Raises the score by about 4 points · Medium effort · Dependency Hygiene
3
Add tests that import the unreached modules (directly or through their public entry).
Raises the score by about 4 points · Medium effort · Test Coverage

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €2,800,000 to build again, about 19.3 person-years of work. Its weakest lens is Production Readiness, at 51 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 6 No assertions (empty test) finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 6 Test Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

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

arch swc swc swc_atoms swc_atoms swc->swc_atoms swc_common swc_common swc->swc_common swc_config swc_config swc->swc_config swc_ecma_ast swc_ecma_ast swc->swc_ecma_ast swc_ecma_codegen swc_ecma_codegen swc->swc_ecma_codegen swc_ecma_minifier swc_ecma_minifier swc->swc_ecma_minifier swc_ecma_parser swc_ecma_parser swc->swc_ecma_parser swc_ecma_transforms swc_ecma_transforms swc->swc_ecma_transforms swc_ecma_transforms_base swc_ecma_transforms_base swc->swc_ecma_transforms_base swc_ecma_transforms_compat swc_ecma_transforms_compat swc->swc_ecma_transforms_compat swc_ecma_utils swc_ecma_utils swc->swc_ecma_utils swc_ecma_visit swc_ecma_visit swc->swc_ecma_visit swc_common->swc_atoms swc_core swc_core swc_core->swc swc_core->swc_atoms swc_core->swc_common swc_core->swc_config swc_css_ast swc_css_ast swc_core->swc_css_ast swc_core->swc_ecma_ast swc_core->swc_ecma_codegen swc_core->swc_ecma_minifier swc_core->swc_ecma_parser swc_core->swc_ecma_transforms_base swc_core->swc_ecma_transforms_compat swc_ecma_transforms_react swc_ecma_transforms_react swc_core->swc_ecma_transforms_react swc_core->swc_ecma_utils swc_core->swc_ecma_visit swc_node_bundler swc_node_bundler swc_core->swc_node_bundler swc_css_ast->swc_atoms swc_css_ast->swc_common swc_ecma_ast->swc_atoms swc_ecma_ast->swc_common swc_ecma_codegen->swc_atoms swc_ecma_codegen->swc_common swc_ecma_codegen->swc_ecma_ast swc_ecma_codegen->swc_ecma_utils swc_ecma_compat_es2015 swc_ecma_compat_es2015 swc_ecma_compat_es2015->swc_atoms swc_ecma_compat_es2015->swc_common swc_ecma_compat_es2015->swc_config swc_ecma_compat_es2015->swc_ecma_ast swc_ecma_transformer swc_ecma_transformer swc_ecma_compat_es2015->swc_ecma_transformer swc_ecma_compat_es2015->swc_ecma_transforms_base swc_ecma_compat_es2015->swc_ecma_utils swc_ecma_compat_es2015->swc_ecma_visit swc_ecma_minifier->swc_atoms swc_ecma_minifier->swc_common swc_ecma_minifier->swc_config swc_ecma_minifier->swc_ecma_ast swc_ecma_minifier->swc_ecma_codegen swc_ecma_minifier->swc_ecma_parser swc_ecma_minifier->swc_ecma_transforms_base swc_ecma_minifier->swc_ecma_utils swc_ecma_minifier->swc_ecma_visit swc_ecma_parser->swc_atoms swc_ecma_parser->swc_common swc_ecma_parser->swc_ecma_ast swc_ecma_parser->swc_ecma_visit swc_ecma_transformer->swc_atoms swc_ecma_transformer->swc_common swc_ecma_transformer->swc_ecma_ast swc_ecma_transformer->swc_ecma_transforms_base swc_ecma_transformer->swc_ecma_utils swc_ecma_transformer->swc_ecma_visit swc_ecma_transforms->swc_common swc_ecma_transforms->swc_ecma_ast swc_ecma_transforms->swc_ecma_transforms_base swc_ecma_transforms->swc_ecma_transforms_compat swc_ecma_transforms->swc_ecma_transforms_react swc_ecma_transforms->swc_ecma_utils swc_ecma_transforms_base->swc_atoms swc_ecma_transforms_base->swc_common swc_ecma_transforms_base->swc_ecma_ast swc_ecma_transforms_base->swc_ecma_parser swc_ecma_transforms_base->swc_ecma_utils swc_ecma_transforms_base->swc_ecma_visit swc_ecma_transforms_compat->swc_atoms swc_ecma_transforms_compat->swc_common swc_ecma_transforms_compat->swc_ecma_ast swc_ecma_transforms_compat->swc_ecma_compat_es2015 swc_ecma_transforms_compat->swc_ecma_transforms_base swc_ecma_transforms_compat->swc_ecma_utils swc_ecma_transforms_compat->swc_ecma_visit swc_ecma_transforms_react->swc_atoms swc_ecma_transforms_react->swc_common swc_ecma_transforms_react->swc_config swc_ecma_transforms_react->swc_ecma_ast swc_ecma_transforms_react->swc_ecma_parser swc_ecma_transforms_react->swc_ecma_transforms_base swc_ecma_transforms_react->swc_ecma_utils swc_ecma_transforms_react->swc_ecma_visit swc_ecma_utils->swc_atoms swc_ecma_utils->swc_common swc_ecma_utils->swc_ecma_ast swc_ecma_utils->swc_ecma_visit swc_ecma_visit->swc_atoms swc_ecma_visit->swc_common swc_ecma_visit->swc_ecma_ast swc_html_minifier swc_html_minifier swc_html_minifier->swc_atoms swc_html_minifier->swc_common swc_html_minifier->swc_config swc_html_minifier->swc_css_ast swc_html_minifier->swc_ecma_ast swc_html_minifier->swc_ecma_codegen swc_html_minifier->swc_ecma_minifier swc_html_minifier->swc_ecma_parser swc_html_minifier->swc_ecma_transforms_base swc_html_minifier->swc_ecma_visit swc_node_bundler->swc swc_node_bundler->swc_atoms swc_node_bundler->swc_common swc_node_bundler->swc_ecma_ast swc_node_bundler->swc_ecma_codegen swc_node_bundler->swc_ecma_parser swc_node_bundler->swc_ecma_transforms swc_node_bundler->swc_ecma_utils __more__ +168 more projects

Architecture: which parts of the code depend on which

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

915 modules, with 3472 dependencies between them. 30 loops run through 107 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 swc_ecma_lints.config2 swc_ecma_parser.syntax3 swc_visit4 swc_atoms.wtf8_atom5 swc_common.plugin.metadata6 swc_common.syntax_pos.hygiene7 swc_common.syntax_pos8 swc_ecma_ast.operators9 swc_common.errors10 swc_ecma_ast.decl11 swc_ecma_ast.lit12 swc_ecma_ast.prop13 swc_common.source_map14 swc_ecma_ast.module_decl15 swc_ecma_parser.error16 swc_ecma_ast.stmt17 swc_ecma_ast.module18 swc_ecma_ast.typescript19 swc_ecma_ast.pat20 swc_ecma_ast.function21 swc_ecma_ast.class22 swc_ecma_ast.expr23 swc_ecma_ast24 swc_ecma_ast.ident25 swc_atoms26 swc_ecma_transformer27 swc_common.comments28 swc_css_ast.value29 swc_ecma_ast.jsx30 swc_ecma_parser.legacy.token31 swc.config32 swc_css_ast.base33 swc_ecma_parser.parser34 swc_ecma_visit.generated35 swc36 swc_css_visit.generated37 swc_ecma_hooks.generated38 swc_ecma_utils39 swc_ecma_utils.ts_bindings40 swc_ecma_minifier.compress.optimize
1 swc_ecma_lints.config
2 swc_ecma_parser.syntax
3 swc_visit
4 swc_atoms.wtf8_atom1
5 swc_common.plugin.metadata1
6 swc_common.syntax_pos.hygiene2
7 swc_common.syntax_pos22
8 swc_ecma_ast.operators844
9 swc_common.errors6
10 swc_ecma_ast.decl1471412223
11 swc_ecma_ast.lit1017824
12 swc_ecma_ast.prop16844341
13 swc_common.source_map161
14 swc_ecma_ast.module_decl361811131156
15 swc_ecma_parser.error11
16 swc_ecma_ast.stmt4623220111123
17 swc_ecma_ast.module6421212
18 swc_ecma_ast.typescript152685921111610
19 swc_ecma_ast.pat168261453
20 swc_ecma_ast.function6414131212
21 swc_ecma_ast.class2410393112472
22 swc_ecma_ast.expr8213715304211631161
23 swc_ecma_ast2121
24 swc_ecma_ast.ident6415114
25 swc_atoms311
26 swc_ecma_transformer111
27 swc_common.comments251
28 swc_css_ast.value8612510
29 swc_ecma_ast.jsx40120131521
30 swc_ecma_parser.legacy.token111214
31 swc.config13363411413
32 swc_css_ast.base28721
33 swc_ecma_parser.parser2151213253103251253
34 swc_ecma_visit.generated6662849425612616128532562884294728140
35 swc111221121131114
36 swc_css_visit.generated69430140
37 swc_ecma_hooks.generated6624423648108138244564824722526241202
38 swc_ecma_utils33819771486647213416
39 swc_ecma_utils.ts_bindings3315423111183311
40 swc_ecma_minifier.compress.optimize1211513173243231111
Uses a module listed above itPart of a loopThe module itself
1 swc_ecma_lints.config2 swc_ecma_parser.syntax3 swc_visit4 swc_atoms.wtf8_atom5 swc_common.plugin.metadata6 swc_common.syntax_pos.hygiene7 swc_common.syntax_pos8 swc_ecma_ast.operators9 swc_common.errors10 swc_ecma_ast.decl11 swc_ecma_ast.lit12 swc_ecma_ast.prop13 swc_common.source_map14 swc_ecma_ast.module_decl15 swc_ecma_parser.error16 swc_ecma_ast.stmt17 swc_ecma_ast.module18 swc_ecma_ast.typescript19 swc_ecma_ast.pat20 swc_ecma_ast.function21 swc_ecma_ast.class22 swc_ecma_ast.expr23 swc_ecma_ast24 swc_ecma_ast.ident25 swc_atoms26 swc_ecma_transformer27 swc_common.comments28 swc_css_ast.value29 swc_ecma_ast.jsx30 swc_ecma_parser.legacy.token31 swc.config32 swc_css_ast.base33 swc_ecma_parser.parser34 swc_ecma_visit.generated35 swc36 swc_css_visit.generated37 swc_ecma_hooks.generated38 swc_ecma_utils39 swc_ecma_utils.ts_bindings40 swc_ecma_minifier.compress.optimizeswc_ecma_lints.config1swc_ecma_parser.syntax2swc_visit3swc_atoms.wtf8_atom4swc_common.plugin.metadata5swc_common.syntax_pos.hygiene6swc_common.syntax_pos7swc_ecma_ast.operators8swc_common.errors9swc_ecma_ast.decl10swc_ecma_ast.lit11swc_ecma_ast.prop12swc_common.source_map13swc_ecma_ast.module_decl14swc_ecma_parser.error15swc_ecma_ast.stmt16swc_ecma_ast.module17swc_ecma_ast.typescript18swc_ecma_ast.pat19swc_ecma_ast.function20swc_ecma_ast.class21swc_ecma_ast.expr22swc_ecma_ast23swc_ecma_ast.ident24swc_atoms25swc_ecma_transformer26swc_common.comments27swc_css_ast.value28swc_ecma_ast.jsx29swc_ecma_parser.legacy.token30swc.config31swc_css_ast.base32swc_ecma_parser.parser33swc_ecma_visit.generated34swc35swc_css_visit.generated36swc_ecma_hooks.generated37swc_ecma_utils38swc_ecma_utils.ts_bindings39swc_ecma_minifier.compress.optimize4011222844614714122231017824168443411613618111311561146232201111236421212152685921111610168261453641413121224103931124728213715304211631161212164151143111112518612510401201315211112141336341141328721215121325310325125366628494256126161285325628842947281401112211211311146943014066244236481081382445648247225262412023381977148664721341633154231111833111211513173243231111+875 more modules (most-connected shown)

At a glance — Code Health · 52% · Adequate · gated by R1, X4 ·

At a glance — Architecture · 95% · Exemplary ·

At a glance — Maturity · 87% · Strong ·

At a glance — Readiness · 51% · Adequate · gated by R4, R8 ·

At a glance — Security · 75% · Adequate · gated by D29 ·

At a glance — Performance · 90% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection137High / Critical
A03:2025 — Software Supply Chain Failures52High / Critical
A02:2025 — Security Misconfiguration4High / Critical

Roadmap

Top priorities: Resolve the 6 No assertions (empty test) finding(s) in Test Quality — start with hono.types.test.ts (3), Playground-itest.js, IntersectionObserver-itest.js; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies; Add tests that import the unreached modules (directly or through their public entry).

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

Do thisHelpsEffortDimension
Resolve the 6 No assertions (empty test) finding(s) in Test Quality — start with hono.types.test.ts (3), Playground-itest.js, IntersectionObserver-itest.js.+5.4 ptsLowTest Quality
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+3.6 ptsMediumDependency Hygiene
Add tests that import the unreached modules (directly or through their public entry).+3.6 ptsMediumTest Coverage
Resolve the 1 finding(s) in Type Safety.+2.8 ptsMediumType Safety
Interpolated log message defeats structured logging+2.4 ptsMediumStructured logging
Swallowed exception (caught, then discarded)+1.6 ptsMediumException handling
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with package.json.+0.7 ptsLowPlatform End-of-Life
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 2 sites, not one: `crates/dbg-swc/src/es/minifier/reduce.rs:132` (`Sha1::new`), `crates/swc_ecma_transforms_react/src/refresh/hook.rs:106` (`Sha1::new`). Each is a separate decision — fixing only the line this row cites leaves the others in place.+1.2 ptsMediumWeb-Security Posture

File quality

Per-file score 0–10 — a quality signature. Of 557 files carrying findings, judged against the Production bar: 1% slop · 45% mixed · 54% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopDependency Vulnerabilities: High CVE: REDACTED
crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts3.5SlopTest Quality: No assertions (empty test): app.on(method, path[], middleware, handler) should not throw a type error
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
crates/swc_css_codegen/src/lib.rs5.5MixedCode Duplication: Edited copies of one member (3 members, 46+ corresponding lines)
crates/swc_ecma_minifier/src/compress/optimize/util.rs5.6MixedCode Duplication: Edited copy of a member (22 corresponding lines)
crates/swc_ecma_transforms_base/src/rename/ops.rs5.6MixedCode Duplication: Near-duplicate member pair (42 shared lines)
crates/swc_ecma_compat_es2015/src/classes/mod.rs5.7MixedCode Duplication: Edited copy of a member (96 corresponding lines)
crates/swc_ecma_transforms_typescript/src/transform.rs5.7MixedCode Duplication: Edited copy of a member (16 corresponding lines)
crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/renderer/core/__tests__/ResponderEventTarget-itest.js5.8MixedTest Quality: No assertions (empty test): error in onResponderTerminationRequest does not crash the system
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
bindings/binding_html_node/src/lib.rs6.0MixedExplicit Debt: TodoComment
crates/swc_ecma_lexer/src/common/parser/pat.rs6.0MixedExplicit Debt: FixmeComment
crates/swc_ecma_lexer/src/common/lexer/mod.rs6.0MixedExplicit Debt: TodoComment

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

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

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

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

Could not be resolved — 13

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

Methodology & how to trust this report

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

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

What we checked — 61 dimensions across the health lenses
D4D5D6D7D10D12D13D14D15D16D17D19D20D24D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX8AX9M1M2M3M4P1P10P2P3P4P6PF1R1R10R11R2R3R4R6R7R8R9S1X1X12X16X21X28X29X3X30X4X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3601 of 3705 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d8e5-e999-77ca-859c-90267f7f01c3.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D1 Cyclomatic Complexity — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Most of this repository's production source (.ts, .tsx) had no cyclomatic complexity computed for it: no method bodies were exposed for those file kinds by any language model this pass could load.
  • D2 Cognitive Complexity — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Most of this repository's production source (.ts, .tsx) had no cognitive complexity computed for it: no method bodies were exposed for those file kinds by any language model this pass could load.
  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .mts, .ts, .tsx, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 97.9% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 4,656 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 266 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (jest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (154 tests); node:test via `npm ci --ignore-scripts` in .github/actions/contributor-policy/ (89 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/minifier/ (1 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/react-compiler/ (2 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D20 ADR Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 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.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Project size and spread are measured over build units (a .NET project, a Maven or Gradle module, an npm, Deno or JSR package, a Go module, a Cargo crate, a Python, Composer, Bundler, RubyGems, Mix, rebar3, sbt, SwiftPM or pub package, an OTP application, an Xcode project or XcodeGen spec, or a checkout that declares no build at all) whose source a code model reads. This repository's production source is in a language no model reads, or in units whose build tool D26 does not recognise. That is a gap in this analyzer's language reach — not a finding that the repository's projects are cohesive.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `crates/swc/benches/assets/table.tsx`, `crates/swc_ts_fast_strip/benches/assets/docusaurus.config.ts`, `packages/core/src/index.ts` 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.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: a UI framework dependency ('react'). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a REDACTED, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 43 further occurrence(s) are not listed individually; the score already reflects all 83.
  • X12 Unreachable branch — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X16 Unfloored truncation loop — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 120 further occurrence(s) are not listed individually; the score already reflects all 160.
  • Production source was not modelled — run is Degraded — No code model read .mts, .ts, .tsx, so the complexity, duplication and architecture dimensions were scored over a minority of this repository rather than its product, and dimensions that abstained did so for want of a model rather than for want of findings. The grade is NOT representative of this repository; diagnostics.md records the exact cause. The TypeScript/JavaScript sidecar EXITED with code 1 after 18.9s, so the TypeScript/JavaScript code model degraded to null. This is the sidecar's own failure, not a budget of ours.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D4 · Code Duplication9.1 / 10Stronggated by 1178 serious findings✓ Tool-verified

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

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

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

775 duplicated block group(s) detected. 2.3 % of the production lines (38,270 of 1,676,744) are in a reported copy. A further 403 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .ts (58% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (9 lines × 2) · ×48crates/swc_bundler/src/bundler/export.rs:182
Duplicated block (8 lines × 2) · ×44crates/ast_node/src/encoding/encode.rs:38
Duplicated block (12 lines × 2) · ×41bindings/binding_html_node/src/lib.rs:226
Duplicated block (10 lines × 2) · ×41bindings/binding_nodejs_support_wasm/src/nodejs.rs:805
Duplicated block (11 lines × 2) · ×40bindings/binding_minifier_node/src/minify.rs:70

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

What to do

  1. Resolve the 48 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (14), lib.rs (3), pattern_parser_impl.rs (3). — One of this dimension's main actionable groups (48 warning-level).
  2. Resolve the 44 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (12), module_item.rs (3), lib.rs (3). — One of this dimension's main actionable groups (44 warning-level).
  3. Resolve the 41 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with mod.rs (14), expr.rs (4), lib.rs (3). — One of this dimension's main actionable groups (41 warning-level).

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

D5 · Coupling8.5 / 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.

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

188 production modules (Cargo+npm), 0 dependency cycle(s), 16 unstable depended-on module(s). Read from the build's own module declarations; 16 module(s) off the main sequence, with abstractness counted on 99 of the 188 (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: better_scoped_tls · ×15
Unstable project binding_macros
Unstable project swc
Unstable project swc_bundler
Unstable project swc_compiler_base

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

What to do

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

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

D6 · Cohesion (LCOM4)9.5 / 10Stronggated by 33 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

33 of 806 classes have LCOM4 above 3.

Low cohesion: CodeGenerator (LCOM4 92) · ×33crates/swc_css_codegen/src/lib.rs:34

What to do

  1. Resolve the 33 Low cohesion finding(s) in Cohesion (LCOM4) — start with mod.rs (12), lib.rs (4), tokenize.rs. — One of this dimension's main actionable groups (33 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

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.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D10 · Test Quality9.5 / 10Adequategated by 6 critical findings✓ Tool-verified

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

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

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

659 skipped (651 with a documented reason), 147 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 4656 tests (1 harness-style project(s) excluded from the assertion penalty). Measured on the JavaScript/TypeScript suite only — at least 266 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.

No assertions (empty test): app.on(method, path[], middleware, handler) should not throw a type error · ×6crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:284
No assertions: embedded bash build scripts remain syntactically valid · ×132scripts/native/workflow.test.mjs:123
Skipped test: should re-throw errors from the task synchronously · ×8crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:149
Mock-dominated test: should set version, hermes version, and not publish · ×85crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:105
No direct assertions: (unnamed test) · ×9crates/swc_ecma_minifier/tests/terser/compress/try_catch/parent_scope_of_catch_block_is_not_the_try_block/input.js:9

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

What to do

  1. Resolve the 6 No assertions (empty test) finding(s) in Test Quality — start with hono.types.test.ts (3), Playground-itest.js, IntersectionObserver-itest.js. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 132 No assertions finding(s) in Test Quality — start with hono.types.test.ts (85), processTransform-test.js (7), focused-hooks-itest.js (6). — One of this dimension's main actionable groups (132 warning-level).
  3. Resolve the 8 Skipped test finding(s) in Test Quality — start with Fantom-itest.js (6), PerformanceObserver-itest.js, MountingIntermediateCommits-itest.js. — One of this dimension's main actionable groups (8 warning-level).

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

D12 · Dependency Hygiene8.0 7.6 / 10Strong✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 7.6 / 10 · rule-coverage 96% · ceiling Verified

50 outdated, 0 yanked direct Cargo dependencies. 130 of 136 direct crates were graded against crates.io (0 not published there, 6 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: anyhow · ×50

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 673 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 Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.7 / 10Stronggated by 31 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: crates/swc_ecma_minifier/src/compress/pure/misc.rs (15×133=1995); crates/swc_ecma_parser/src/parser/class_and_fn.rs (13×120=1560); crates/swc_ecma_minifier/src/compress/optimize/sequences.rs (8×135=1080) Repeated repair below the complexity floor: crates/swc_native_addon/src/platform/windows.rs (6 of 6 changes were fixes); crates/swc_native_addon/src/platform/unix.rs (5 of 6 changes were fixes); crates/swc_ecma_parser/src/parser/mod.rs (4 of 6 changes were fixes)

Hotspot: crates/swc_ecma_minifier/src/compress/pure/misc.rs · ×23crates/swc_ecma_minifier/src/compress/pure/misc.rs:1745
Repeated repair: crates/swc_native_addon/src/platform/windows.rs · ×8crates/swc_native_addon/src/platform/windows.rs:303

What to do

  1. Resolve the 23 Hotspot finding(s) in Churn × Complexity Hotspots — start with evaluate.rs (2), mod.rs (2), misc.rs. — One of this dimension's main actionable groups (23 warning-level).
  2. Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (2), windows.rs, unix.rs. — One of this dimension's main actionable groups (8 warning-level).

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

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

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

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

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

25 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is bindings/binding_nodejs_support_wasm/src/nodejs.rs. Counted over 705 of the 1143 production source files in this repository: 437 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.8 / 10Stronggated by 638 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

693 deducted task-comment markers across 884361 LoC (0.1/KLoC) → score 9.8. 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.

TodoComment · ×580xtask/src/bench.rs:110
XxxComment · ×27crates/swc_sourcemap/src/hermes.rs:42
FixmeComment · ×23crates/swc_visit/src/util/map.rs:21
HackComment · ×6crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1829
TodoComment repeated across 11 filespackages/types/index.ts:7

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

What to do

  1. Resolve the 580 TodoComment finding(s) in Explicit Debt — start with vue-id.ts (172), mod.rs (64), lib.rs (47). — One of this dimension's main actionable groups (580 warning-level).
  2. Resolve the 27 XxxComment finding(s) in Explicit Debt — start with typescript.rs (10), visitor-expanded-parser.ts (10), parser.ts (5). — One of this dimension's main actionable groups (27 warning-level).
  3. Resolve the 23 FixmeComment finding(s) in Explicit Debt — start with cal.com.tsx (5), expr.rs (3), macros.rs (2). — One of this dimension's main actionable groups (23 warning-level).

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

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

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

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

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

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

Documentation: no build, run or usage example · ×49packages/core/scripts/npm/darwin-arm64/README.md:1

What to do

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

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

D20 · ADR Quality8.0 / 10Strong✓ Tool-verified

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

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

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

2 of 4 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.

ADR considers only one optiondocs/adr/00003-reserve-bytepos-0-for-dummy-span.md:17detected by adr-integrity
ADR consequences name no costdocs/adr/00003-reserve-bytepos-0-for-dummy-span.md:26detected by adr-integrity
ADR has no Consequences sectiondocs/adr/00004-add-ast-path-info-to-visitor.md:1detected by adr-integrity

What to do

  1. Resolve the 1 ADR considers only one option finding(s) in ADR Quality — start with 00003-reserve-bytepos-0-for-dummy-span.md. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 ADR consequences name no cost finding(s) in ADR Quality — start with 00003-reserve-bytepos-0-for-dummy-span.md. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 ADR has no Consequences section finding(s) in ADR Quality — start with 00004-add-ast-path-info-to-visitor.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value8.6 8.3 / 10Strong✓ Tool-verified

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

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

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

346 of 23797 judged comments only repeat the code they sit on (1.5 %). 1161 comment(s) in another language or script were not judged.

redundant comment · ×64crates/swc/benches/assets/parser.ts:1918
doc comments repeat the names · ×3packages/types/index.ts:643

What to do

  1. Resolve the 64 redundant comment finding(s) in Comment Value — start with xcframework.js (4), VirtualizedListProps.js (4), InspectorProxyCustomMessageHandler-test.js (3). — One of this dimension's main actionable groups (64 recommendation-level).

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

137 finding(s): 0 critical, 13 high, 124 medium, 0 low. semgrep hit a parse error in 29 file(s) — `crates/swc/benches/assets/parser.ts`, `crates/swc/benches/assets/table.tsx` (line 1053), `crates/swc/src/config/mod.rs` (line 278, line 332, lines 332–335, …), `crates/swc/src/lib.rs` (line 870, line 871), `crates/swc_bundler/src/bundler/chunk/merge.rs` (line 1389), … (+24 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 3 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

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

What to do

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

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

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

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

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

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

50 finding(s): 2 critical, 17 high, 20 medium, 4 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 17 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (16), REDACTED. — One of this dimension's main actionable groups (17 issue-level).
  2. Resolve the 14 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (11), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).

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

D31 · IaC & Container Security9.1 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

4 finding(s): 0 critical, 2 high, 2 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

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

D34 · Knowledge Freshness5.3 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

331 of 706 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/swc_ecma_parser/benches/files/cal.com.tsx. Counted over 706 of the 1143 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×52crates/swc_ecma_parser/benches/files/cal.com.tsx:1
Orphaned file · ×279crates/swc_ecma_compat_es2015/src/spread.rs:1
Further orphaned files (smaller)

What to do

  1. Resolve the 279 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (22), lib.rs (16), macros.rs (7). — One of this dimension's main actionable groups (279 recommendation-level).
  2. Resolve the 52 Orphaned knowledge finding(s) in Knowledge Freshness — start with mod.rs (15), lib.rs (5), stmt.rs (3). — One of this dimension's main actionable groups (52 issue-level).
  3. 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.

D35 · Change Coupling10.0 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: lib.rs↔hook_utils.rs 60%; sequences.rs↔mod.rs 60%

Change coupling: lib.rs ↔ hook_utils.rs · ×2crates/swc_ecma_preset_env/src/lib.rs:1

What to do

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

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

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

End-of-life runtime: Node.js 20package.json:109

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with package.json. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

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

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

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

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

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

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

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

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

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

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

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

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

M2 · Architecture documentation10.0 / 10Exemplary✓ Tool-verified

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

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

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy8.0 / 10Strong✓ Tool-verified

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

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

  • CONTRIBUTING.md names Node.js 16, but the repository declares engines `>= 20`, engines `>=24`, engines `>=18`, pinned 26. 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. — CONTRIBUTING.md:127

What to do

  • Reconcile the README with reality: CONTRIBUTING.md names Node.js 16, but the repository declares engines `>= 20`, engines `>=24`, engines `>=18`, pinned 26.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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

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

  • 1 public type in `swc_estree_ast.class` is marked as implementation by its own namespace, folder or name: `ClassImpl` (crates/swc_estree_ast/src/class.rs:416, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — crates/swc_estree_ast/src/class.rs:416

What to do

  • Hide `swc_estree_ast.class` (`ClassImpl`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability6.7 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 28/31 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `bindings/swc_cli`, `crates/swc-ast-explorer`, `xtask`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

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.

R1 · Type Safety2.3 / 10Critical✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

  • 37 typed · 127 plain JS — the untyped files are bindings/binding_core_wasm/__tests__/error.js, bindings/binding_core_wasm/__tests__/simple.js, bindings/binding_es_ast_viewer/__tests__/parse.js, bindings/binding_es_ast_viewer/scripts/package.mjs, bindings/binding_es_ast_viewer/src/es_ast_viewer_node.js, bindings/binding_html_wasm/__tests__/simple.js (+121 more). 0 production file(s) opt out entirely with @ts-nocheck · 18 @ts-ignore suppression(s).
R10 · Code Duplication7.7 / 10Strong✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • packages/core/postinstall.js:70 · packages/core/src/postinstall.ts:37 — the two spans are one implementation copied and then locally edited — 281 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/postinstall.js:70
  • packages/core/src/index.ts:313 · packages/core/src/index.ts:359 — 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/core/src/index.ts:313
  • packages/core/src/index.ts:389 · packages/core/src/index.ts:419 — 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/core/src/index.ts:389
  • crates/swc/scripts/sync_flow_projects.js:56 · crates/swc_ecma_parser/scripts/sync_flow_hermes_metadata.js:11 — 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/swc/scripts/sync_flow_projects.js:56
  • packages/core/src/Visitor.ts:712 · packages/core/src/Visitor.ts:1652 — 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/core/src/Visitor.ts:712
  • packages/core/src/index.ts:295 · packages/core/src/index.ts:341 — 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/core/src/index.ts:295
  • packages/core/src/Visitor.ts:258 · packages/core/src/Visitor.ts:658 · packages/core/src/Visitor.ts:833 · packages/core/src/Visitor.ts:1507 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/Visitor.ts:258
  • packages/core/src/Visitor.ts:322 · packages/core/src/Visitor.ts:837 · packages/core/src/Visitor.ts:1511 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/Visitor.ts:322
  • packages/core/src/Visitor.ts:912 · packages/core/src/Visitor.ts:1001 — 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/core/src/Visitor.ts:912
  • packages/core/src/index.ts:160 · packages/core/src/index.ts:213 — 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/core/src/index.ts:160
  • packages/core/src/Visitor.ts:842 · packages/core/src/Visitor.ts:1082 · packages/core/src/Visitor.ts:1220 · packages/core/src/Visitor.ts:1658 — 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. — packages/core/src/Visitor.ts:842
  • packages/core/src/index.ts:183 · packages/core/src/index.ts:226 · packages/core/src/index.ts:248 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/index.ts:183
  • packages/core/src/Visitor.ts:618 · packages/core/src/Visitor.ts:630 — 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/core/src/Visitor.ts:618
  • packages/core/src/Visitor.ts:1597 · packages/core/src/Visitor.ts:1660 — 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/core/src/Visitor.ts:1597
  • packages/core/src/index.ts:267 · packages/core/src/index.ts:283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/core/src/index.ts:267
  • packages/core/src/Visitor.ts:529 · packages/core/src/Visitor.ts:558 · packages/core/src/Visitor.ts:694 · packages/core/src/Visitor.ts:791 · +7 more site(s) not listed — all 11 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/core/src/Visitor.ts:529
  • packages/core/src/index.ts:151 · packages/core/src/index.ts:160 — 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/core/src/index.ts:151
  • scripts/native/assemble.mjs:69 · scripts/native/extract.mjs:15 — the two spans are one implementation copied and then locally edited — 50 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/native/assemble.mjs:69
  • packages/html/webcontainer-fallback.cjs:25 · packages/html/webcontainer-fallback.cjs:31 — 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/html/webcontainer-fallback.cjs:25

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.
R11 · Import Boundaries9.9 / 10Exemplary✓ Tool-verified

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.

  • REDACTED:4 imports bindings/binding_es_ast_viewer/__tests__/parse.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — REDACTED:4
  • packages/html/webcontainer-fallback.cjs:23 reaches into another package with a relative path (./node_modules/@swc/html-wasm/wasm.js) — import the package by name instead. — packages/html/webcontainer-fallback.cjs:23

What to do

  • Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (1 row); move the shared test helper into a source directory production code may depend on (1 row).
R2 · Cyclomatic Complexity8.6 / 10Strong✓ Tool-verified

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.

  • test_case has cyclomatic complexity 54 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:105
  • classifyChanges has cyclomatic complexity 24 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/github/change-detection.mjs:61
  • (top-level) has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/validate-binary.js:2
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/postinstall.js:66
  • search has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/swc_ecma_transforms/scripts/del.js:10
  • assertAllObjectHasTypeFiled has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/__tests__/plugin_test.mjs:4
  • analyzePublishOrder has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/github/publish-order.mjs:46
  • validateBinary has cyclomatic complexity 14 and cognitive complexity 14; 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/core/src/postinstall.ts:31
  • reminify has cyclomatic complexity 13 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:620
  • (anonymous) has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:521
  • validateReport has cyclomatic complexity 13 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/native/contracts.mjs:7
  • (anonymous) has cyclomatic complexity 12 and cognitive complexity 20; 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/native/workflow.test.mjs:223
  • transformSync has cyclomatic complexity 12 and cognitive complexity 17; 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/core/src/index.ts:341
  • transform has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/index.ts:295
  • compileBundleOptions has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/core/src/spack.ts:9
  • visit has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/github/publish-order.mjs:137
R3 · Large Files8.2 / 10Strong✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • packages/types/index.ts has 2460 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/types/index.ts:1
  • packages/core/src/Visitor.ts has 1679 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/Visitor.ts:1
  • packages/core/src/index.ts has 544 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/index.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
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.

  • crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts:2 imports '../fnv1a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts:2
  • crates/swc_ecma_minifier/tests/terser/compress/export/dynamic_import/input.js:1 imports './traditional.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — crates/swc_ecma_minifier/tests/terser/compress/export/dynamic_import/input.js:1
  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×33) — REDACTED:1, crates/swc/scripts/sync_flow_projects.js:1, packages/core/postinstall.js:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
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.

  • This repository declares test tooling, and the ✓ above records that declaration — but crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts and 1 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts:2
R7 · Dead Code9.7 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • 3 file(s) (~264 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. — bindings/binding_core_wasm
  • 2 file(s) (~42 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. — bindings/binding_html_wasm
  • 2 file(s) (~19 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. — bindings/binding_minifier_wasm
  • 5 file(s) (~336 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. — bindings/binding_nodejs_support_wasm
  • 458 file(s) (~6803 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — crates/swc_node_bundler/tests
  • 92 file(s) (~6637 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: packages/core/src/index.ts imports './binding', 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. — packages/core
  • Unreachable from the 50 application, 36 tooling and 2843 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×9) — scripts/native/finalize.mjs, crates/swc_ecma_minifier/scripts/_/samply-script.js, crates/swc_ecma_minifier/scripts/mangler/charfreq.js, …
  • no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (scripts/sourcemap/decode.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — scripts/sourcemap/vlq.js
  • 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. — packages/core/e2e/plugins/plugins.compat.test.js:49

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene1.5 / 10Critical✓ Tool-verified

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. — REDACTED:17
  • 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. (×8)
  • Declared in packages/core/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.
  • Declared in packages/html/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.
  • Declared in packages/minifier/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.
  • Declared in packages/react-compiler/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.
  • Declared in packages/types/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.

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

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.

S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

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. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker.

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.

  • 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. (×2) — crates/dbg-swc/src/es/minifier/reduce.rs:132, crates/swc_ecma_transforms_react/src/refresh/hook.rs:106

What to do

  • 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 2 sites, not one: `crates/dbg-swc/src/es/minifier/reduce.rs:132` (`Sha1::new`), `crates/swc_ecma_transforms_react/src/refresh/hook.rs:106` (`Sha1::new`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

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.

X3 · Exception handling4.5 / 10Weak✓ Tool-verified

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.

  • `catch (_a)` 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — packages/core/postinstall.js:53
  • `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — packages/core/postinstall.js:74, packages/core/src/postinstall.ts:40
  • 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. (×5) — packages/core/postinstall.js:109, packages/core/postinstall.js:140, packages/core/src/index.ts:80, …
  • `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — packages/core/src/postinstall.ts:19

What to do

  • Swallowed exception (caught, then discarded)
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.

X4 · Structured logging2.9 / 10Weak✓ Tool-verified

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.

  • `debug!` at line 139 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/testing/src/output.rs:139
  • `debug!` at line 168 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/testing/src/output.rs:168
  • `debug!` at line 176 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/testing/src/output.rs:176
  • `debug!` at line 120 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_plugin_runner/src/cache.rs:120
  • `debug!` at line 86 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_node_bundler/src/loaders/swc.rs:86
  • `debug!` at line 70 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_graph_analyzer/src/lib.rs:70
  • `debug!` at line 92 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_graph_analyzer/src/lib.rs:92
  • `trace!` at line 115 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:115
  • `trace!` at line 307 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:307
  • `trace!` at line 310 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:310
  • `debug!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:316
  • `debug!` at line 325 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:325
  • `trace!` at line 664 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:664
  • `trace!` at line 670 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:670
  • `trace!` at line 677 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:677
  • `trace!` at line 84 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:84
  • `trace!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:109
  • `trace!` at line 151 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:151
  • `trace!` at line 155 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:155
  • `trace!` at line 221 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:221
  • `trace!` at line 237 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:237
  • `trace!` at line 329 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:329
  • `trace!` at line 358 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:358
  • `trace!` at line 363 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:363
  • `trace!` at line 384 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:384
  • `trace!` at line 400 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:400
  • `trace!` at line 414 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:414
  • `trace!` at line 426 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:426
  • `trace!` at line 431 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:431
  • `trace!` at line 461 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:461
  • `trace!` at line 482 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:482
  • `trace!` at line 560 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:560
  • `trace!` at line 605 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:605
  • `debug!` at line 1093 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1093
  • `debug!` at line 1153 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1153
  • `debug!` at line 1165 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1165
  • `debug!` at line 1318 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1318
  • `debug!` at line 1628 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1628
  • `trace!` at line 429 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:429
  • `debug!` at line 513 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:513

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.9 / 10Exemplary✓ Tool-verified

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.

  • ~0.3 `!` null assertions per 1k TypeScript source lines — 2 assertion(s) across the 6395 source line(s) of the 11 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: packages/core/src/postinstall.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

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 `?`).

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health52%Adequate — gated by R1, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture95%ExemplaryStrongest area.
Maturity87%StrongSolid.
Readiness51%Adequate — gated by R4, R8Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security75%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance90%ExemplarySolid.
Unscored — 4 check(s) recorded observations but carry no score

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

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

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 63 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 web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: 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.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • 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.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D1 Cyclomatic Complexity — cyclomatic complexity not measured — .ts, .tsx exposed no member bodies
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D2 Cognitive Complexity — cognitive complexity not measured — .ts, .tsx exposed no member bodies
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (75649 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust 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+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — None of 4 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.
  • D26 Project Cohesion — D26 measured no build unit over this repository's .mts, .py, .ts, .tsx source. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D27 Navigability — D27 reads resolved call sites in the languages it reads only — this repository's production source is .mts, .py, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D3 God Classes — Most of this repository's production source (.ts, .tsx) was not read by god-class detection, so class size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's class size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 3 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (123 value object(s))
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • 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 — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Rust source, so there is no service whose uptime a failing dependency could take down
  • 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 — coverage data present for 4 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — X27 reached only 31% of this repository's production lines — typescript (534,041 lines), javascript (224,804 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 93 finding(s)
D34 · Knowledge Freshness · Orphaned knowledge · ×52
  • Orphaned knowledge crates/swc_ecma_parser/benches/files/cal.com.tsx: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/swc/benches/assets/parser.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 crates/swc_html_parser/src/parser/mod.rs: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/swc_html_parser/src/lexer/mod.rs: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/swc_css_prefixer/src/prefixer.rs: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/swc_xml_parser/src/lexer/mod.rs: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/swc_css_parser/src/parser/values_and_units/mod.rs: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/swc_css_codegen/src/lib.rs: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/swc_css_parser/src/parser/at_rules/mod.rs: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/swc/benches/assets/renderer.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 crates/swc_bundler/src/bundler/chunk/merge.rs: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/swc_common/src/errors/emitter.rs: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 packages/core/src/Visitor.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 crates/swc_css_minifier/src/compressor/declaration.rs: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/swc_css_parser/src/lexer/mod.rs: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/swc_ecma_lexer/src/common/parser/class_and_fn.rs: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/swc_ecma_lexer/src/lexer/tests.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 crates/swc_css_minifier/src/compressor/calc_sum.rs: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/swc_html_codegen/src/lib.rs: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/swc_ecma_visit/src/lib.rs: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/swc_css_parser/src/parser/selectors/mod.rs: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/swc_bundler/src/modules/sort/stmt.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 crates/swc_ecma_ast/src/typescript.rs: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/swc_ecma_lexer/src/common/parser/stmt.rs: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/swc_estree_compat/src/babelify/typescript.rs: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.
  • + 27 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · No assertions (empty test) · ×6
  • No assertions (empty test): app.on(method, path[], middleware, handler) should not throw a type error crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:284 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): infer the correct response type with 2 middleware, only one returning response crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:3198 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): infer the correct response type with 3 middleware, 2 returning response crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:3237 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): ... crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/playground/Playground-itest.js:17 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): should work with multiple intersection observer instances crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js:4165 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): error in onResponderTerminationRequest does not crash the system crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/renderer/core/__tests__/ResponderEventTarget-itest.js:864 — Test method has an empty body — it asserts nothing and exercises no code.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'semver' · ×1
  • Unlisted import 'semver' REDACTED:17 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 2315 finding(s)
D17 · Explicit Debt · TodoComment · ×580
  • TodoComment xtask/src/bench.rs:110 — // TODO: This should use cargo metadata — 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 tools/generate-code/src/generators/visitor.rs:1523 — // TODO: Support all kinds of fields — 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 tools/generate-code/src/generators/visitor.rs:1620 — // TODO: Support unnamed fields — 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 packages/html/index.ts:26 — // TODO improve me after typing `@swc/css` — 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 packages/core/src/index.ts:24 — // todo: fix package.json scripts — 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 packages/core/src/postinstall.ts:44 — // TODO: We do not take care of the case if user try to install with `--no-optional`. — 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/swc_xml_parser/tests/fixture.rs:404 — // TODO tests from xml5lib-tests — 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/swc_xml_parser/src/lexer/mod.rs:70 — // TODO implement `raw` for all tokens — 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/swc_xml_parser/src/lexer/mod.rs:3069 — // TODO improve parse legacy declarations — 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/swc_typescript/src/fast_dts/mod.rs:384 — // TODO: may be 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/swc_ts_fast_strip_binding/src/error_reporter.rs:782 — //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 bindings/binding_typescript_wasm/src/error_reporter.rs:782 — //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 bindings/binding_nodejs_support_wasm/src/error_reporter.rs:782 — //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/swc_sourcemap/src/hermes.rs:63 — // TODO: need to serialize the `HermesFunctionMap` mappings — 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/swc_plugin_runner/src/transform_executor.rs:122 — // TODO: this is incomplete — 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/swc_plugin_proxy/src/metadata/transform_plugin_metadata.rs:105 — // TODO: There is no clear usecase yet - enable when we have a correct usecase. — 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/swc_plugin_proxy/src/comments/host_comments_storage.rs:12 — // TODO: This storage does not support mutable yet — 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/swc_plugin_backend_wasmtime/src/lib.rs:89 — // TODO use `with_added_extension` — 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/swc_plugin_backend_wasmer/src/lib.rs:34 — // [TODO]: Should we use is_x86_feature_detected! macro instead? — 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/swc_plugin_backend_wasmer/src/lib.rs:202 — // TODO: this is not finalized decision — 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/swc_plugin_backend_wasmer/src/lib.rs:362 — // [TODO]: disabled for now as it always panic if it is being called — 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/swc_plugin_backend_wasmer/src/lib.rs:384 — // [TODO]: we need wasmer@3 compatible optimization like before — 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/swc_plugin_backend_tests/tests/ecma_rkyv.rs:162 — // TODO: we'll need to apply 2 different plugins — 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/swc_plugin/src/allocation.rs:41 — /// [TODO]: This is for the experiment to alloc memory with specified layout instead of — 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/swc_plugin/src/allocation.rs:60 — /// [TODO]: This is for the experiment to free memory with specified layout with explicit — 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.
  • + 555 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×132
  • No assertions: embedded bash build scripts remain syntactically valid scripts/native/workflow.test.mjs:123 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: should work packages/core/__tests__/import_test.js:1 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Env crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:29 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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 crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:67 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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 and AppType crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:119 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Should have the `param` type crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:154 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Chained crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:205 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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 crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:249 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: unknown crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:294 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: text auto infer crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:304 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: json auto infer crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:314 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Schema crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:326 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Should return a correct type crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:379 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Env, Path, Type crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:439 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: json crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:459 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: json with specific status code crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:481 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: ParamKeys crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:508 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: With ? crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:515 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Without ? crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:520 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Optional parameters - /api/:a/:b? crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:528 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: InputToDataByType with value crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:559 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: InputToDataByType without value crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:568 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: RemoveQuestion crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:573 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Should add params to input correctly crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:580 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: Should convert parameters to schema correctly crates/swc_ts_fast_strip/benches/assets/hono.types.test.ts:607 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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.
  • + 107 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×93
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 68 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×48
  • Duplicated block (9 lines × 2) crates/swc_bundler/src/bundler/export.rs:182 — crates/swc_bundler/src/bundler/export.rs:182-190 | crates/swc_bundler/src/bundler/export.rs:193-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) crates/swc_bundler/src/bundler/finalize.rs:225 — crates/swc_bundler/src/bundler/finalize.rs:225-233 | crates/swc_bundler/src/bundler/finalize.rs:246-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/finalize.rs:225` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_common/src/input.rs:57 — crates/swc_common/src/input.rs:57-65 | crates/swc_common/src/input.rs:147-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_common/src/input.rs:157` calls `get_unchecked` and `crates/swc_common/src/input.rs:67` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/swc_common/src/syntax_pos/hygiene.rs:184 — crates/swc_common/src/syntax_pos/hygiene.rs:184-193 | crates/swc_common/src/syntax_pos/hygiene.rs:234-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_common/src/syntax_pos/hygiene.rs:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_css_minifier/src/compressor/color.rs:381 — crates/swc_css_minifier/src/compressor/color.rs:381-389 | crates/swc_css_minifier/src/compressor/color.rs:416-424 — both copies are in the same file, so extract the block into 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/swc_css_parser/src/lexer/mod.rs:994 — crates/swc_css_parser/src/lexer/mod.rs:994-1002 | crates/swc_css_parser/src/lexer/mod.rs:1021-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/lexer/mod.rs:994` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1860 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1860-1868 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1900-1908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:1860` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_codegen/src/lib.rs:1953 — crates/swc_ecma_codegen/src/lib.rs:1953-1961 | crates/swc_ecma_codegen/src/lib.rs:1981-1989 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_codegen/src/lib.rs:1953` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:1191 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1191-1199 | crates/swc_ecma_parser/src/parser/expr.rs:1997-2005 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:1191` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:231 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:231-239 | crates/swc_ecma_lexer/src/common/parser/module_item.rs:274-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/swc_ecma_lexer/src/common/parser/object.rs:282 — crates/swc_ecma_lexer/src/common/parser/object.rs:282-290 | crates/swc_ecma_parser/src/parser/object.rs:367-375 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/object.rs` and `crates/swc_ecma_parser/src/parser/object.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/object.rs:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1616 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1616-1624 | crates/swc_ecma_lexer/src/common/parser/typescript.rs:1639-1647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:1616` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_lints/src/rules/no_empty_function.rs:293 — crates/swc_ecma_lints/src/rules/no_empty_function.rs:293-301 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:377-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lints/src/rules/no_empty_function.rs:293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:949 — crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:949-957 | crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:986-994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:949` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_minifier/src/compress/pure/mod.rs:334 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:334-342 | crates/swc_ecma_minifier/src/compress/pure/mod.rs:1470-1478 — both copies are in the same file, so extract the block into 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/swc_ecma_parser/src/lexer/mod.rs:2265 — crates/swc_ecma_parser/src/lexer/mod.rs:2265-2273 | crates/swc_ecma_parser/src/lexer/mod.rs:2322-2331 — both copies are in the same file, so extract the 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:1478 — crates/swc_ecma_parser/src/parser/expr.rs:1478-1486 | crates/swc_ecma_parser/src/parser/expr.rs:1677-1685 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:1478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/swc_ecma_parser/src/parser/module_item.rs:260 — crates/swc_ecma_parser/src/parser/module_item.rs:260-268 | crates/swc_ecma_parser/src/parser/module_item.rs:307-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/module_item.rs:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:326 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:326-334 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:379-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1155 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1155-1163 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1199-1207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1171 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1171-1179 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1208-1216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:82 — crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:82-90 | crates/swc_ecma_transformer/src/es2020/nullish_coalescing.rs:135-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:160 — crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:160-168 | crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:213-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/swc_ecma_transforms_module/src/syntax_strip.rs:70 — crates/swc_ecma_transforms_module/src/syntax_strip.rs:70-78 | crates/swc_ecma_transforms_module/src/syntax_strip.rs:83-91 — both copies are in the same file, so extract the block into 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/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:133 — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:133-141 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:150-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:133` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×44
  • Duplicated block (8 lines × 2) crates/ast_node/src/encoding/encode.rs:38 — crates/ast_node/src/encoding/encode.rs:38-45 | crates/ast_node/src/encoding/encode.rs:218-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast_node/src/encoding/encode.rs:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_css_minifier/src/compressor/calc_sum.rs:217 — crates/swc_css_minifier/src/compressor/calc_sum.rs:217-224 | crates/swc_css_minifier/src/compressor/calc_sum.rs:300-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_minifier/src/compressor/calc_sum.rs:217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_minifier/src/compressor/calc_sum.rs:315` calls `default` and `crates/swc_css_minifier/src/compressor/calc_sum.rs:230` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/swc_css_prefixer/src/prefixer.rs:1907 — crates/swc_css_prefixer/src/prefixer.rs:1907-1914 | crates/swc_css_prefixer/src/prefixer.rs:3621-3628 — both copies are in the same file, so extract the block into 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/swc_ecma_ast/src/prop.rs:134 — crates/swc_ecma_ast/src/prop.rs:134-141 | crates/swc_ecma_utils/src/lib.rs:1557-1564 — 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/swc_ecma_codegen/src/util/token_boundaries.rs:88 — crates/swc_ecma_codegen/src/util/token_boundaries.rs:88-95 | crates/swc_ecma_codegen/src/util/token_boundaries.rs:125-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_codegen/src/util/token_boundaries.rs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:1022 — REDACTED:1022-1029 | REDACTED:1033-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1022` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:1952 — REDACTED:1952-1959 | REDACTED:1963-1970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1952` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ContinueStmt` in one and `BreakStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:242 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:242-249 | crates/swc_ecma_parser/src/lexer/mod.rs:721-728 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:800 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:800-807 | crates/swc_ecma_parser/src/lexer/mod.rs:1215-1222 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:800` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/lexer/number.rs:87 — crates/swc_ecma_lexer/src/common/lexer/number.rs:87-94 | crates/swc_ecma_parser/src/lexer/number.rs:107-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2265 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2265-2272 | crates/swc_ecma_parser/src/parser/expr.rs:3091-3098 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_parser/src/parser/expr.rs:3088` calls `preserve_pending_async_call_param_await` and `crates/swc_ecma_lexer/src/common/parser/expr.rs:2261` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:80 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:80-87 | crates/swc_ecma_lexer/src/common/parser/module_item.rs:930-938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:80` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:345 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:345-352 | crates/swc_ecma_parser/src/parser/module_item.rs:394-401 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/module_item.rs` and `crates/swc_ecma_parser/src/parser/module_item.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_ecma_lexer/src/common/parser/stmt.rs:970 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:970-977 | crates/swc_ecma_parser/src/parser/stmt.rs:1089-1096 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/stmt.rs:970` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/props.rs:371 — crates/swc_ecma_minifier/src/compress/optimize/props.rs:371-378 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1058-1065 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/props.rs:371` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) crates/swc_ecma_minifier/src/compress/pure/misc.rs:2739 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:2739-2746 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:1882-1889 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/swc_ecma_parser/src/parser/mod.rs:391 — crates/swc_ecma_parser/src/parser/mod.rs:391-398 | crates/swc_ecma_parser/src/parser/mod.rs:420-428 — both copies are in the same file, so extract the block into 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/swc_ecma_parser/src/parser/module_item.rs:690 — crates/swc_ecma_parser/src/parser/module_item.rs:690-697 | crates/swc_ecma_parser/src/parser/stmt.rs:1985-1992 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_parser/src/parser/module_item.rs:689` calls `cur_pos` and `crates/swc_ecma_parser/src/parser/stmt.rs:1984` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/swc_ecma_preset_env/src/lib.rs:511 — crates/swc_ecma_preset_env/src/lib.rs:511-518 | crates/swc_ecma_preset_env/src/lib.rs:561-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_preset_env/src/lib.rs:511` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `m` to `&mut Module` in one and `&mut Script` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:922 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:922-929 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:962-969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:922` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:20 — crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:20-27 | crates/swc_ecma_transforms_proposal/src/export_default_from.rs:20-27 — before extracting anything, compare `crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs` and `crates/swc_ecma_transforms_proposal/src/export_default_from.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:171 — crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:171-179 | crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:224-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2021/logical_assignment_operators.rs:171` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_ecma_transforms_base/src/rename/ops.rs:272 — crates/swc_ecma_transforms_base/src/rename/ops.rs:272-279 | crates/swc_ecma_transforms_base/src/rename/ops.rs:313-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/ops.rs:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3205 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3205-3212 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3523-3530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `&mut ClassProp` in one and `&mut PrivateProp` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) crates/swc_estree_ast/src/class.rs:361 — crates/swc_estree_ast/src/class.rs:361-368 | crates/swc_estree_ast/src/object.rs:266-273 — before extracting anything, compare `crates/swc_estree_ast/src/class.rs` and `crates/swc_estree_ast/src/object.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.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×41
  • Duplicated block (12 lines × 2) bindings/binding_html_node/src/lib.rs:226 — bindings/binding_html_node/src/lib.rs:226-237 | bindings/binding_html_wasm/src/lib.rs:270-281 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 2) bindings/binding_minifier_node/src/minify.rs:116 — bindings/binding_minifier_node/src/minify.rs:116-127 | crates/swc/src/lib.rs:1106-1117 — before extracting anything, compare `bindings/binding_minifier_node/src/minify.rs` and `crates/swc/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_minifier_node/src/minify.rs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/ast_node/src/enum_deserialize.rs:212 — crates/ast_node/src/enum_deserialize.rs:212-223 | crates/ast_node/src/enum_deserialize.rs:224-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast_node/src/enum_deserialize.rs:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc/src/config/mod.rs:298 — crates/swc/src/config/mod.rs:298-309 | crates/swc/src/lib.rs:818-829 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc/src/config/mod.rs:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:997 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:997-1008 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1114-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:997` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2822 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2822-2833 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2850-2861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2822` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_css_prefixer/src/prefixer.rs:1448 — crates/swc_css_prefixer/src/prefixer.rs:1448-1459 | crates/swc_css_prefixer/src/prefixer.rs:1479-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:1448` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_codegen/src/lib.rs:1934 — crates/swc_ecma_codegen/src/lib.rs:1934-1945 | crates/swc_ecma_codegen/src/lib.rs:1947-1958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) crates/swc_ecma_compat_es2015/src/destructuring.rs:985 — crates/swc_ecma_compat_es2015/src/destructuring.rs:985-996 | crates/swc_ecma_compat_es2015/src/destructuring.rs:1013-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/destructuring.rs:985` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_compat_es2015/src/for_of.rs:185 — crates/swc_ecma_compat_es2015/src/for_of.rs:185-196 | crates/swc_ecma_compat_es2015/src/for_of.rs:281-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/for_of.rs:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:1187 — REDACTED:1187-1198 | REDACTED:1249-1260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_compat_es2015/src/parameters.rs:77 — crates/swc_ecma_compat_es2015/src/parameters.rs:77-88 | crates/swc_ecma_compat_es2015/src/parameters.rs:735-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:151 — crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:151-162 | crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:195-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:372 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:372-383 | crates/swc_ecma_parser/src/lexer/mod.rs:851-862 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/lexer/mod.rs:1444 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1444-1455 | crates/swc_ecma_parser/src/lexer/mod.rs:1685-1696 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1444` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:798 — crates/swc_ecma_lexer/src/common/parser/expr.rs:798-809 | crates/swc_ecma_lexer/src/common/parser/expr.rs:960-971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:798` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2010 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2010-2021 | crates/swc_ecma_parser/src/parser/expr.rs:2753-2764 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2010` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2297 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2297-2308 | crates/swc_ecma_parser/src/parser/expr.rs:3123-3134 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2297` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/mod.rs:418 — crates/swc_ecma_lexer/src/common/parser/mod.rs:418-429 | crates/swc_ecma_parser/src/parser/expr.rs:101-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/mod.rs:418` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:814 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:814-825 | crates/swc_ecma_parser/src/parser/module_item.rs:947-958 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/module_item.rs` and `crates/swc_ecma_parser/src/parser/module_item.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:814` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:235 — crates/swc_ecma_lexer/src/common/parser/pat.rs:235-246 | crates/swc_ecma_parser/src/parser/pat.rs:381-392 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:235` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/stmt.rs:827 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:827-838 | crates/swc_ecma_parser/src/parser/stmt.rs:946-957 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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 (12 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2371 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2371-2382 | crates/swc_ecma_parser/src/parser/typescript.rs:4649-4660 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:2371` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/swc_ecma_minifier/src/compress/util/mod.rs:554 — crates/swc_ecma_minifier/src/compress/util/mod.rs:554-565 | crates/swc_ecma_minifier/src/compress/util/mod.rs:572-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/util/mod.rs:554` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:94 — crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:94-105 | crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:131-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×41
  • Duplicated block (10 lines × 2) bindings/binding_nodejs_support_wasm/src/nodejs.rs:805 — bindings/binding_nodejs_support_wasm/src/nodejs.rs:805-814 | bindings/binding_nodejs_support_wasm/src/nodejs.rs:839-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/swc_cli_impl/src/commands/compile.rs:986 — crates/swc_cli_impl/src/commands/compile.rs:986-995 | crates/swc_cli_impl/src/commands/compile.rs:1004-1013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_cli_impl/src/commands/compile.rs:986` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/swc_common/src/comments.rs:443 — crates/swc_common/src/comments.rs:443-452 | crates/swc_node_comments/src/lib.rs:40-49 — before extracting anything, compare `crates/swc_common/src/comments.rs` and `crates/swc_node_comments/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/swc_common/src/comments.rs:483 — crates/swc_common/src/comments.rs:483-492 | crates/swc_node_comments/src/lib.rs:76-85 — before extracting anything, compare `crates/swc_common/src/comments.rs` and `crates/swc_node_comments/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/swc_common/src/comments.rs:507 — crates/swc_common/src/comments.rs:507-516 | crates/swc_node_comments/src/lib.rs:97-106 — before extracting anything, compare `crates/swc_common/src/comments.rs` and `crates/swc_node_comments/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_common/src/comments.rs:507` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/swc_css_minifier/src/compressor/rules.rs:385 — crates/swc_css_minifier/src/compressor/rules.rs:385-394 | crates/swc_css_minifier/src/compressor/rules.rs:522-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_minifier/src/compressor/rules.rs:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/swc_css_prefixer/src/prefixer.rs:221 — crates/swc_css_prefixer/src/prefixer.rs:221-230 | crates/swc_css_prefixer/src/prefixer.rs:321-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:859 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:859-868 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1041-1050 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:859` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1334 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1334-1343 | crates/swc_ecma_lexer/src/common/parser/object.rs:345-354 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1334` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1407 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1407-1416 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1485-1494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1407` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:1791 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1791-1800 | crates/swc_ecma_parser/src/parser/expr.rs:568-577 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/parser/expr.rs:2050 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2050-2059 | crates/swc_ecma_parser/src/parser/expr.rs:2793-2802 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2050` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/mod.rs:169 — crates/swc_ecma_lexer/src/common/parser/mod.rs:169-178 | crates/swc_ecma_parser/src/parser/mod.rs:1153-1162 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/mod.rs` and `crates/swc_ecma_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:467 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:467-476 | crates/swc_ecma_lexer/src/common/parser/module_item.rs:541-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 (10 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:28 — crates/swc_ecma_lexer/src/common/parser/pat.rs:28-37 | crates/swc_ecma_parser/src/parser/pat.rs:34-43 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/parser/stmt.rs:530 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:530-539 | crates/swc_ecma_lexer/src/common/parser/stmt.rs:749-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 (10 lines × 2) crates/swc_ecma_lints/src/rules/no_empty_function.rs:354 — crates/swc_ecma_lints/src/rules/no_empty_function.rs:354-363 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:388-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lints/src/rules/no_empty_function.rs:354` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/swc_ecma_lints/src/rules/prefer_const.rs:176 — crates/swc_ecma_lints/src/rules/prefer_const.rs:176-185 | crates/swc_ecma_lints/src/rules/prefer_const.rs:256-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:930 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:930-939 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:966-975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:930` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&FnDecl` in one and `&FnExpr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:993 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:993-1002 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1024-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:993` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&ForInStmt` in one and `&ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1004` calls `visit_with` and `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1035` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/swc_ecma_parser/src/parser/class_and_fn.rs:1727 — crates/swc_ecma_parser/src/parser/class_and_fn.rs:1727-1736 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1807-1816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/class_and_fn.rs:1727` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/swc_ecma_parser/src/parser/stmt.rs:626 — crates/swc_ecma_parser/src/parser/stmt.rs:626-635 | crates/swc_ecma_parser/src/parser/stmt.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/swc_ecma_parser/src/parser/typescript.rs:3586 — crates/swc_ecma_parser/src/parser/typescript.rs:3586-3595 | crates/swc_ecma_parser/src/parser/typescript.rs:3655-3666 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_parser/src/parser/typescript.rs:3582` calls `flow_starts_like_anon_signature_param_type`, `Ok` and `crates/swc_ecma_parser/src/parser/typescript.rs:3654` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/swc_ecma_preset_env/src/corejs2/mod.rs:136 — crates/swc_ecma_preset_env/src/corejs2/mod.rs:136-145 | crates/swc_ecma_preset_env/src/corejs3/usage.rs:261-270 — before extracting anything, compare `crates/swc_ecma_preset_env/src/corejs2/mod.rs` and `crates/swc_ecma_preset_env/src/corejs3/usage.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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2342 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2342-2352 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2392-2401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2342` 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.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×40
  • Duplicated block (11 lines × 2) bindings/binding_minifier_node/src/minify.rs:70 — bindings/binding_minifier_node/src/minify.rs:70-80 | crates/swc/src/lib.rs:1051-1061 — before extracting anything, compare `bindings/binding_minifier_node/src/minify.rs` and `crates/swc/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_minifier_node/src/minify.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_common/src/private/content.rs:494 — crates/swc_common/src/private/content.rs:494-504 | crates/swc_common/src/private/content.rs:506-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/swc_css_codegen/src/lib.rs:2346 — crates/swc_css_codegen/src/lib.rs:2346-2356 | crates/swc_css_codegen/src/lib.rs:2430-2440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_codegen/src/lib.rs:2346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&PseudoClassSelector` in one and `&PseudoElementSelector` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) crates/swc_css_modules/src/lib.rs:141 — crates/swc_css_modules/src/lib.rs:141-151 | crates/swc_css_modules/src/lib.rs:153-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:932 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:932-942 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1229-1239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:1229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:831 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:831-841 | crates/swc_ecma_parser/src/lexer/mod.rs:1245-1255 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:831` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1118 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1118-1129 | crates/swc_ecma_parser/src/lexer/mod.rs:1499-1509 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2383 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2383-2393 | crates/swc_ecma_parser/src/parser/expr.rs:3202-3212 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2383` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/swc_ecma_lexer/src/common/parser/mod.rs:181 — crates/swc_ecma_lexer/src/common/parser/mod.rs:181-191 | crates/swc_ecma_parser/src/parser/mod.rs:1285-1295 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/mod.rs` and `crates/swc_ecma_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (11 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:708 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:708-718 | crates/swc_ecma_parser/src/parser/module_item.rs:844-854 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/module_item.rs` and `crates/swc_ecma_parser/src/parser/module_item.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:708` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:687 — crates/swc_ecma_lexer/src/common/parser/pat.rs:687-697 | crates/swc_ecma_lexer/src/common/parser/pat.rs:741-751 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_lexer/src/common/parser/stmt.rs:842 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:842-852 | crates/swc_ecma_parser/src/parser/stmt.rs:961-971 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/stmt.rs:842` 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 (11 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:616 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:616-626 | crates/swc_ecma_parser/src/parser/typescript.rs:1418-1428 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_minifier/src/compress/optimize/conditionals.rs:813 — crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs:813-823 | crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs:837-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs:813` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/iife.rs:31 — crates/swc_ecma_minifier/src/compress/optimize/iife.rs:31-41 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:526-536 — 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/swc_ecma_minifier/src/compress/pure/misc.rs:768 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:768-778 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:810-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/misc.rs:768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_minifier/src/compress/pure/misc.rs:2333 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:2333-2343 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:2354-2364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/swc_ecma_minifier/src/option/terser.rs:292 — crates/swc_ecma_minifier/src/option/terser.rs:292-302 | crates/swc_ecma_minifier/src/option/terser.rs:405-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/option/terser.rs:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:402 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:402-412 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1510-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:402` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/swc_ecma_parser/src/parser/mod.rs:221 — crates/swc_ecma_parser/src/parser/mod.rs:221-231 | crates/swc_ecma_parser/src/parser/mod.rs:238-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/mod.rs:221` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/swc_ecma_parser/src/parser/module_item.rs:237 — crates/swc_ecma_parser/src/parser/module_item.rs:237-247 | crates/swc_ecma_parser/src/parser/module_item.rs:262-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/module_item.rs:237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/swc_ecma_parser/src/parser/stmt.rs:1818 — crates/swc_ecma_parser/src/parser/stmt.rs:1818-1828 | crates/swc_ecma_parser/src/parser/stmt.rs:1883-1893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn parse_flow_match_expr(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) crates/swc_ecma_transforms_base/src/helpers/mod.rs:386 — crates/swc_ecma_transforms_base/src/helpers/mod.rs:386-396 | crates/swc_ecma_transforms_base/src/helpers/mod.rs:399-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut FnDecl` in one and `&mut FnExpr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) crates/swc_ecma_transforms_base/src/rename/analyzer/scope.rs:154 — crates/swc_ecma_transforms_base/src/rename/analyzer/scope.rs:154-164 | crates/swc_ecma_transforms_base/src/rename/analyzer/scope.rs:305-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/analyzer/scope.rs:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/swc_ecma_transforms_compat/src/class_fields_use_set.rs:185 — crates/swc_ecma_transforms_compat/src/class_fields_use_set.rs:185-195 | crates/swc_ecma_transforms_compat/src/class_fields_use_set.rs:225-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_compat/src/class_fields_use_set.rs:185` 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×33
  • Duplicated block (7 lines × 2) crates/swc_bundler/src/bundler/export.rs:84 — crates/swc_bundler/src/bundler/export.rs:84-90 | crates/swc_bundler/src/bundler/import/mod.rs:155-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/export.rs:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/swc_css_parser/src/lexer/mod.rs:952 — crates/swc_css_parser/src/lexer/mod.rs:952-958 | crates/swc_css_parser/src/lexer/mod.rs:962-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/lexer/mod.rs:952` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:56 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:56-62 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:38-44 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1673 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1673-1679 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2048-2054 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1673` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/common/parser/jsx.rs:321 — crates/swc_ecma_lexer/src/common/parser/jsx.rs:321-327 | crates/swc_ecma_lexer/src/common/parser/stmt.rs:474-480 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (7 lines × 2) crates/swc_ecma_lexer/src/common/parser/mod.rs:225 — crates/swc_ecma_lexer/src/common/parser/mod.rs:225-231 | crates/swc_ecma_parser/src/parser/mod.rs:1330-1336 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/mod.rs` and `crates/swc_ecma_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/common/parser/object.rs:105 — crates/swc_ecma_lexer/src/common/parser/object.rs:105-111 | crates/swc_ecma_parser/src/parser/object.rs:135-141 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/object.rs` and `crates/swc_ecma_parser/src/parser/object.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/object.rs:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1712 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1712-1718 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1742-1748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1712` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1985 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1985-1991 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2058-2064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1985` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) crates/swc/src/lib.rs:392 — crates/swc/src/lib.rs:392-398 | crates/swc_ecma_transforms_typescript/src/retain.rs:153-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 (7 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1356 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1356-1362 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1441-1447 — both copies are in the same file, so extract the block into 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/swc_ecma_minifier/src/util/size.rs:192 — crates/swc_ecma_minifier/src/util/size.rs:192-198 | crates/swc_ecma_minifier/src/util/size.rs:320-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) bindings/binding_nodejs_support_wasm/src/lib.rs:76 — bindings/binding_nodejs_support_wasm/src/lib.rs:76-82 | bindings/binding_typescript_wasm/src/lib.rs:61-67 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/lib.rs` and `bindings/binding_typescript_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `bindings/binding_nodejs_support_wasm/src/lib.rs:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/swc_config/src/glob.rs:53 — crates/swc_config/src/glob.rs:53-59 | crates/swc_config/src/regex.rs:78-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/common/lexer/char.rs:9 — crates/swc_ecma_lexer/src/common/lexer/char.rs:9-15 | crates/swc_ecma_parser/src/lexer/char_ext.rs:9-15 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/char.rs` and `crates/swc_ecma_parser/src/lexer/char_ext.rs` as WHOLE FILES: 97% 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/lexer/char.rs:19 — crates/swc_ecma_lexer/src/common/lexer/char.rs:19-25 | crates/swc_ecma_parser/src/lexer/char_ext.rs:19-25 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/char.rs` and `crates/swc_ecma_parser/src/lexer/char_ext.rs` as WHOLE FILES: 97% 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/lexer/char.rs:29 — crates/swc_ecma_lexer/src/common/lexer/char.rs:29-35 | crates/swc_ecma_parser/src/lexer/char_ext.rs:29-35 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/char.rs` and `crates/swc_ecma_parser/src/lexer/char_ext.rs` as WHOLE FILES: 97% 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/parser/buffer.rs:72 — crates/swc_ecma_lexer/src/common/parser/buffer.rs:72-78 | crates/swc_ecma_parser/src/parser/input.rs:441-447 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/common/parser/is_invalid_class_name.rs:9 — crates/swc_ecma_lexer/src/common/parser/is_invalid_class_name.rs:9-15 | crates/swc_ecma_parser/src/parser/util.rs:87-93 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/is_invalid_class_name.rs` and `crates/swc_ecma_parser/src/parser/util.rs` 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 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/swc_ecma_lexer/src/input.rs:127 — crates/swc_ecma_lexer/src/input.rs:127-133 | crates/swc_ecma_lexer/src/lexer/state.rs:721-727 — 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/swc_ecma_lints/src/rules/no_new_symbol.rs:63 — crates/swc_ecma_lints/src/rules/no_new_symbol.rs:63-69 | crates/swc_ecma_lints/src/rules/no_obj_calls.rs:69-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) crates/swc_ecma_preset_env/src/corejs2/mod.rs:147 — crates/swc_ecma_preset_env/src/corejs2/mod.rs:147-153 | crates/swc_ecma_preset_env/src/corejs3/usage.rs:175-181 — before extracting anything, compare `crates/swc_ecma_preset_env/src/corejs2/mod.rs` and `crates/swc_ecma_preset_env/src/corejs3/usage.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 lines × 2) crates/swc_html_parser/src/parser/input.rs:51 — crates/swc_html_parser/src/parser/input.rs:51-57 | crates/swc_xml_parser/src/parser/input.rs:44-50 — before extracting anything, compare `crates/swc_html_parser/src/parser/input.rs` and `crates/swc_xml_parser/src/parser/input.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 lines × 2) crates/swc_html_parser/src/parser/input.rs:59 — crates/swc_html_parser/src/parser/input.rs:59-65 | crates/swc_xml_parser/src/parser/input.rs:52-58 — before extracting anything, compare `crates/swc_html_parser/src/parser/input.rs` and `crates/swc_xml_parser/src/parser/input.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 lines × 2) crates/swc_css_lints/src/rules/block_no_empty.rs:18 — crates/swc_css_lints/src/rules/block_no_empty.rs:18-24 | crates/swc_css_lints/src/rules/no_empty_source.rs:18-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 8 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×33
  • Low cohesion: CodeGenerator (LCOM4 92) crates/swc_css_codegen/src/lib.rs:34 — CodeGenerator's methods fall into 92 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 92 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: Compressor (LCOM4 28) crates/swc_css_minifier/src/compressor/mod.rs:34 — Compressor's methods fall into 28 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 28 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: Token (LCOM4 18) bindings/binding_nodejs_support_wasm/src/nodejs/tokenize.rs:28 — Token'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: Operator (LCOM4 15) crates/swc_ecma_transforms_base/src/rename/ops.rs:16 — Operator's methods fall into 15 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 15 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: Str (LCOM4 14) crates/swc_common/src/syntax_pos.rs:1553 — Str's methods fall into 14 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 14 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: Transform (LCOM4 13) crates/swc_ecma_transforms_typescript/src/transform.rs:57 — Transform's methods fall into 13 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 13 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: Finalizer (LCOM4 12) crates/swc_ecma_minifier/src/compress/optimize/util.rs:435 — Finalizer's methods fall into 12 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 12 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: Handler (LCOM4 10) crates/swc_common/src/errors/mod.rs:355 — Handler's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: NamespaceResolver (LCOM4 10) crates/swc_ecma_transforms_base/src/resolver/typescript.rs:90 — NamespaceResolver's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Remover (LCOM4 9) crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:59 — Remover's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ReservedWordHook (LCOM4 8) crates/swc_ecma_transformer/src/es3/reserved_word.rs:47 — ReservedWordHook's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SimplifyExpr (LCOM4 8) crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:77 — SimplifyExpr's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: IdentUsageFinder (LCOM4 8) crates/swc_ecma_utils/src/lib.rs:1831 — IdentUsageFinder's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Module (LCOM4 7) bindings/binding_native_addon/src/legacy.rs:17 — Module's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Resolver (LCOM4 7) crates/swc_ecma_transforms_base/src/resolver/mod.rs:231 — Resolver's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TreeShaker (LCOM4 7) crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:81 — TreeShaker's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Inliner (LCOM4 6) crates/swc_bundler/src/inline.rs:39 — Inliner'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: Classes (LCOM4 6) crates/swc_ecma_compat_es2015/src/classes/mod.rs:72 — Classes'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: PluginSourceMapProxy (LCOM4 6) crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:54 — PluginSourceMapProxy'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: CodeGenerator (LCOM4 6) crates/swc_xml_codegen/src/lib.rs:32 — CodeGenerator'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: Pure (LCOM4 5) crates/swc_ecma_minifier/src/compress/pure/mod.rs:64 — Pure'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: VarMover (LCOM4 5) crates/swc_ecma_minifier/src/compress/pure/vars.rs:410 — VarMover'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: Hoister (LCOM4 5) crates/swc_ecma_transforms_base/src/resolver/mod.rs:1774 — Hoister'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: Diagnostic (LCOM4 4) crates/swc_common/src/errors/diagnostic.rs:39 — Diagnostic'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: Context (LCOM4 4) crates/swc_common/src/plugin/metadata.rs:75 — Context'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.
  • + 8 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×33
  • 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 crates/swc/scripts/sync_flow_projects.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/core/postinstall.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/core/src/postinstall.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 crates/swc_ecma_parser/scripts/sync_flow_hermes_metadata.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/core/src/util.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 crates/swc_ecma_minifier/scripts/_/samply-script.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_ecma_minifier/scripts/mangler/charfreq.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_ecma_transforms/scripts/fixtures.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_ecma_minifier/scripts/jsprops.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/html/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 crates/swc_ecma_parser/scripts/tsc/copy-test.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/html/webcontainer-fallback.cjs: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 crates/swc_ecma_transforms/scripts/del.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_ecma_transforms_react/scripts/patch-options.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 crates/swc_ecma_preset_env/scripts/copy-data.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_bundler/src/bundler/helpers/_require.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.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 crates/swc_html_utils/test.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/swc_ecma_minifier/scripts/next/evaluate.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file bindings/binding_nodejs_support_wasm/scripts/patch.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 bindings/binding_typescript_wasm/scripts/patch.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 packages/core/scripts/copy-readme.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file bindings/binding_es_ast_viewer/scripts/package.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 bindings/binding_typescript_wasm/scripts/esm.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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×28
  • Duplicated block (6 lines × 2) crates/swc_bundler/src/bundler/chunk/merge.rs:387 — crates/swc_bundler/src/bundler/chunk/merge.rs:387-392 | crates/swc_bundler/src/bundler/chunk/merge.rs:394-399 — both copies are in the same file, so extract the block into 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/swc_bundler/src/bundler/import/mod.rs:168 — crates/swc_bundler/src/bundler/import/mod.rs:168-173 | crates/swc_bundler/src/bundler/import/mod.rs:179-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1388 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1388-1393 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1416-1421 — both copies are in the same file, so extract the block into 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/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1466 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1466-1471 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1494-1499 — both copies are in the same file, so extract the block into 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/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1521 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1521-1526 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1554-1559 — both copies are in the same file, so extract the block into 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/swc_ecma_lexer/src/common/parser/object.rs:349 — crates/swc_ecma_lexer/src/common/parser/object.rs:349-354 | crates/swc_ecma_parser/src/parser/object.rs:437-444 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/object.rs` and `crates/swc_ecma_parser/src/parser/object.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/object.rs:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) crates/swc_ecma_lexer/src/common/parser/stmt.rs:773 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:773-778 | crates/swc_ecma_parser/src/parser/stmt.rs:892-897 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/stmt.rs:773` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/class_and_fn.rs:1624 — crates/swc_ecma_parser/src/parser/class_and_fn.rs:1624-1629 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1652-1657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/class_and_fn.rs:1624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/class_and_fn.rs:1709 — crates/swc_ecma_parser/src/parser/class_and_fn.rs:1709-1714 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1736-1741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/class_and_fn.rs:1842 — crates/swc_ecma_parser/src/parser/class_and_fn.rs:1842-1847 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1874-1879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:532 — crates/swc_ecma_parser/src/parser/expr.rs:532-537 | crates/swc_ecma_parser/src/parser/expr.rs:1990-1995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:532` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn parse_lhs_expr(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:878 — crates/swc_ecma_parser/src/parser/expr.rs:878-883 | crates/swc_ecma_parser/src/parser/expr.rs:895-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:878` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/mod.rs:1435 — crates/swc_ecma_parser/src/parser/mod.rs:1435-1440 | crates/swc_ecma_parser/src/parser/typescript.rs:2179-2184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/mod.rs: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.
  • Duplicated block (6 lines × 2) crates/swc_ecma_parser/src/parser/module_item.rs:607 — crates/swc_ecma_parser/src/parser/module_item.rs:607-612 | crates/swc_ecma_parser/src/parser/module_item.rs:676-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/module_item.rs:607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/swc_ecma_preset_env/src/corejs2/mod.rs:234 — crates/swc_ecma_preset_env/src/corejs2/mod.rs:234-239 | crates/swc_ecma_preset_env/src/corejs2/mod.rs:246-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1802 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1802-1807 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2334-2339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1802` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:107 — crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:107-112 | crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:121-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:127` calls `advance` and `crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:113` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/swc_estree_compat/src/swcify/expr.rs:317 — crates/swc_estree_compat/src/swcify/expr.rs:317-322 | crates/swc_estree_compat/src/swcify/expr.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_estree_compat/src/swcify/expr.rs:317` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/swc_html_parser/src/error.rs:48 — crates/swc_html_parser/src/error.rs:48-53 | crates/swc_xml_parser/src/error.rs:40-45 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/error.rs:55` calls `into` and `crates/swc_xml_parser/src/error.rs:46` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) bindings/binding_core_node/src/parse.rs:140 — bindings/binding_core_node/src/parse.rs:140-145 | bindings/binding_html_node/src/lib.rs:700-705 — 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/swc_bundler/src/modules/sort/stmt.rs:645 — crates/swc_bundler/src/modules/sort/stmt.rs:645-651 | crates/swc_ecma_react_compiler/src/convert_scope.rs:1294-1299 — 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/swc_ecma_compat_es2015/src/block_scoping/vars.rs:436 — crates/swc_ecma_compat_es2015/src/block_scoping/vars.rs:436-443 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1595-1600 — 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/swc_ecma_lexer/src/common/parser/mod.rs:147 — crates/swc_ecma_lexer/src/common/parser/mod.rs:147-152 | crates/swc_ecma_parser/src/parser/mod.rs:1131-1136 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/mod.rs` and `crates/swc_ecma_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/parser/pat_type.rs:11 — crates/swc_ecma_lexer/src/common/parser/pat_type.rs:11-16 | crates/swc_ecma_parser/src/parser/pat.rs:18-23 — 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/swc_html_codegen/src/writer/basic.rs:104 — crates/swc_html_codegen/src/writer/basic.rs:104-109 | crates/swc_xml_codegen/src/writer/basic.rs:104-109 — before extracting anything, compare `crates/swc_html_codegen/src/writer/basic.rs` and `crates/swc_xml_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 3 more in this group — see findings.md.
D17 · Explicit Debt · XxxComment · ×27
  • XxxComment crates/swc_sourcemap/src/hermes.rs:42 — // XXX: right now, I am too lazy to actually serialize the above `function_maps` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_parser/src/parser/typescript.rs:2514 — // ( xxx : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_lexer/src/common/parser/typescript.rs:1239 — // ( xxx : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/parser.ts:4886 — // ( xxx : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:4890 — // ( xxx : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:15266 — // ( xxx : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_parser/src/parser/typescript.rs:2515 — // ( xxx , — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_lexer/src/common/parser/typescript.rs:1240 — // ( xxx , — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/parser.ts:4887 — // ( xxx , — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:4891 — // ( xxx , — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:15267 — // ( xxx , — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_parser/src/parser/typescript.rs:2516 — // ( xxx ? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_lexer/src/common/parser/typescript.rs:1241 — // ( xxx ? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/parser.ts:4888 — // ( xxx ? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:4892 — // ( xxx ? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:15268 — // ( xxx ? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_parser/src/parser/typescript.rs:2517 — // ( xxx = — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_lexer/src/common/parser/typescript.rs:1242 — // ( xxx = — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/parser.ts:4889 — // ( xxx = — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:4893 — // ( xxx = — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:15269 — // ( xxx = — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_parser/src/parser/typescript.rs:2535 — // ( xxx ) => — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc_ecma_lexer/src/common/parser/typescript.rs:1246 — // ( xxx ) => — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/parser.ts:4895 — // ( xxx ) => — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment crates/swc/benches/assets/visitor-expanded-parser.ts:4899 — // ( xxx ) => — 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×27
  • Duplicated block (14 lines × 2) bindings/binding_core_node/src/parse.rs:58 — bindings/binding_core_node/src/parse.rs:58-71 | bindings/binding_core_node/src/parse.rs:110-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `bindings/binding_core_node/src/parse.rs:57` calls `try_with`, `clone` and `bindings/binding_core_node/src/parse.rs:108` 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) bindings/binding_minifier_node/src/minify.rs:96 — bindings/binding_minifier_node/src/minify.rs:96-109 | crates/swc/src/lib.rs:1090-1103 — before extracting anything, compare `bindings/binding_minifier_node/src/minify.rs` and `crates/swc/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_minifier_node/src/minify.rs:96` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) bindings/binding_minifier_node/src/minify.rs:140 — bindings/binding_minifier_node/src/minify.rs:140-153 | crates/swc/src/lib.rs:1121-1134 — before extracting anything, compare `bindings/binding_minifier_node/src/minify.rs` and `crates/swc/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_minifier_node/src/minify.rs:140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/ast_node/src/spanned.rs:93 — crates/ast_node/src/spanned.rs:93-106 | crates/string_enum/src/lib.rs:168-181 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast_node/src/spanned.rs:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/string_enum/src/lib.rs:182` calls `chain`, `once`, `Err` and `crates/ast_node/src/spanned.rs:107` 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) REDACTED:3469 — REDACTED:3469-3482 | REDACTED:3584-3597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3469` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:3468` calls `create_label`, `Some` and `REDACTED:3583` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:414 — crates/swc_ecma_lexer/src/common/parser/expr.rs:414-427 | crates/swc_ecma_parser/src/parser/expr.rs:194-207 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:414` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2488 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2488-2501 | crates/swc_ecma_parser/src/lexer/mod.rs:1871-1884 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2488` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:853 — crates/swc_ecma_lexer/src/common/parser/pat.rs:853-866 | crates/swc_ecma_parser/src/parser/pat.rs:1066-1079 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:853` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2721 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2721-2734 | crates/swc_ecma_parser/src/parser/typescript.rs:5137-5150 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lints/src/rules/constructor_super.rs:193 — crates/swc_ecma_lints/src/rules/constructor_super.rs:193-206 | crates/swc_ecma_lints/src/rules/constructor_super.rs:217-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/if_return.rs:442 — crates/swc_ecma_minifier/src/compress/optimize/if_return.rs:442-455 | crates/swc_ecma_minifier/src/compress/optimize/if_return.rs:461-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) crates/swc_ecma_minifier/src/compress/pure/mod.rs:977 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:977-990 | crates/swc_ecma_minifier/src/compress/pure/mod.rs:993-1006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut ForInStmt` in one and `&mut ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14 lines × 2) crates/swc_ecma_parser/src/parser/module_item.rs:515 — crates/swc_ecma_parser/src/parser/module_item.rs:515-528 | crates/swc_ecma_parser/src/parser/module_item.rs:648-661 — both copies are in the same file, so extract the block into 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/swc_ecma_preset_env/src/lib.rs:566 — crates/swc_ecma_preset_env/src/lib.rs:566-579 | crates/swc_ecma_preset_env/src/lib.rs:594-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_preset_env/src/lib.rs:566` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/swc_ecma_transformer/src/es2015/function_name.rs:102 — crates/swc_ecma_transformer/src/es2015/function_name.rs:102-115 | crates/swc_ecma_transformer/src/es2015/function_name.rs:117-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2015/function_name.rs:102` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:386 — crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:386-399 | crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:545-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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut Vec<ModuleItem>` in one and `&mut Vec<Stmt>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:1656 — crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:1656-1669 | crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:1771-1784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:1656` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:1769` calls `match` and `crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:1654` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2786 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2786-2799 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3219-3232 — both copies are in the same file, so extract the block into 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/swc_html_parser/src/parser/input.rs:80 — crates/swc_html_parser/src/parser/input.rs:80-93 | crates/swc_xml_parser/src/parser/input.rs:73-86 — before extracting anything, compare `crates/swc_html_parser/src/parser/input.rs` and `crates/swc_xml_parser/src/parser/input.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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) crates/swc_html_parser/src/parser/mod.rs:8387 — crates/swc_html_parser/src/parser/mod.rs:8387-8400 | crates/swc_xml_parser/src/parser/mod.rs:510-523 — before extracting anything, compare `crates/swc_html_parser/src/parser/mod.rs` and `crates/swc_xml_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:8387` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/swc_xml_parser/src/lexer/mod.rs:719 — crates/swc_xml_parser/src/lexer/mod.rs:719-732 | crates/swc_xml_parser/src/lexer/mod.rs:756-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:719` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `Option<(bool, Option<char>, Option<char>)>` in one and `Option<(Option<char>, Option<&str>)>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_xml_parser/src/lexer/mod.rs:753` calls `append_to_attribute_with_entity`, `Some`, `last_mut` and `crates/swc_xml_parser/src/lexer/mod.rs:717` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2229 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2229-2242 | crates/swc_ecma_parser/src/parser/expr.rs:3033-3046 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) crates/swc_html_parser/src/parser/mod.rs:380 — crates/swc_html_parser/src/parser/mod.rs:380-393 | crates/swc_xml_parser/src/parser/mod.rs:97-110 — before extracting anything, compare `crates/swc_html_parser/src/parser/mod.rs` and `crates/swc_xml_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:434 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:434-447 | crates/swc_ecma_minifier/src/compress/optimize/mod.rs:3055-3068 — both copies are in the same file, so extract the block into 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/swc_html_parser/src/parser/mod.rs:1749 — crates/swc_html_parser/src/parser/mod.rs:1749-1762 | crates/swc_html_parser/src/parser/mod.rs:6386-6399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×25
  • Duplicated block (15 lines × 2) crates/swc_bundler/src/bundler/finalize.rs:269 — crates/swc_bundler/src/bundler/finalize.rs:269-283 | crates/swc_bundler/src/bundler/finalize.rs:293-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/finalize.rs:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_css_parser/src/lexer/mod.rs:858 — crates/swc_css_parser/src/lexer/mod.rs:858-872 | crates/swc_css_parser/src/lexer/mod.rs:926-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/swc_ecma_compat_es2015/src/destructuring.rs:1116 — crates/swc_ecma_compat_es2015/src/destructuring.rs:1116-1130 | crates/swc_ecma_compat_es2015/src/destructuring.rs:1135-1149 — both copies are in the same file, so extract the block into 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/swc_ecma_compat_es2015/src/object_super.rs:240 — crates/swc_ecma_compat_es2015/src/object_super.rs:240-254 | crates/swc_ecma_transforms_classes/src/super_field.rs:344-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/object_super.rs:240` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1095 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1095-1109 | crates/swc_ecma_parser/src/lexer/mod.rs:1478-1492 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1095` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2071 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2071-2085 | crates/swc_ecma_parser/src/parser/expr.rs:2812-2826 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2071` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:2310 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2310-2324 | crates/swc_ecma_parser/src/parser/expr.rs:3136-3150 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:2310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:185 — crates/swc_ecma_lexer/src/common/parser/pat.rs:185-199 | crates/swc_ecma_parser/src/parser/pat.rs:330-344 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:185` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:833 — crates/swc_ecma_lexer/src/common/parser/pat.rs:833-847 | crates/swc_ecma_parser/src/parser/pat.rs:1046-1060 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:833` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_lexer/src/common/parser/stmt.rs:436 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:436-450 | crates/swc_ecma_parser/src/parser/stmt.rs:482-496 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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 (15 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1841 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1841-1855 | crates/swc_ecma_parser/src/parser/typescript.rs:3816-3830 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:1841` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:662 — crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:662-676 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:42-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:662` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1909 — crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1909-1923 | crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1938-1952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1909` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) crates/swc_ecma_minifier/src/compress/pure/switches.rs:632 — crates/swc_ecma_minifier/src/compress/pure/switches.rs:632-646 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:986-1000 — 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/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:418 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:418-432 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1523-1537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:418` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&AssignExpr` in one and `&VarDecl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (15 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:479 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:479-493 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1155-1169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:479` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_transforms_base/src/rename/ops.rs:397 — crates/swc_ecma_transforms_base/src/rename/ops.rs:397-411 | crates/swc_ecma_transforms_base/src/rename/ops.rs:531-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/ops.rs:397` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `nodes` to `&mut Vec<ModuleItem>` in one and `&mut Vec<Stmt>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (15 lines × 2) crates/swc_ecma_transforms_base/src/rename/ops.rs:419 — crates/swc_ecma_transforms_base/src/rename/ops.rs:419-433 | crates/swc_ecma_transforms_base/src/rename/ops.rs:553-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/ops.rs:419` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_transforms_testing/src/lib.rs:543 — crates/swc_ecma_transforms_testing/src/lib.rs:543-557 | crates/swc_ecma_transforms_testing/src/lib.rs:597-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_testing/src/lib.rs:543` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:820 — crates/swc_html_parser/src/lexer/mod.rs:820-834 | crates/swc_html_parser/src/lexer/mod.rs:931-945 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:820` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3985 — crates/swc_html_parser/src/lexer/mod.rs:3985-4000 | crates/swc_xml_parser/src/lexer/mod.rs:2889-2903 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3985` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) crates/swc_sourcemap/src/builder.rs:254 — crates/swc_sourcemap/src/builder.rs:254-268 | crates/swc_sourcemap/src/lazy/mod.rs:269-283 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_sourcemap/src/builder.rs:254` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_html_codegen/src/lib.rs:453 — crates/swc_html_codegen/src/lib.rs:453-471 | crates/swc_html_codegen/src/lib.rs:691-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_codegen/src/lib.rs:453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_transforms_react/src/jsx/mod.rs:1167 — crates/swc_ecma_transforms_react/src/jsx/mod.rs:1167-1181 | crates/swc_ecma_transforms_react/src/jsx/mod.rs:1185-1199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_react/src/jsx/mod.rs:1167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:1757 — crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:1757-1771 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:1773-1787 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×24
  • Edited copy of a member (11 corresponding lines) crates/swc_css_minifier/src/compressor/calc_sum.rs:523 — crates/swc_css_minifier/src/compressor/calc_sum.rs:523-533 | crates/swc_css_minifier/src/compressor/calc_sum.rs:539-549 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_utils/src/lib.rs:1523 — crates/swc_ecma_utils/src/lib.rs:1523-1533 | crates/swc_ecma_utils/src/lib.rs:1537-1552 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_css_codegen/src/lib.rs:675 — crates/swc_css_codegen/src/lib.rs:675-685 | crates/swc_css_codegen/src/lib.rs:994-1010 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_lexer/src/common/parser/mod.rs:155 — crates/swc_ecma_lexer/src/common/parser/mod.rs:155-165 | crates/swc_ecma_parser/src/parser/mod.rs:1139-1149 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc/src/lib.rs:390 — crates/swc/src/lib.rs:390-400 | crates/swc_ecma_transforms_typescript/src/retain.rs:151-163 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_parser/src/parser/mod.rs:641 — crates/swc_ecma_parser/src/parser/mod.rs:641-651 | crates/swc_ecma_parser/src/parser/mod.rs:653-664 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:391 — crates/swc_estree_compat/src/babelify/expr.rs:391-401 | crates/swc_estree_compat/src/babelify/expr.rs:421-431 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_estree_compat/src/babelify/pat.rs:202 — crates/swc_estree_compat/src/babelify/pat.rs:202-212 | crates/swc_estree_compat/src/babelify/prop.rs:69-79 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_css_codegen/src/lib.rs:1216 — crates/swc_css_codegen/src/lib.rs:1216-1228 | crates/swc_css_codegen/src/lib.rs:1675-1685 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_compat_es2015/src/new_target.rs:127 — crates/swc_ecma_compat_es2015/src/new_target.rs:127-137 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1244-1254 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2700 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2700-2710 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:728-745 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:273 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:273-283 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:313-323 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:303 — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:303-313 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:334-344 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_common/src/errors/mod.rs:816 — crates/swc_common/src/errors/mod.rs:816-826 | crates/swc_common/src/errors/mod.rs:828-838 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_utils/src/function/fn_env_hoister.rs:206 — crates/swc_ecma_utils/src/function/fn_env_hoister.rs:206-216 | crates/swc_ecma_utils/src/function/fn_env_hoister.rs:225-235 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_bundler/src/modules/sort/stmt.rs:358 — crates/swc_bundler/src/modules/sort/stmt.rs:358-368 | crates/swc_bundler/src/modules/sort/stmt.rs:370-380 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_arena/src/lib.rs:250 — crates/swc_arena/src/lib.rs:250-260 | crates/swc_arena/src/lib.rs:264-274 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/util.rs:527 — crates/swc_ecma_minifier/src/compress/optimize/util.rs:527-537 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:794-812 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_lints/src/rules/no_param_reassign.rs:143 — crates/swc_ecma_lints/src/rules/no_param_reassign.rs:143-157 | crates/swc_ecma_lints/src/rules/no_param_reassign.rs:185-195 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/mod.rs:456 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:456-466 | crates/swc_ecma_minifier/src/compress/pure/mod.rs:1134-1146 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:276 — crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:276-287 | crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:341-351 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_compat_es2015/src/arrow.rs:180 — crates/swc_ecma_compat_es2015/src/arrow.rs:180-190 | crates/swc_ecma_compat_es2015/src/parameters.rs:782-792 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_transforms_typescript/src/utils.rs:7 — crates/swc_ecma_transforms_typescript/src/utils.rs:7-17 | crates/swc_ecma_transforms_typescript/src/utils.rs:23-33 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:921 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:921-932 | crates/swc_ecma_lexer/src/common/parser/typescript.rs:1069-1079 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D15 · Churn × Complexity Hotspots · Hotspot · ×23
  • Hotspot: crates/swc_ecma_minifier/src/compress/pure/misc.rs crates/swc_ecma_minifier/src/compress/pure/misc.rs:1745 — crates/swc_ecma_minifier/src/compress/pure/misc.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 133 in Pure::ignore_return_value at line 1745. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/pure/misc.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/swc_ecma_parser/src/parser/class_and_fn.rs crates/swc_ecma_parser/src/parser/class_and_fn.rs:1111 — crates/swc_ecma_parser/src/parser/class_and_fn.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 120 in Parser::parse_class_member_with_is_static at line 1111. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/class_and_fn.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/swc_ecma_minifier/src/compress/optimize/sequences.rs crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1496 — crates/swc_ecma_minifier/src/compress/optimize/sequences.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 135 in Optimizer::merge_sequential_expr at line 1496. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/optimize/sequences.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/swc_ecma_parser/src/parser/stmt.rs crates/swc_ecma_parser/src/parser/stmt.rs:1968 — crates/swc_ecma_parser/src/parser/stmt.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in Parser::parse_stmt_internal at line 1968. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/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/swc_ecma_parser/src/parser/typescript.rs crates/swc_ecma_parser/src/parser/typescript.rs:4709 — crates/swc_ecma_parser/src/parser/typescript.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in Parser::parse_ts_non_array_type at line 4709. 14 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/typescript.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/swc_ecma_minifier/src/compress/optimize/inline.rs crates/swc_ecma_minifier/src/compress/optimize/inline.rs:37 — crates/swc_ecma_minifier/src/compress/optimize/inline.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in Optimizer::store_var_for_inlining at line 37. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/optimize/inline.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/swc_ecma_parser/src/parser/module_item.rs crates/swc_ecma_parser/src/parser/module_item.rs:413 — crates/swc_ecma_parser/src/parser/module_item.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 97 in Parser::parse_export at line 413. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/module_item.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/swc_ecma_minifier/src/compress/optimize/iife.rs crates/swc_ecma_minifier/src/compress/optimize/iife.rs:151 — crates/swc_ecma_minifier/src/compress/optimize/iife.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in Optimizer::inline_args_of_iife at line 151. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/optimize/iife.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/swc_ecma_parser/src/parser/expr.rs crates/swc_ecma_parser/src/parser/expr.rs:2547 — crates/swc_ecma_parser/src/parser/expr.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in Parser::parse_args_or_pats_inner at line 2547. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/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/swc_ecma_transforms_base/src/fixer.rs crates/swc_ecma_transforms_base/src/fixer.rs:308 — crates/swc_ecma_transforms_base/src/fixer.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in Fixer::visit_mut_bin_expr at line 308. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_transforms_base/src/fixer.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/swc_ecma_minifier/src/compress/pure/dead_code.rs crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:342 — crates/swc_ecma_minifier/src/compress/pure/dead_code.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in Pure::drop_duplicate_terminate at line 342. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/pure/dead_code.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/swc_ecma_minifier/src/compress/optimize/unused.rs crates/swc_ecma_minifier/src/compress/optimize/unused.rs:431 — crates/swc_ecma_minifier/src/compress/optimize/unused.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Optimizer::take_pat_if_unused at line 431. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/optimize/unused.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/swc_ecma_parser/src/parser/pat.rs crates/swc_ecma_parser/src/parser/pat.rs:231 — crates/swc_ecma_parser/src/parser/pat.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Parser::reparse_expr_as_pat_inner at line 231. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/pat.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/swc_ecma_minifier/src/compress/optimize/evaluate.rs crates/swc_ecma_minifier/src/compress/optimize/evaluate.rs:200 — crates/swc_ecma_minifier/src/compress/optimize/evaluate.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Optimizer::eval_known_static_method_call at line 200. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/optimize/evaluate.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/swc_ecma_parser/src/parser/ident.rs crates/swc_ecma_parser/src/parser/ident.rs:181 — crates/swc_ecma_parser/src/parser/ident.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Parser::parse_ident at line 181. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/ident.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/swc_ecma_codegen/src/lib.rs crates/swc_ecma_codegen/src/lib.rs:360 — crates/swc_ecma_codegen/src/lib.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in Emitter::emit_bin_expr_trailing at line 360. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_codegen/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:977 — crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in swc_ecma_transforms_optimization::simplify::expr::optimize_bin_expr at line 977. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_transforms_optimization/src/simplify/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/swc_ecma_minifier/src/compress/pure/evaluate.rs crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:904 — crates/swc_ecma_minifier/src/compress/pure/evaluate.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Pure::eval_str_method_call at line 904. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/pure/evaluate.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/swc_ecma_minifier/src/compress/pure/switches.rs crates/swc_ecma_minifier/src/compress/pure/switches.rs:66 — crates/swc_ecma_minifier/src/compress/pure/switches.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in Pure::optimize_const_switches at line 66. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/compress/pure/switches.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/swc_ecma_minifier/src/program_data.rs crates/swc_ecma_minifier/src/program_data.rs:236 — crates/swc_ecma_minifier/src/program_data.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ProgramData::merge at line 236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/program_data.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/swc_ecma_parser/src/parser/object.rs crates/swc_ecma_parser/src/parser/object.rs:191 — crates/swc_ecma_parser/src/parser/object.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in Parser::parse_expr_object_prop at line 191. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/object.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/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:83 — crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Remover::visit_mut_expr at line 83. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_transforms_optimization/src/simplify/branch/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/swc_ecma_codegen/src/util/token_boundaries.rs crates/swc_ecma_codegen/src/util/token_boundaries.rs:108 — crates/swc_ecma_codegen/src/util/token_boundaries.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in swc_ecma_codegen::util::token_boundaries::leading_regex at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_codegen/src/util/token_boundaries.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.
D17 · Explicit Debt · FixmeComment · ×23
  • FixmeComment crates/swc_visit/src/util/map.rs:21 — // FIXME(eddyb) Use some sort of "free guard" that — 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/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:96 — // FIXME: Tests failing after this change - needs investigation — 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/swc_ecma_parser/src/parser/expr.rs:2311 — // FIXME: Use display — 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/swc_ecma_lexer/src/common/parser/expr.rs:1442 — // FIXME: Use display — 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/swc_ecma_parser/src/parser/macros.rs:131 — // FIXME: — 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/swc_ecma_lexer/src/common/parser/expr.rs:1729 — // FIXME: — 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/swc_ecma_lexer/src/common/parser/macros.rs:89 — // FIXME: — 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/swc_ecma_parser/src/parser/pat.rs:1037 — // FIXME: This is wrong — 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/swc_ecma_lexer/src/common/parser/pat.rs:824 — // FIXME: This is wrong — 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/swc_ecma_parser/src/parser/stmt.rs:172 — //FIXME: This is wrong. Should check in/of only on first looself. — 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/swc_ecma_parser/benches/files/cal.com.tsx:9811 — // @ts-expect-error FIXME Fix these typings — 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/swc_ecma_parser/benches/files/cal.com.tsx:9844 — // @ts-expect-error FIXME Fix these typings — 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/swc_ecma_parser/benches/files/cal.com.tsx:18927 — // @ts-expect-error FIXME: We have a type mismatch here @hariombalhara @sean-brydon — 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/swc_ecma_parser/benches/files/cal.com.tsx:18957 — // @ts-expect-error FIXME: We have a type mismatch here @hariombalhara @sean-brydon — 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/swc_ecma_parser/benches/files/cal.com.tsx:27360 — // FIXME: Revisit this logic to remove embedType query param check completely. Ideally, /embed should always be there at the end of the URL. Test properly and then remove it. — 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/swc_ecma_lexer/src/common/parser/stmt.rs:154 — //FIXME: This is wrong. Should check in/of only on first loop. — 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/swc_ecma_compat_es2016/src/exponentiation.rs:68 — // FIXME — 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/swc_common/src/sync.rs:321 — // FIXME: Probably a bad idea — 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/swc_common/src/syntax_pos.rs:483 — // FIXME(jseyfried): self.ctxt should always equal end.ctxt here (c.f. issue — 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/swc_common/src/syntax_pos.rs:1123 — // FIXME: Lots of boilerplate in these impls, but so far my attempts to fix — 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/swc_common/src/syntax_pos/analyze_source_file.rs:121 — // FIXME: How can we decide between `width` and `width_cjk`? — 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/swc_common/src/errors/mod.rs:567 — // FIXME: This method should be removed (every error should have an associated — 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/swc_common/src/errors/mod.rs:667 — // FIXME: don't abort here if report_delayed_bugs is off — 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×22
  • Duplicated block (13 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1344 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1344-1356 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1473-1485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:1344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:3498 — REDACTED:3498-3510 | REDACTED:3531-3543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3498` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_ecma_lints/src/rules/no_empty_function.rs:294 — crates/swc_ecma_lints/src/rules/no_empty_function.rs:294-306 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:321-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lints/src/rules/no_empty_function.rs:294` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `function` to `&Function` in one and `&ArrowExpr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) crates/swc_ecma_lints/src/rules/no_loop_func.rs:272 — crates/swc_ecma_lints/src/rules/no_loop_func.rs:272-284 | crates/swc_ecma_lints/src/rules/no_loop_func.rs:287-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1251 — crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1251-1263 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1351-1363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:18 — crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:18-30 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:95-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:18` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:1568 — crates/swc_ecma_parser/src/parser/expr.rs:1568-1580 | crates/swc_ecma_parser/src/parser/expr.rs:1731-1743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:1568` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2339 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2339-2351 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2353-2365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) crates/swc_ecma_transforms_react/src/jsx/mod.rs:690 — crates/swc_ecma_transforms_react/src/jsx/mod.rs:690-703 | crates/swc_ecma_transforms_react/src/jsx/mod.rs:990-1002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_react/src/jsx/mod.rs:690` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_ecma_transforms_testing/src/lib.rs:365 — crates/swc_ecma_transforms_testing/src/lib.rs:365-377 | crates/swc_ecma_transforms_testing/src/lib.rs:1013-1025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_testing/src/lib.rs:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_estree_ast/src/class.rs:176 — crates/swc_estree_ast/src/class.rs:176-188 | crates/swc_estree_ast/src/object.rs:110-122 — before extracting anything, compare `crates/swc_estree_ast/src/class.rs` and `crates/swc_estree_ast/src/object.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_estree_ast/src/class.rs:176` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/swc_estree_ast/src/object.rs:112 — crates/swc_estree_ast/src/object.rs:112-124 | crates/swc_estree_ast/src/object.rs:250-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_estree_ast/src/object.rs:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_estree_ast/src/object.rs:110` calls `as_deref`, `as_ref` and `crates/swc_estree_ast/src/object.rs:249` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3791 — crates/swc_html_parser/src/lexer/mod.rs:3791-3803 | crates/swc_html_parser/src/lexer/mod.rs:3853-3865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3791` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:4670 — crates/swc_html_parser/src/lexer/mod.rs:4670-4682 | crates/swc_html_parser/src/lexer/mod.rs:4724-4736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:4670` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_html_parser/src/parser/mod.rs:462 — crates/swc_html_parser/src/parser/mod.rs:462-474 | crates/swc_xml_parser/src/parser/mod.rs:141-153 — before extracting anything, compare `crates/swc_html_parser/src/parser/mod.rs` and `crates/swc_xml_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_native_addon/src/platform/windows.rs:401 — crates/swc_native_addon/src/platform/windows.rs:401-413 | crates/swc_native_addon/src/platform/windows.rs:529-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_native_addon/src/platform/windows.rs:401` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/swc_ts_fast_strip/src/lib.rs:321 — crates/swc_ts_fast_strip/src/lib.rs:321-333 | crates/swc_ts_fast_strip/src/lib.rs:357-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/swc_xml_parser/src/parser/mod.rs:275 — crates/swc_xml_parser/src/parser/mod.rs:275-287 | crates/swc_xml_parser/src/parser/mod.rs:390-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/parser/mod.rs:275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_css_ast/src/token.rs:164 — crates/swc_css_ast/src/token.rs:164-176 | crates/swc_css_ast/src/value.rs:383-395 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/swc_ecma_lexer/src/common/parser/util.rs:25 — crates/swc_ecma_lexer/src/common/parser/util.rs:25-37 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2286-2298 — 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/swc_html_parser/src/parser/mod.rs:3301 — crates/swc_html_parser/src/parser/mod.rs:3301-3314 | crates/swc_html_parser/src/parser/mod.rs:3362-3374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:3301` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/swc_css_prefixer/src/prefixer.rs:3476 — crates/swc_css_prefixer/src/prefixer.rs:3476-3488 | crates/swc_css_prefixer/src/prefixer.rs:3504-3516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:3476` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×20
  • Edited copy of a member (13 corresponding lines) crates/swc_common/src/source_map.rs:706 — crates/swc_common/src/source_map.rs:706-722 | crates/swc_common/src/source_map.rs:742-754 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/jsdoc/src/lib.rs:585 — crates/jsdoc/src/lib.rs:585-599 | crates/jsdoc/src/lib.rs:601-613 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1029 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1029-1041 | crates/swc_ecma_parser/src/lexer/mod.rs:1413-1425 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1014 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1014-1027 | crates/swc_ecma_parser/src/lexer/mod.rs:1399-1411 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_bundler/src/bundler/export.rs:72 — crates/swc_bundler/src/bundler/export.rs:72-90 | crates/swc_bundler/src/bundler/import/mod.rs:149-161 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_common/src/input.rs:56 — crates/swc_common/src/input.rs:56-68 | crates/swc_common/src/input.rs:146-161 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/parser/mod.rs:209 — crates/swc_ecma_lexer/src/common/parser/mod.rs:209-221 | crates/swc_ecma_parser/src/parser/mod.rs:1314-1326 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2014 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2014-2026 | crates/swc_ecma_parser/src/lexer/mod.rs:2227-2239 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/parser/jsx.rs:26 — crates/swc_ecma_lexer/src/common/parser/jsx.rs:26-41 | crates/swc_ecma_lexer/src/common/parser/jsx.rs:243-255 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lints/src/rules/no_alert.rs:118 — crates/swc_ecma_lints/src/rules/no_alert.rs:118-130 | crates/swc_ecma_lints/src/rules/radix.rs:183-195 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:121 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:121-133 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1413-1429 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_preset_env/src/corejs2/mod.rs:77 — crates/swc_ecma_preset_env/src/corejs2/mod.rs:77-89 | crates/swc_ecma_preset_env/src/corejs3/usage.rs:124-141 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lints/src/rules/prefer_regex_literals.rs:105 — crates/swc_ecma_lints/src/rules/prefer_regex_literals.rs:105-117 | crates/swc_ecma_lints/src/rules/quotes.rs:53-69 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/static_alias.rs:470 — crates/swc_ecma_minifier/src/compress/optimize/static_alias.rs:470-482 | crates/swc_ecma_minifier/src/compress/optimize/static_alias.rs:491-505 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_transforms_base/src/resolver/mod.rs:1163 — crates/swc_ecma_transforms_base/src/resolver/mod.rs:1163-1175 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1261-1276 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1798 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1798-1810 | crates/swc_ecma_parser/src/lexer/mod.rs:2023-2035 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_common/src/errors/diagnostic.rs:359 — crates/swc_common/src/errors/diagnostic.rs:359-372 | crates/swc_common/src/errors/diagnostic.rs:403-415 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:593 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:593-605 | crates/swc_ecma_parser/src/parser/typescript.rs:1395-1407 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_ecma_codegen/src/lib.rs:2193 — crates/swc_ecma_codegen/src/lib.rs:2193-2205 | crates/swc_ecma_codegen/src/lib.rs:2558-2572 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/swc_common/src/syntax_pos.rs:311 — crates/swc_common/src/syntax_pos.rs:311-323 | crates/swc_common/src/syntax_pos.rs:325-337 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×20
  • Edited copy of a member (9 corresponding lines) crates/hstr/src/lib.rs:402 — crates/hstr/src/lib.rs:402-410 | crates/swc_atoms/src/lib.rs:234-244 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/number.rs:86 — crates/swc_ecma_lexer/src/common/lexer/number.rs:86-94 | crates/swc_ecma_parser/src/lexer/number.rs:106-114 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_estree_compat/src/babelify/module_decl.rs:261 — crates/swc_estree_compat/src/babelify/module_decl.rs:261-269 | crates/swc_estree_compat/src/babelify/module_decl.rs:317-325 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/misc.rs:2738 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:2738-2746 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:1881-1889 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_ast/src/module_decl.rs:300 — crates/swc_ecma_ast/src/module_decl.rs:300-308 | crates/swc_ecma_ast/src/module_decl.rs:310-318 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_estree_compat/src/babelify/typescript.rs:939 — crates/swc_estree_compat/src/babelify/typescript.rs:939-947 | crates/swc_estree_compat/src/babelify/typescript.rs:981-989 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lexer/src/common/parser/buffer.rs:80 — crates/swc_ecma_lexer/src/common/parser/buffer.rs:80-88 | crates/swc_ecma_parser/src/parser/input.rs:449-457 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_estree_compat/src/babelify/typescript.rs:833 — crates/swc_estree_compat/src/babelify/typescript.rs:833-842 | crates/swc_estree_compat/src/babelify/typescript.rs:885-893 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:241 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:241-249 | crates/swc_ecma_parser/src/lexer/mod.rs:720-728 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_html_parser/src/parser/node.rs:67 — crates/swc_html_parser/src/parser/node.rs:67-75 | crates/swc_xml_parser/src/parser/node.rs:73-81 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_compat_es2015/src/classes/mod.rs:239 — crates/swc_ecma_compat_es2015/src/classes/mod.rs:239-253 | crates/swc_ecma_compat_es2015/src/classes/mod.rs:256-264 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lexer/src/common/parser/util.rs:39 — crates/swc_ecma_lexer/src/common/parser/util.rs:39-47 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2308-2316 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_bundler/src/bundler/keywords.rs:60 — crates/swc_bundler/src/bundler/keywords.rs:60-70 | crates/swc_bundler/src/modules/sort/stmt.rs:571-579 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_estree_compat/src/swcify/stmt.rs:192 — crates/swc_estree_compat/src/swcify/stmt.rs:192-200 | crates/swc_estree_compat/src/swcify/stmt.rs:609-617 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lints/src/rules/symbol_description.rs:93 — crates/swc_ecma_lints/src/rules/symbol_description.rs:93-103 | crates/swc_ecma_lints/src/rules/no_obj_calls.rs:77-85 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2002 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2002-2010 | crates/swc_ecma_parser/src/lexer/mod.rs:2215-2223 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2545 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2545-2557 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:690-698 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_compat_es2015/src/object_super.rs:177 — crates/swc_ecma_compat_es2015/src/object_super.rs:177-186 | crates/swc_ecma_transforms_classes/src/lib.rs:17-25 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_atoms/src/lib.rs:90 — crates/swc_atoms/src/lib.rs:90-98 | crates/swc_atoms/src/wtf8_atom.rs:60-68 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/swc_ecma_lexer/src/common/parser/util.rs:15 — crates/swc_ecma_lexer/src/common/parser/util.rs:15-23 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2318-2326 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×18
  • Duplicated block (16 lines × 2) crates/ast_node/src/spanned.rs:102 — crates/ast_node/src/spanned.rs:102-117 | crates/string_enum/src/lib.rs:251-266 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast_node/src/spanned.rs:102` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/swc_css_modules/src/lib.rs:201 — crates/swc_css_modules/src/lib.rs:201-216 | crates/swc_css_modules/src/lib.rs:218-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:876 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:876-891 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:986-1001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:876` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:818 — crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:818-833 | crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:842-857 — both copies are in the same file, so extract the block into 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/swc_ecma_compat_es2022/src/class_properties/private_field.rs:234 — crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:234-249 | crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:514-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `e` to `&mut Expr` in one and `&mut SimpleAssignTarget` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:626 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:626-641 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:687-702 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:626` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1151 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1151-1166 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1452-1467 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1633 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1633-1648 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2007-2022 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1633` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:122 — crates/swc_ecma_lexer/src/common/parser/expr.rs:122-137 | crates/swc_ecma_parser/src/parser/expr.rs:699-714 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:570 — crates/swc_ecma_lexer/src/common/parser/pat.rs:570-585 | crates/swc_ecma_parser/src/parser/pat.rs:709-724 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:570` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:36 — crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:36-51 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:134-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/dead_code.rs:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn simplify_assign_expr(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:257 — crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:257-272 | crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:905-920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn eval_array_or_fn_method_call(&mut` in one and `super) fn eval_str_method_call(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) crates/swc_ecma_parser/src/parser/class_and_fn.rs:1715 — crates/swc_ecma_parser/src/parser/class_and_fn.rs:1715-1730 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1848-1863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) crates/swc_ecma_transforms_base/src/rename/mod.rs:387 — crates/swc_ecma_transforms_base/src/rename/mod.rs:387-402 | crates/swc_ecma_transforms_base/src/rename/mod.rs:405-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut FnDecl` in one and `&mut ClassDecl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:788 — crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:788-803 | crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:858-873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/expr/mod.rs:788` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/swc_ecma_utils/src/lib.rs:2175 — crates/swc_ecma_utils/src/lib.rs:2175-2190 | crates/swc_ecma_utils/src/lib.rs:2553-2568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:2943 — crates/swc_html_parser/src/lexer/mod.rs:2943-2958 | crates/swc_xml_parser/src/lexer/mod.rs:1261-1276 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2943` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) crates/swc_xml_parser/src/lexer/mod.rs:367 — crates/swc_xml_parser/src/lexer/mod.rs:367-382 | crates/swc_xml_parser/src/lexer/mod.rs:394-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:367` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×16
  • Edited copy of a member (15 corresponding lines) crates/swc_bundler/src/modules/mod.rs:75 — crates/swc_bundler/src/modules/mod.rs:75-89 | crates/swc_bundler/src/modules/mod.rs:91-105 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_utils/src/ts_bindings.rs:685 — crates/swc_ecma_utils/src/ts_bindings.rs:685-699 | crates/swc_typescript/src/fast_dts/util/ast_ext.rs:251-265 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_parser/src/lexer/state.rs:303 — crates/swc_ecma_parser/src/lexer/state.rs:303-317 | crates/swc_ecma_parser/src/lexer/state.rs:319-334 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1686 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1686-1700 | crates/swc_ecma_parser/src/parser/typescript.rs:3321-3338 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:529 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:529-544 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:589-603 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2151 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2151-2173 | crates/swc_ecma_parser/src/lexer/mod.rs:2337-2351 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_transforms_base/src/helpers/mod.rs:255 — crates/swc_ecma_transforms_base/src/helpers/mod.rs:255-273 | crates/swc_ecma_transforms_base/src/helpers/mod.rs:276-290 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:926 — crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:926-940 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:992-1009 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_compat_es2015/src/object_super.rs:189 — crates/swc_ecma_compat_es2015/src/object_super.rs:189-204 | crates/swc_ecma_transforms_classes/src/super_field.rs:620-634 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:902 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:902-916 | crates/swc_ecma_parser/src/parser/stmt.rs:1021-1035 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/unused.rs:172 — crates/swc_ecma_minifier/src/compress/optimize/unused.rs:172-186 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:192-206 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_css_codegen/src/lib.rs:2034 — crates/swc_css_codegen/src/lib.rs:2034-2048 | crates/swc_css_codegen/src/lib.rs:2080-2094 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_html_minifier/src/lib.rs:2867 — crates/swc_html_minifier/src/lib.rs:2867-2881 | crates/swc_html_minifier/src/lib.rs:2888-2902 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_common/src/comments.rs:52 — crates/swc_common/src/comments.rs:52-66 | crates/swc_common/src/comments.rs:72-86 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_lints/src/rules/critical_rules.rs:408 — crates/swc_ecma_lints/src/rules/critical_rules.rs:408-424 | crates/swc_ecma_lints/src/rules/critical_rules.rs:426-440 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/mod.rs:48 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:48-62 | crates/swc_ecma_minifier/src/eval.rs:30-44 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×16
  • Edited copy of a member (14 corresponding lines) crates/hstr/src/lib.rs:271 — crates/hstr/src/lib.rs:271-284 | crates/hstr/src/wtf8_atom.rs:367-380 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:463 — crates/swc_estree_compat/src/babelify/expr.rs:463-476 | crates/swc_estree_compat/src/babelify/expr.rs:482-497 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_parser/src/parser/mod.rs:253 — crates/swc_ecma_parser/src/parser/mod.rs:253-267 | crates/swc_ecma_parser/src/parser/mod.rs:270-283 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_parser/src/parser/mod.rs:220 — crates/swc_ecma_parser/src/parser/mod.rs:220-234 | crates/swc_ecma_parser/src/parser/mod.rs:237-250 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_bundler/src/bundler/helpers/mod.rs:15 — crates/swc_bundler/src/bundler/helpers/mod.rs:15-28 | crates/swc_ecma_transforms_base/src/helpers/mod.rs:26-48 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1849 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1849-1862 | crates/swc_ecma_parser/src/lexer/mod.rs:2070-2083 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1904 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1904-1917 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1919-1932 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_estree_compat/src/swcify/expr.rs:249 — crates/swc_estree_compat/src/swcify/expr.rs:249-262 | crates/swc_estree_compat/src/swcify/expr.rs:433-452 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/dbg-swc/src/main.rs:39 — crates/dbg-swc/src/main.rs:39-57 | crates/testing/src/lib.rs:39-52 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_xml_codegen/src/lib.rs:446 — crates/swc_ecma_react_compiler/src/convert_ast_reverse.rs:2852-2865 | crates/swc_xml_codegen/src/lib.rs:446-466 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_parser/src/parser/expr.rs:854 — crates/swc_ecma_parser/src/parser/expr.rs:854-867 | crates/swc_ecma_parser/src/parser/expr.rs:973-988 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:632 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:632-645 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:741-756 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_parser/src/parser/stmt.rs:1410 — crates/swc_ecma_parser/src/parser/stmt.rs:1410-1423 | crates/swc_ecma_parser/src/parser/stmt.rs:1734-1750 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:246 — crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:246-259 | crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:470-486 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_common/src/errors/diagnostic.rs:280 — crates/swc_common/src/errors/diagnostic.rs:280-293 | crates/swc_common/src/errors/diagnostic.rs:313-326 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/swc_plugin_runner/src/imported_fn/metadata_context.rs:79 — crates/swc_plugin_runner/src/imported_fn/metadata_context.rs:79-92 | crates/swc_plugin_runner/src/imported_fn/metadata_context.rs:129-143 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×16
  • Edited copy of a member (12 corresponding lines) crates/testing/src/lib.rs:120 — crates/testing/src/lib.rs:120-133 | crates/testing/src/lib.rs:139-150 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_typescript/src/fast_dts/util/ast_ext.rs:219 — crates/swc_typescript/src/fast_dts/util/ast_ext.rs:219-230 | crates/swc_typescript/src/fast_dts/util/ast_ext.rs:232-243 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_typescript/src/fast_dts/visitors/type_usage.rs:342 — crates/swc_typescript/src/fast_dts/visitors/type_usage.rs:342-358 | crates/swc_typescript/src/fast_dts/visitors/type_usage.rs:366-377 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:244 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:244-258 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:270-281 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_ecma_transformer/src/es2022/private_property_in_object.rs:245 — crates/swc_ecma_transformer/src/es2022/private_property_in_object.rs:245-256 | crates/swc_ecma_transformer/src/es2022/private_property_in_object.rs:271-283 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_estree_compat/src/babelify/typescript.rs:57 — crates/swc_estree_compat/src/babelify/typescript.rs:57-68 | crates/swc_estree_compat/src/babelify/typescript.rs:478-490 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_common/src/comments.rs:502 — crates/swc_common/src/comments.rs:502-516 | crates/swc_node_comments/src/lib.rs:95-106 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_ecma_lexer/src/common/parser/mod.rs:94 — crates/swc_ecma_lexer/src/common/parser/mod.rs:94-105 | crates/swc_ecma_lexer/src/common/parser/mod.rs:107-118 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_native_addon/src/platform/unix.rs:253 — crates/swc_native_addon/src/platform/unix.rs:253-264 | crates/swc_native_addon/src/platform/unix.rs:267-282 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc/src/plugin.rs:206 — crates/swc/src/plugin.rs:206-217 | crates/swc/src/plugin.rs:219-230 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:105 — crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:105-116 | crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs:118-131 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_ecma_transforms_base/src/rename/mod.rs:75 — crates/swc_ecma_transforms_base/src/rename/mod.rs:75-86 | crates/swc_ecma_transforms_base/src/rename/mod.rs:94-105 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_native_addon/src/platform/windows.rs:130 — crates/swc_native_addon/src/platform/windows.rs:130-141 | crates/swc_native_addon/src/platform/windows.rs:146-157 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_estree_compat/src/swcify/stmt.rs:242 — crates/swc_estree_compat/src/swcify/stmt.rs:242-253 | crates/swc_estree_compat/src/swcify/stmt.rs:295-306 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_ecma_compat_es2015/src/new_target.rs:91 — crates/swc_ecma_compat_es2015/src/new_target.rs:91-102 | crates/swc_ecma_compat_es2015/src/new_target.rs:104-120 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/swc_estree_compat/src/babelify/typescript.rs:380 — crates/swc_estree_compat/src/babelify/typescript.rs:380-391 | crates/swc_estree_compat/src/babelify/typescript.rs:663-674 — 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 (10 corresponding lines) · ×15
  • Edited copy of a member (10 corresponding lines) crates/swc_estree_compat/src/babelify/jsx.rs:223 — crates/swc_estree_compat/src/babelify/jsx.rs:223-232 | crates/swc_estree_compat/src/babelify/jsx.rs:267-277 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_common/src/source_map.rs:691 — crates/swc_common/src/source_map.rs:691-700 | crates/swc_common/src/source_map.rs:727-736 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_estree_compat/src/babelify/pat.rs:154 — crates/swc_estree_compat/src/babelify/pat.rs:154-167 | crates/swc_estree_compat/src/babelify/pat.rs:218-227 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:332 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:332-344 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:762-771 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:1950 — REDACTED:1950-1959 | REDACTED:1961-1970 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_xml_parser/src/parser/mod.rs:572 — crates/swc_xml_parser/src/parser/mod.rs:572-581 | crates/swc_xml_parser/src/parser/mod.rs:616-625 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:588 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:588-597 | crates/swc_ecma_parser/src/parser/stmt.rs:698-707 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_ecma_lexer/src/common/parser/jsx.rs:148 — crates/swc_ecma_lexer/src/common/parser/jsx.rs:148-157 | crates/swc_ecma_parser/src/parser/jsx.rs:54-63 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:185 — crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:185-194 | crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:196-207 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_estree_compat/src/babelify/pat.rs:173 — crates/swc_estree_compat/src/babelify/pat.rs:173-182 | crates/swc_estree_compat/src/babelify/typescript.rs:508-517 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:63 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:63-72 | crates/swc_ecma_parser/src/parser/typescript.rs:789-798 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_css_lints/src/config.rs:37 — crates/swc_css_lints/src/config.rs:37-46 | crates/swc_ecma_lints/src/config.rs:36-46 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_html_parser/src/lib.rs:53 — crates/swc_html_parser/src/lib.rs:53-62 | crates/swc_css_parser/src/lib.rs:68-77 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_bundler/src/inline.rs:150 — crates/swc_bundler/src/inline.rs:150-159 | crates/swc_ecma_minifier/src/compress/pure/vars.rs:462-471 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/swc_bundler/src/bundler/keywords.rs:72 — crates/swc_bundler/src/bundler/keywords.rs:72-81 | crates/swc_ecma_transforms_optimization/src/simplify/const_propagation.rs:83-92 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×15
  • Edited copy of a member (7 corresponding lines) crates/swc_common/src/source_map.rs:852 — crates/swc_common/src/source_map.rs:852-858 | crates/swc_common/src/source_map.rs:861-869 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_common/src/syntax_pos/hygiene.rs:170 — crates/swc_common/src/syntax_pos/hygiene.rs:170-176 | crates/swc_common/src/syntax_pos/hygiene.rs:466-472 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_ast/src/lit.rs:143 — crates/swc_ecma_ast/src/lit.rs:143-149 | crates/swc_ecma_ast/src/lit.rs:194-200 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_ast/src/expr.rs:1321 — crates/swc_ecma_ast/src/expr.rs:1321-1332 | crates/swc_ecma_ast/src/jsx.rs:224-230 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_lexer/src/input.rs:68 — crates/swc_ecma_lexer/src/input.rs:68-74 | crates/swc_ecma_lexer/src/lexer/state.rs:649-655 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:120 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:120-126 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:103-112 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_atoms/src/lib.rs:81 — crates/swc_atoms/src/lib.rs:81-87 | crates/swc_atoms/src/wtf8_atom.rs:49-57 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_lexer/src/common/parser/jsx.rs:126 — crates/swc_ecma_lexer/src/common/parser/jsx.rs:126-132 | crates/swc_ecma_parser/src/parser/jsx.rs:42-48 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_common/src/serializer.rs:37 — crates/swc_common/src/serializer.rs:37-44 | crates/swc_ecma_regexp_ast/src/lib.rs:391-397 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_bundler/src/bundler/keywords.rs:119 — crates/swc_bundler/src/bundler/keywords.rs:119-128 | crates/swc_ecma_utils/src/lib.rs:2642-2648 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_transforms_optimization/src/simplify/const_propagation.rs:32 — crates/swc_ecma_transforms_optimization/src/simplify/const_propagation.rs:32-38 | crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:542-548 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_estree_compat/src/swcify/expr.rs:965 — crates/swc_estree_compat/src/swcify/expr.rs:965-971 | crates/swc_estree_compat/src/swcify/stmt.rs:403-409 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_sourcemap/src/lazy/mod.rs:456 — crates/swc_sourcemap/src/lazy/mod.rs:456-462 | crates/swc_sourcemap/src/types.rs:968-974 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1537 — crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1537-1543 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:262-268 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/swc_ts_fast_strip/src/erase/declarations.rs:33 — crates/swc_ts_fast_strip/src/erase/declarations.rs:33-39 | crates/swc_ts_fast_strip/src/erase/mod.rs:342-348 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×15
  • Duplicated block (5 lines × 2) REDACTED:2310 — REDACTED:2310-2314 | REDACTED:2335-2339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:83 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:83-87 | crates/swc_ecma_lexer/src/common/parser/typescript.rs:211-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/swc_ecma_minifier/src/compress/pure/misc.rs:599 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:599-603 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:632-636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/misc.rs:599` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/swc_ecma_parser/src/parser/typescript.rs:5334 — crates/swc_ecma_parser/src/parser/typescript.rs:5334-5338 | crates/swc_ecma_parser/src/parser/typescript.rs:5342-5346 — both copies are in the same file, so extract the block into 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/swc_ecma_transformer/src/es2018/object_rest_spread.rs:177 — crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:177-181 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:543-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/swc_ecma_transforms_base/src/fixer/typescript.rs:352 — crates/swc_ecma_transforms_base/src/fixer/typescript.rs:352-356 | crates/swc_ecma_transforms_base/src/fixer/typescript.rs:402-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) crates/swc_ecma_transforms_base/src/rename/mod.rs:443 — crates/swc_ecma_transforms_base/src/rename/mod.rs:443-447 | crates/swc_ecma_transforms_base/src/rename/mod.rs:484-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/mod.rs:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `m` to `&mut Module` in one and `&mut Script` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) crates/swc_ecma_transforms_testing/src/lib.rs:262 — crates/swc_ecma_transforms_testing/src/lib.rs:262-266 | crates/swc_ecma_transforms_testing/src/lib.rs:358-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_testing/src/lib.rs:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/swc_ts_fast_strip/src/token_cursor.rs:33 — crates/swc_ts_fast_strip/src/token_cursor.rs:33-37 | crates/swc_ts_fast_strip/src/token_cursor.rs:69-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 (5 lines × 2) crates/swc_bundler/src/bundler/chunk/cjs.rs:389 — crates/swc_bundler/src/bundler/chunk/cjs.rs:389-393 | crates/swc_ecma_utils/src/lib.rs:2462-2466 — 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/swc_ecma_lexer/src/common/lexer/mod.rs:253 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:253-257 | crates/swc_ecma_parser/src/lexer/mod.rs:732-736 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_transforms_base/src/resolver/mod.rs:326 — crates/swc_ecma_transforms_base/src/resolver/mod.rs:326-331 | crates/swc_ecma_transforms_typescript/src/semantic/usage.rs:408-412 — 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/swc_css_parser/src/parser/values_and_units/mod.rs:842 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:842-847 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1163-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:842` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:347 — crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:347-351 | crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:353-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2022/src/class_properties/member_init.rs:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/swc_html_codegen/src/lib.rs:118 — crates/swc_html_codegen/src/lib.rs:118-122 | crates/swc_xml_codegen/src/lib.rs:60-64 — before extracting anything, compare `crates/swc_html_codegen/src/lib.rs` and `crates/swc_xml_codegen/src/lib.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_codegen/src/lib.rs:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_xml_codegen/src/lib.rs:65` calls `ProcessingInstruction`, `CdataSection` and `crates/swc_html_codegen/src/lib.rs:123` 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.
D5 · Coupling · Off the main sequence · ×15
  • Off the main sequence: better_scoped_tls — better_scoped_tls: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: swc_allocator — swc_allocator: 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: swc_native_addon — swc_native_addon: 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: swc_plugin — swc_plugin: 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: swc_atoms — swc_atoms: abstractness 0.00, instability 0.02, distance 0.98 — zone of pain — concrete and depended on by 61 project(s), so it's rigid to change.
  • Off the main sequence: swc_sourcemap — swc_sourcemap: abstractness 0.03, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: swc_cli_impl — swc_cli_impl: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: swc_ecma_ast — swc_ecma_ast: abstractness 0.02, instability 0.07, distance 0.91 — zone of pain — concrete and depended on by 51 project(s), so it's rigid to change.
  • Off the main sequence: hstr — hstr: abstractness 0.13, instability 0.00, distance 0.88 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: swc_css_ast — swc_css_ast: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
  • Off the main sequence: swc_error_reporters — swc_error_reporters: abstractness 0.11, instability 0.08, distance 0.81 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
  • Off the main sequence: swc_html_ast — swc_html_ast: abstractness 0.00, instability 0.22, distance 0.78 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: swc_config — swc_config: abstractness 0.13, instability 0.13, distance 0.75 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
  • Off the main sequence: swc_ecma_quote — swc_ecma_quote: abstractness 1.00, instability 0.75, distance 0.75 — zone of uselessness — abstract and unstable, so it's likely unused.
  • Off the main sequence: swc_html_utils — swc_html_utils: 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×14
  • Members sharing a duplicated core (4 members, 50+ identical tokens) bindings/binding_core_node/src/parse.rs:43 — bindings/binding_core_node/src/parse.rs:43-80 | bindings/binding_core_node/src/parse.rs:92-133 | bindings/binding_core_node/src/parse.rs:181-225 | bindings/binding_core_node/src/parse.rs:228-266 — 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) bindings/binding_core_node/src/util.rs:36 — bindings/binding_core_node/src/util.rs:36-65 | bindings/binding_html_node/src/util.rs:8-36 | bindings/binding_html_wasm/src/util.rs:8-36 | bindings/binding_minifier_node/src/util.rs:29-58 — 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/swc_css_codegen/src/writer/basic.rs:113 — crates/swc_css_codegen/src/writer/basic.rs:113-140 | crates/swc_ecma_codegen/src/text_writer/basic_impl.rs:97-121 | crates/swc_html_codegen/src/writer/basic.rs:111-138 | crates/swc_xml_codegen/src/writer/basic.rs:111-138 — 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/swc_css_parser/src/lexer/mod.rs:738 — crates/swc_css_parser/src/lexer/mod.rs:738-848 | crates/swc_css_parser/src/lexer/mod.rs:852-1043 | crates/swc_css_parser/src/lexer/mod.rs:1050-1144 | crates/swc_css_parser/src/lexer/mod.rs:1465-1523 — 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/swc_ecma_lexer/src/common/lexer/mod.rs:260 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:260-368 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:371-503 | crates/swc_ecma_parser/src/lexer/mod.rs:739-847 | crates/swc_ecma_parser/src/lexer/mod.rs:850-970 — 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/swc_ecma_lexer/src/common/parser/class_and_fn.rs:930 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:930-1369 | crates/swc_ecma_lexer/src/common/parser/object.rs:156-407 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1120-1690 | crates/swc_ecma_parser/src/parser/object.rs:191-501 — 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/swc_ecma_lexer/src/common/parser/expr.rs:366 — crates/swc_ecma_lexer/src/common/parser/expr.rs:366-469 | crates/swc_ecma_lexer/src/common/parser/typescript.rs:2881-2950 | crates/swc_ecma_parser/src/parser/expr.rs:146-257 | crates/swc_ecma_parser/src/parser/typescript.rs:5547-5621 — 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/swc_ecma_lexer/src/common/parser/expr.rs:1852 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1852-2097 | crates/swc_ecma_lexer/src/common/parser/pat.rs:517-645 | crates/swc_ecma_parser/src/parser/expr.rs:2547-2838 | crates/swc_ecma_parser/src/parser/pat.rs:653-790 — 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/swc_ecma_lexer/src/common/parser/mod.rs:234 — crates/swc_ecma_lexer/src/common/parser/mod.rs:234-242 | crates/swc_ecma_lexer/src/common/parser/mod.rs:245-253 | crates/swc_ecma_parser/src/parser/mod.rs:1339-1347 | crates/swc_ecma_parser/src/parser/mod.rs:1350-1358 — 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/swc_ecma_transformer/src/es2015/instanceof.rs:92 — crates/swc_ecma_transformer/src/es2015/instanceof.rs:92-107 | crates/swc_ecma_transformer/src/es2015/instanceof.rs:109-124 | crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:180-193 | crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:195-208 — 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/swc_ecma_transforms_base/src/resolver/mod.rs:1333 — crates/swc_ecma_transforms_base/src/resolver/mod.rs:1333-1345 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1347-1361 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1363-1375 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1436-1448 — 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/swc_estree_ast/src/class.rs:157 — crates/swc_estree_ast/src/class.rs:157-210 | crates/swc_estree_ast/src/class.rs:329-374 | crates/swc_estree_ast/src/object.rs:96-146 | crates/swc_estree_ast/src/object.rs:238-278 — 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/swc_estree_compat/src/babelify/typescript.rs:227 — crates/swc_estree_compat/src/babelify/typescript.rs:227-240 | crates/swc_estree_compat/src/babelify/typescript.rs:246-259 | crates/swc_estree_compat/src/babelify/typescript.rs:282-298 | crates/swc_estree_compat/src/babelify/typescript.rs:304-317 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/swc_plugin_runner/src/imported_fn/comments.rs:156 — crates/swc_plugin_runner/src/imported_fn/comments.rs:156-178 | crates/swc_plugin_runner/src/imported_fn/comments.rs:191-213 | crates/swc_plugin_runner/src/imported_fn/comments.rs:270-292 | crates/swc_plugin_runner/src/imported_fn/comments.rs:300-322 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×12
  • Edited copy of a member (19 corresponding lines) crates/swc_css_codegen/src/lib.rs:613 — crates/swc_css_codegen/src/lib.rs:613-631 | crates/swc_css_codegen/src/lib.rs:921-939 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_parser/src/parser/jsx.rs:99 — crates/swc_ecma_parser/src/parser/jsx.rs:99-117 | crates/swc_ecma_parser/src/parser/jsx.rs:294-312 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_estree_compat/src/babelify/module.rs:54 — crates/swc_estree_compat/src/babelify/module.rs:54-76 | crates/swc_estree_compat/src/babelify/module.rs:82-100 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2288 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2288-2306 | crates/swc_ecma_parser/src/parser/typescript.rs:4531-4549 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:742 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:742-760 | crates/swc_ecma_parser/src/parser/stmt.rs:861-879 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1809 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1809-1827 | crates/swc_ecma_parser/src/parser/typescript.rs:3783-3801 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_transforms_base/src/rename/mod.rs:442 — crates/swc_ecma_transforms_base/src/rename/mod.rs:442-481 | crates/swc_ecma_transforms_base/src/rename/mod.rs:483-501 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1204 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1204-1222 | crates/swc_ecma_parser/src/parser/typescript.rs:2456-2475 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:612 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:612-630 | crates/swc_ecma_parser/src/parser/typescript.rs:1414-1432 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/module_item.rs:35 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:35-54 | crates/swc_ecma_parser/src/parser/module_item.rs:1120-1138 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/mod.rs:333 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:333-351 | crates/swc_ecma_minifier/src/compress/pure/mod.rs:1469-1488 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:93 — crates/swc_ecma_lexer/src/common/parser/pat.rs:93-111 | crates/swc_ecma_parser/src/parser/pat.rs:211-229 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×12
  • Duplicated block (22 lines × 2) crates/swc_css_prefixer/src/prefixer.rs:2237 — crates/swc_css_prefixer/src/prefixer.rs:2237-2258 | crates/swc_css_prefixer/src/prefixer.rs:2307-2328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_prefixer/src/prefixer.rs:2330` calls `get_old_values`, `or_else` and `crates/swc_css_prefixer/src/prefixer.rs:2260` 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 (22 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1574 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1574-1595 | crates/swc_ecma_parser/src/lexer/mod.rs:1811-1832 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_ecma_lexer/src/common/lexer/mod.rs:2064 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2064-2085 | crates/swc_ecma_parser/src/lexer/mod.rs:2274-2295 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:2064` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:623 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:623-644 | crates/swc_ecma_parser/src/parser/module_item.rs:750-771 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/module_item.rs` and `crates/swc_ecma_parser/src/parser/module_item.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:623` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (22 lines × 2) crates/swc_ecma_lexer/src/common/parser/object.rs:318 — crates/swc_ecma_lexer/src/common/parser/object.rs:318-339 | crates/swc_ecma_parser/src/parser/object.rs:407-428 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/object.rs` and `crates/swc_ecma_parser/src/parser/object.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/object.rs:318` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (22 lines × 2) crates/swc_ecma_lexer/src/common/parser/stmt.rs:854 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:854-875 | crates/swc_ecma_parser/src/parser/stmt.rs:973-994 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/stmt.rs:854` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:632 — crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:632-653 | crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:687-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:632` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) crates/swc_ecma_parser/src/parser/typescript.rs:5081 — crates/swc_ecma_parser/src/parser/typescript.rs:5081-5102 | crates/swc_ecma_parser/src/parser/typescript.rs:5263-5284 — both copies are in the same file, so extract the block into 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/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:140 — crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:140-161 | crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:209-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:165` calls `Ident` and `crates/swc_ecma_transformer/src/es2016/exponentiation_operator.rs:233` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (22 lines × 2) crates/swc_html_codegen/src/lib.rs:781 — crates/swc_html_codegen/src/lib.rs:781-802 | crates/swc_xml_codegen/src/lib.rs:205-226 — before extracting anything, compare `crates/swc_html_codegen/src/lib.rs` and `crates/swc_xml_codegen/src/lib.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_codegen/src/lib.rs:781` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) crates/swc_html_parser/src/parser/mod.rs:2323 — crates/swc_html_parser/src/parser/mod.rs:2323-2346 | crates/swc_html_parser/src/parser/mod.rs:4563-4584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2323` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:3120 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:3120-3141 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:3161-3182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:3120` 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.
D29 · Static Analysis (SAST) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×10
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_ast/src/stmt.rs:176 — crates/swc_ecma_ast/src/stmt.rs:176-201 | crates/swc_ecma_ast/src/typescript.rs:399-425 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_codegen/src/scope_helpers.rs:8 — crates/swc_ecma_codegen/src/scope_helpers.rs:8-33 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:1055-1090 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1816 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1816-1843 | crates/swc_ecma_parser/src/lexer/mod.rs:2040-2065 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_html_minifier/src/lib.rs:935 — crates/swc_html_minifier/src/lib.rs:935-966 | crates/swc_html_minifier/src/lib.rs:972-997 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:1069 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1069-1094 | crates/swc_ecma_parser/src/parser/expr.rs:1885-1910 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:77 — crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:77-103 | crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:105-130 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2218 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2218-2249 | crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs:293-318 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_transforms_module/src/module_record.rs:741 — crates/swc_ecma_transforms_module/src/module_record.rs:741-766 | crates/swc_ecma_transforms_module/src/module_record.rs:770-796 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:672 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:672-698 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:731-756 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:918 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:918-943 | crates/swc_ecma_parser/src/parser/stmt.rs:1037-1062 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×10
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_lints/src/rules/prefer_const.rs:167 — crates/swc_ecma_lints/src/rules/prefer_const.rs:167-188 | crates/swc_ecma_lints/src/rules/prefer_const.rs:242-273 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/util.rs:360 — crates/swc_ecma_minifier/src/compress/optimize/util.rs:360-386 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:403-424 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_html_parser/src/parser/mod.rs:136 — crates/swc_html_parser/src/parser/mod.rs:136-164 | crates/swc_xml_parser/src/parser/mod.rs:68-89 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_lexer/src/common/parser/mod.rs:411 — crates/swc_ecma_lexer/src/common/parser/mod.rs:411-432 | crates/swc_ecma_parser/src/parser/expr.rs:93-116 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs:411 — crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs:411-432 | crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs:434-455 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) REDACTED:3489 — REDACTED:3489-3510 | REDACTED:3517-3543 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1490 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1490-1511 | crates/swc_ecma_minifier/src/compress/pure/bools.rs:28-55 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:490 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:490-511 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:513-534 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_lexer/src/common/parser/mod.rs:434 — crates/swc_ecma_lexer/src/common/parser/mod.rs:434-455 | crates/swc_ecma_parser/src/parser/expr.rs:67-88 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/swc_ecma_transforms_module/src/module_record.rs:282 — crates/swc_ecma_transforms_module/src/module_record.rs:282-303 | crates/swc_ecma_transforms_module/src/module_record.rs:328-354 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×10
  • Edited copy of a member (16 corresponding lines) crates/swc_typescript/src/fast_dts/util/ast_ext.rs:83 — crates/swc_typescript/src/fast_dts/util/ast_ext.rs:83-98 | crates/swc_typescript/src/fast_dts/util/ast_ext.rs:100-115 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_transforms_typescript/src/transform.rs:424 — crates/swc_ecma_transforms_typescript/src/transform.rs:424-439 | crates/swc_ecma_transforms_typescript/src/transform.rs:441-463 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_parser/src/parser/expr.rs:738 — crates/swc_ecma_parser/src/parser/expr.rs:738-753 | crates/swc_ecma_parser/src/parser/expr.rs:930-945 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_transforms_typescript/src/transform.rs:663 — crates/swc_ecma_transforms_typescript/src/transform.rs:663-684 | crates/swc_ecma_utils/src/lib.rs:2766-2781 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:126 — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:126-141 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:143-158 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_css_codegen/src/lib.rs:2345 — crates/swc_css_codegen/src/lib.rs:2345-2360 | crates/swc_css_codegen/src/lib.rs:2428-2444 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:696 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:696-711 | crates/swc_ecma_parser/src/parser/stmt.rs:817-832 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2352 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2352-2367 | crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs:460-479 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:877 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:877-892 | crates/swc_ecma_parser/src/parser/stmt.rs:996-1011 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/swc_ecma_lints/src/rules/critical_rules.rs:104 — crates/swc_ecma_lints/src/rules/critical_rules.rs:104-120 | crates/swc_ecma_lints/src/rules/critical_rules.rs:122-137 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×10
  • Edited copy of a member (8 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1290 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1290-1298 | crates/swc_ecma_parser/src/lexer/mod.rs:1664-1671 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_ts_fast_strip/src/token_cursor.rs:32 — crates/swc_ts_fast_strip/src/token_cursor.rs:32-39 | crates/swc_ts_fast_strip/src/token_cursor.rs:68-75 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:407 — crates/swc_estree_compat/src/babelify/expr.rs:407-415 | crates/swc_estree_compat/src/babelify/expr.rs:437-444 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_ecma_lexer/src/common/parser/mod.rs:224 — crates/swc_ecma_lexer/src/common/parser/mod.rs:224-231 | crates/swc_ecma_parser/src/parser/mod.rs:1329-1336 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_ecma_preset_env/src/corejs3/builtin.rs:72 — crates/swc_ecma_preset_env/src/corejs3/builtin.rs:72-79 | crates/swc_ecma_preset_env/src/corejs3/builtin.rs:81-88 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_estree_compat/src/babelify/jsx.rs:109 — crates/swc_estree_compat/src/babelify/jsx.rs:109-117 | crates/swc_estree_compat/src/babelify/jsx.rs:210-217 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_ecma_parser/src/lexer/mod.rs:983 — crates/swc_ecma_parser/src/lexer/mod.rs:983-990 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:557-564 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_sourcemap/src/lazy/mod.rs:220 — crates/swc_sourcemap/src/lazy/mod.rs:220-229 | crates/swc_sourcemap/src/builder.rs:184-191 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:743 — crates/swc_estree_compat/src/babelify/expr.rs:743-750 | crates/swc_estree_compat/src/babelify/function.rs:102-109 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/swc_ecma_lints/src/rules/critical_rules.rs:387 — crates/swc_ecma_lints/src/rules/critical_rules.rs:387-394 | crates/swc_ecma_utils/src/lib.rs:2315-2323 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×10
  • Duplicated block (23 lines × 2) crates/swc_ecma_compat_es2015/src/block_scoping/vars.rs:320 — crates/swc_ecma_compat_es2015/src/block_scoping/vars.rs:320-342 | crates/swc_ecma_compat_es2015/src/block_scoping/vars.rs:345-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut ForInStmt` in one and `&mut ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (23 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2037 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2037-2059 | crates/swc_ecma_parser/src/lexer/mod.rs:2250-2272 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:2037` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:202 — crates/swc_ecma_lexer/src/common/parser/pat.rs:202-224 | crates/swc_ecma_parser/src/parser/pat.rs:347-369 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:202` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (23 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/iife.rs:460 — crates/swc_ecma_minifier/src/compress/optimize/iife.rs:460-482 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1230-1252 — before extracting anything, compare `crates/swc_ecma_minifier/src/compress/optimize/iife.rs` and `crates/swc_ecma_minifier/src/compress/optimize/unused.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/iife.rs:460` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn ignore_unused_args_of_iife(&mut` in one and `crate) fn ignore_unused_args_of_call(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (23 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2567 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2567-2589 | crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2732-2754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2567` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) crates/swc_ecma_transforms_module/src/amd.rs:386 — crates/swc_ecma_transforms_module/src/amd.rs:386-408 | crates/swc_ecma_transforms_module/src/common_js.rs:270-292 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/common_js.rs` as WHOLE FILES: this scan already matched 4 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 `crates/swc_ecma_transforms_module/src/amd.rs:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) crates/swc_ecma_transforms_module/src/amd.rs:532 — crates/swc_ecma_transforms_module/src/amd.rs:532-554 | crates/swc_ecma_transforms_module/src/umd.rs:278-300 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/umd.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (23 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1387 — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1387-1409 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1487-1509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1387` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `m` to `&mut Module` in one and `&mut Script` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (23 lines × 2) crates/swc_native_addon/src/platform/windows.rs:360 — crates/swc_native_addon/src/platform/windows.rs:360-382 | crates/swc_native_addon/src/platform/windows.rs:448-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.
  • Duplicated block (23 lines × 2) crates/swc_ecma_transforms_module/src/amd.rs:299 — crates/swc_ecma_transforms_module/src/amd.rs:299-321 | crates/swc_ecma_transforms_module/src/common_js.rs:201-223 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/common_js.rs` as WHOLE FILES: this scan already matched 4 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 `crates/swc_ecma_transforms_module/src/amd.rs:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×10
  • Duplicated block (19 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2762 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2762-2780 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2803-2821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2762` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/swc_ecma_lexer/src/common/parser/object.rs:359 — crates/swc_ecma_lexer/src/common/parser/object.rs:359-377 | crates/swc_ecma_parser/src/parser/object.rs:450-468 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/object.rs` and `crates/swc_ecma_parser/src/parser/object.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/object.rs:359` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/util.rs:365 — crates/swc_ecma_minifier/src/compress/optimize/util.rs:365-383 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:404-422 — both copies are in the same file, so extract the block into 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/swc_ecma_preset_env/src/corejs2/mod.rs:92 — crates/swc_ecma_preset_env/src/corejs2/mod.rs:92-110 | crates/swc_ecma_preset_env/src/corejs3/usage.rs:144-162 — before extracting anything, compare `crates/swc_ecma_preset_env/src/corejs2/mod.rs` and `crates/swc_ecma_preset_env/src/corejs3/usage.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. 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) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:340 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:340-358 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:406-424 — both copies are in the same file, so extract the 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 (19 lines × 2) crates/swc_ecma_transformer/src/common/statement_injector.rs:129 — crates/swc_ecma_transformer/src/common/statement_injector.rs:129-147 | crates/swc_ecma_transformer/src/common/statement_injector.rs:174-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/common/statement_injector.rs:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/swc_ecma_transformer/src/es2022/private_property_in_object.rs:549 — crates/swc_ecma_transformer/src/es2022/private_property_in_object.rs:549-567 | crates/swc_ecma_transformer/src/es2022/private_property_in_object.rs:574-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. 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) crates/swc_ecma_transforms_module/src/amd.rs:331 — crates/swc_ecma_transforms_module/src/amd.rs:331-349 | crates/swc_ecma_transforms_module/src/amd.rs:357-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_transforms_module/src/amd.rs:377` calls `take`, `as_call`, `span` and `crates/swc_ecma_transforms_module/src/amd.rs:350` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2566 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2566-2584 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2589-2607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2566` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs:873 — crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs:873-891 | crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs:896-914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×10
  • Duplicated block (18 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1231 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1231-1248 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1518-1535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:1231` 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 (18 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1646 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1646-1663 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:2184-2201 — both copies are in the same file, so extract the block into 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/swc_ecma_lexer/src/common/parser/stmt.rs:135 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:135-152 | crates/swc_ecma_parser/src/parser/stmt.rs:153-170 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/stmt.rs` and `crates/swc_ecma_parser/src/parser/stmt.rs` as WHOLE FILES: this scan already matched 8 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/stmt.rs:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:1439 — crates/swc_ecma_parser/src/parser/expr.rs:1439-1456 | crates/swc_ecma_parser/src/parser/expr.rs:1652-1669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:1439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:341 — crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:341-358 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:363-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:341` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1501 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1501-1518 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1530-1547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1501` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/swc_ecma_transforms_testing/src/lib.rs:930 — crates/swc_ecma_transforms_testing/src/lib.rs:930-947 | crates/swc_ecma_transforms_testing/src/lib.rs:967-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_testing/src/lib.rs:930` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/swc_error_reporters/src/diagnostic.rs:70 — crates/swc_error_reporters/src/diagnostic.rs:70-87 | crates/swc_error_reporters/src/diagnostic.rs:272-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) crates/swc_html_parser/src/error.rs:71 — crates/swc_html_parser/src/error.rs:71-88 | crates/swc_xml_parser/src/error.rs:63-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 (18 lines × 2) crates/swc_html_parser/src/parser/mod.rs:3797 — crates/swc_html_parser/src/parser/mod.rs:3797-3814 | crates/swc_html_parser/src/parser/mod.rs:4767-4784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:3797` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×10
  • Duplicated block (17 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:461 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:461-477 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1492-1508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:461` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) crates/swc_ecma_compat_bugfixes/src/async_arrows_in_class.rs:67 — crates/swc_ecma_compat_bugfixes/src/async_arrows_in_class.rs:67-83 | crates/swc_ecma_compat_bugfixes/src/async_arrows_in_class.rs:86-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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `stmts` to `Vec<ModuleItem>` in one and `Vec<Stmt>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1394 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1394-1410 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1527-1543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2353 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2353-2369 | crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2376-2392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut ForInStmt` in one and `&mut ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:1322 — crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:1322-1338 | crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:1404-1420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/evaluate.rs:1322` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:29 — crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:29-45 | crates/swc_ecma_transforms_proposal/src/export_default_from.rs:29-45 — before extracting anything, compare `crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs` and `crates/swc_ecma_transforms_proposal/src/export_default_from.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:29` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3478 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3478-3494 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3808-3824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/swc_ecma_transforms_react/src/jsx/mod.rs:709 — crates/swc_ecma_transforms_react/src/jsx/mod.rs:709-725 | crates/swc_ecma_transforms_react/src/jsx/mod.rs:1008-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_react/src/jsx/mod.rs:709` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/swc_html_codegen/src/lib.rs:950 — crates/swc_html_codegen/src/lib.rs:950-966 | crates/swc_html_codegen/src/lib.rs:1018-1034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_codegen/src/lib.rs:950` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/swc_sourcemap/src/decoder.rs:225 — crates/swc_sourcemap/src/decoder.rs:225-241 | crates/swc_sourcemap/src/lazy/mod.rs:422-438 — before extracting anything, compare `crates/swc_sourcemap/src/decoder.rs` and `crates/swc_sourcemap/src/lazy/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_sourcemap/src/decoder.rs:225` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_sourcemap/src/decoder.rs:223` calls `Err`, `BadNameReference` and `crates/swc_sourcemap/src/lazy/mod.rs:421` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×9
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:54 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:54-70 | crates/swc_ecma_parser/src/parser/stmt.rs:66-83 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:633 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:633-649 | crates/swc_ecma_parser/src/parser/typescript.rs:1435-1451 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:709 — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:709-725 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:843-861 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_minifier/src/pass/mangle_names/preserver.rs:145 — crates/swc_ecma_minifier/src/pass/mangle_names/preserver.rs:145-161 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:806-825 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ts_fast_strip/src/erase/declarations.rs:41 — crates/swc_ts_fast_strip/src/erase/declarations.rs:41-57 | crates/swc_ts_fast_strip/src/erase/declarations.rs:59-75 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:387 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:387-403 | crates/swc_ecma_parser/src/parser/typescript.rs:1101-1117 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_lints/src/rules/no_console.rs:51 — crates/swc_ecma_lints/src/rules/no_console.rs:51-69 | crates/swc_ecma_lints/src/rules/no_new_symbol.rs:41-57 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_transformer/src/es2020/mod.rs:33 — crates/swc_ecma_transformer/src/es2020/mod.rs:33-49 | crates/swc_ecma_transformer/src/es2022/mod.rs:29-45 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/swc_ecma_lints/src/rules/critical_rules.rs:455 — crates/swc_ecma_lints/src/rules/critical_rules.rs:455-471 | crates/swc_ecma_lints/src/rules/critical_rules.rs:473-489 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×9
  • Duplicated block (7 lines × 3) crates/swc_css_parser/src/parser/values_and_units/mod.rs:404 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:404-410 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:517-523 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:633-639 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:404` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/swc_html_parser/src/parser/mod.rs:4946 — crates/swc_html_parser/src/parser/mod.rs:4946-4952 | crates/swc_html_parser/src/parser/mod.rs:5010-5016 | crates/swc_html_parser/src/parser/mod.rs:5036-5042 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:4946` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:738 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:738-744 | bindings/binding_typescript_wasm/src/error_reporter.rs:738-744 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:738-744 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:805 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:805-811 | bindings/binding_typescript_wasm/src/error_reporter.rs:805-811 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:805-811 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:866 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:866-872 | bindings/binding_typescript_wasm/src/error_reporter.rs:866-872 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:866-872 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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) bindings/binding_nodejs_support_wasm/src/lib.rs:147 — bindings/binding_nodejs_support_wasm/src/lib.rs:147-153 | bindings/binding_typescript_wasm/src/lib.rs:69-75 | crates/swc_ts_fast_strip_binding/src/lib.rs:25-31 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/lib.rs` and `bindings/binding_typescript_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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) bindings/binding_nodejs_support_wasm/src/lib.rs:317 — bindings/binding_nodejs_support_wasm/src/lib.rs:317-323 | bindings/binding_typescript_wasm/src/lib.rs:239-245 | crates/swc_ts_fast_strip_binding/src/lib.rs:195-201 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/lib.rs` and `bindings/binding_typescript_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_css_codegen/src/writer/basic.rs:96 — crates/swc_css_codegen/src/writer/basic.rs:96-102 | crates/swc_html_codegen/src/writer/basic.rs:96-102 | crates/swc_xml_codegen/src/writer/basic.rs:96-102 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_css_minifier/src/compressor/calc_sum.rs:527 — crates/swc_css_minifier/src/compressor/calc_sum.rs:527-533 | crates/swc_css_minifier/src/compressor/calc_sum.rs:543-549 | crates/swc_css_minifier/src/compressor/calc_sum.rs:591-597 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_minifier/src/compressor/calc_sum.rs:527` 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.
D10 · Test Quality · Skipped test · ×8
  • Skipped test: should re-throw errors from the task synchronously crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:149 — Skipped — switched off by it.skip
  • Skipped test: should re-throw errors from microtasks synchronously crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:159 — Skipped — switched off by it.skip
  • Skipped test: should not run subsequent tasks after an error in a task crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:171 — Skipped — switched off by it.skip
  • Skipped test: should not run subsequent tasks after an error in a microtask crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:188 — Skipped — switched off by it.skip
  • Skipped test: should not run subsequent microtasks after an error in a task crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:207 — Skipped — switched off by it.skip
  • Skipped test: should not run subsequent microtasks after an error in a microtask crates/swc/tests/flow-projects/react-native/corpus/private/react-native-fantom/src/__tests__/Fantom-itest.js:225 — Skipped — switched off by it.skip
  • Skipped test: provides the same performance entry references from mark/measure to all observers crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/webapis/performance/__tests__/PerformanceObserver-itest.js:67 — Skipped — switched off by it.skip
  • Skipped test: happens when commiting from the UI thread (bug) crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/renderer/mounting/__tests__/MountingIntermediateCommits-itest.js:72 — Skipped — switched off by it.skip
D15 · Churn × Complexity Hotspots · Repeated repair · ×8
  • Repeated repair: crates/swc_native_addon/src/platform/windows.rs crates/swc_native_addon/src/platform/windows.rs:303 — crates/swc_native_addon/src/platform/windows.rs 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 10 (its worst body is swc_native_addon::platform::windows::validate_ancestor_dacl at line 303), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(node): Restrict cache DELETE exemption to filesystem roots (#12610)”; “fix(node): Allow DELETE grants on native cache volume roots (#12609)”; “fix(native-addon): use ProgramData after unsafe Windows profile caches (#12534)”; “fix(bindings): fall back to a safe cache root on Unix (#12500)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_native_addon/src/platform/windows.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/swc_native_addon/src/platform/unix.rs crates/swc_native_addon/src/platform/unix.rs:81 — crates/swc_native_addon/src/platform/unix.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is swc_native_addon::platform::unix::secure_cache_root at line 81), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(native): Allow unmapped overflow owners in Linux cache ancestors (#12547)”; “fix(bindings): fall back to a safe cache root on Unix (#12500)”; “fix(bindings): allow opting out of Unix cache root security checks (#12469)”; “fix(node): Repair native release verification and cache handling (#12415)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_native_addon/src/platform/unix.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/swc_ecma_parser/src/parser/mod.rs crates/swc_ecma_parser/src/parser/mod.rs:1234 — crates/swc_ecma_parser/src/parser/mod.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 14 (its worst body is Parser::collect_exported_names at line 1234), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(es/parser): isolate enum await context (#12506)”; “fix(es/parser): allow escaped keywords as property names (#12358)”; “fix(es/parser): Preserve await grammar boundaries (#12156)”; “fix(es/parser): Retry ambiguous Program parsing (#12142)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/parser/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/swc_ecma_parser/src/error.rs crates/swc_ecma_parser/src/error.rs:784 — crates/swc_ecma_parser/src/error.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 4 (its worst body is Error::into_diagnostic at line 784), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(es/parser): align TypeScript expression lookahead (#12535)”; “fix(es/parser): recognize named optional and rest tuple elements (#12368)”; “fix(es/parser): Accept valid declare readonly field initializers (#12363)”; “fix(es/parser): reject unicode escapes in RegExp flags (#12093)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_parser/src/error.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/swc_native_addon/src/cache.rs crates/swc_native_addon/src/cache.rs:266 — crates/swc_native_addon/src/cache.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 14 (its worst body is swc_native_addon::cache::prune at line 266), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(native-addon): use ProgramData after unsafe Windows profile caches (#12534)”; “fix(bindings): fall back to a safe cache root on Unix (#12500)”; “fix(bindings): fall back to a secure Windows profile cache (#12452)”; “fix(node): Repair native release verification and cache handling (#12415)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_native_addon/src/cache.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/swc_ecma_minifier/src/metadata/mod.rs crates/swc_ecma_minifier/src/metadata/mod.rs:100 — crates/swc_ecma_minifier/src/metadata/mod.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 11 (its worst body is InfoMarker::visit_mut_call_expr at line 100), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “revert(es/minifier): Revert #12384 (#12419)”; “fix(es/minifier): preserve pure annotation ownership (#12180)”; “fix(es/minifier): preserve effects of returned value calls (#12140)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_minifier/src/metadata/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/swc_cli_impl/src/commands/compile.rs crates/swc_cli_impl/src/commands/compile.rs:959 — crates/swc_cli_impl/src/commands/compile.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is CompileOptions::process_out_dir_watch_batch at line 959), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): Emit `.d.mts` and `.d.cts` declarations for `.mjs` and `.cjs` outputs (#12729)”; “fix(deps): update cargo (major) (#12460)”; “fix(cli): resolve out-dir source map paths relative to output (#12481)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_cli_impl/src/commands/compile.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/swc_ecma_codegen/src/typescript.rs crates/swc_ecma_codegen/src/typescript.rs:509 — crates/swc_ecma_codegen/src/typescript.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is TsKeywordType::emit at line 509), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(es/codegen): preserve TypeScript token boundaries (#12523)”; “fix(es/codegen): disambiguate TSX generic arrows (#12505)”; “fix(es/codegen): separate generic type assertion openers (#12340)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 15:42:59 +09:00' --until='2026-11-14 15:42:59 +09:00' --full-history --no-merges -- crates/swc_ecma_codegen/src/typescript.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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×8
  • Duplicated block (24 lines × 2) bindings/binding_core_node/src/util.rs:42 — bindings/binding_core_node/src/util.rs:42-65 | bindings/binding_minifier_node/src/util.rs:35-58 — before extracting anything, compare `bindings/binding_core_node/src/util.rs` and `bindings/binding_minifier_node/src/util.rs` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_core_node/src/util.rs:42` 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 (24 lines × 2) crates/ast_node/src/enum_deserialize.rs:55 — crates/ast_node/src/enum_deserialize.rs:55-78 | crates/ast_node/src/enum_deserialize.rs:125-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 (24 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1772 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1772-1795 | crates/swc_ecma_parser/src/lexer/mod.rs:1997-2020 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1772` 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 (24 lines × 2) crates/swc_html_codegen/src/writer/basic.rs:198 — crates/swc_html_codegen/src/writer/basic.rs:198-221 | crates/swc_xml_codegen/src/writer/basic.rs:198-221 — before extracting anything, compare `crates/swc_html_codegen/src/writer/basic.rs` and `crates/swc_xml_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) crates/swc_html_parser/src/lexer/mod.rs:1942 — crates/swc_html_parser/src/lexer/mod.rs:1942-1965 | crates/swc_html_parser/src/lexer/mod.rs:1990-2013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:1942` 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 (24 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:2990 — crates/swc_html_parser/src/lexer/mod.rs:2990-3013 | crates/swc_xml_parser/src/lexer/mod.rs:1309-1332 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2990` 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 (24 lines × 2) crates/swc_html_parser/src/parser/mod.rs:2943 — crates/swc_html_parser/src/parser/mod.rs:2943-2966 | crates/swc_html_parser/src/parser/mod.rs:3063-3086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2943` it begins part-way through the construct above it, so those exact lines 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/swc_css_prefixer/src/prefixer.rs:2258 — crates/swc_css_prefixer/src/prefixer.rs:2258-2281 | crates/swc_css_prefixer/src/prefixer.rs:2332-2355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:2258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_css_prefixer/src/prefixer.rs:2330` calls `get_old_values`, `or_else` and `crates/swc_css_prefixer/src/prefixer.rs:2257` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×8
  • Duplicated block (21 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1472 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1472-1492 | crates/swc_ecma_parser/src/lexer/mod.rs:1713-1733 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1472` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:1940 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1940-1960 | crates/swc_ecma_parser/src/parser/expr.rs:2638-2658 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:1940` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1572 — crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1572-1592 | crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1607-1627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:830 — crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:830-850 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:1016-1036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:830` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:1156 — crates/swc_html_parser/src/lexer/mod.rs:1156-1176 | crates/swc_xml_parser/src/lexer/mod.rs:1035-1055 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:1902 — crates/swc_html_parser/src/lexer/mod.rs:1902-1922 | crates/swc_html_parser/src/lexer/mod.rs:2215-2235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:1902` 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 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3305 — crates/swc_html_parser/src/lexer/mod.rs:3305-3325 | crates/swc_xml_parser/src/lexer/mod.rs:1603-1623 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3305` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) crates/swc_sourcemap/src/encoder.rs:83 — crates/swc_sourcemap/src/encoder.rs:83-103 | crates/swc_sourcemap/src/lazy/mod.rs:627-647 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_sourcemap/src/encoder.rs:83` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×7
  • Duplicated block (10 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:791 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:791-800 | bindings/binding_typescript_wasm/src/error_reporter.rs:791-800 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:791-800 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) crates/swc_common/src/syntax_pos/hygiene.rs:202 — crates/swc_common/src/syntax_pos/hygiene.rs:202-211 | crates/swc_common/src/syntax_pos/hygiene.rs:250-259 | crates/swc_common/src/syntax_pos/hygiene.rs:424-433 — all 3 copies are in the same file, so extract the block into one function there and call it from 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/swc_css_parser/src/lexer/mod.rs:260 — crates/swc_css_parser/src/lexer/mod.rs:260-269 | crates/swc_css_parser/src/lexer/mod.rs:519-528 | crates/swc_css_parser/src/lexer/mod.rs:572-581 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/lexer/mod.rs:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_css_parser/src/lexer/mod.rs:569` calls `last_pos` and `crates/swc_css_parser/src/lexer/mod.rs:516` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) crates/swc_html_parser/src/parser/mod.rs:2026 — crates/swc_html_parser/src/parser/mod.rs:2026-2035 | crates/swc_html_parser/src/parser/mod.rs:6217-6226 | crates/swc_html_parser/src/parser/mod.rs:6488-6497 — all 3 copies are in the same file, so extract the block into one function there and call it from 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/swc_css_codegen/src/writer/basic.rs:188 — crates/swc_css_codegen/src/writer/basic.rs:188-197 | crates/swc_html_codegen/src/writer/basic.rs:186-195 | crates/swc_xml_codegen/src/writer/basic.rs:186-195 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_bundler/src/bundler/chunk/merge.rs:798 — crates/swc_bundler/src/bundler/chunk/merge.rs:798-807 | crates/swc_bundler/src/bundler/chunk/merge.rs:849-859 | crates/swc_bundler/src/bundler/chunk/merge.rs:976-985 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/chunk/merge.rs:798` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/swc_xml_parser/src/lexer/mod.rs:342 — crates/swc_xml_parser/src/lexer/mod.rs:342-351 | crates/swc_xml_parser/src/lexer/mod.rs:357-366 | crates/swc_xml_parser/src/lexer/mod.rs:422-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.
D17 · Explicit Debt · HackComment · ×6
  • HackComment crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1829 — // Hack for lifetime of mutable borrow — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment crates/swc_common/src/syntax_pos.rs:172 — /// Hack in src/libsyntax/parse.rs — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment crates/swc_bundler/tests/common/mod.rs:104 — // Hack for jszip, which depends on invalid url. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment crates/swc/benches/assets/Observable.ts:43 — // HACK: Since TypeScript inherits static properties too, we have to — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment bindings/binding_minifier_node/src/lib.rs:26 — /// Hack for `Type Generation` — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment bindings/binding_core_node/src/lib.rs:72 — /// Hack for `Type Generation` — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×6
  • Edited copy of a member (35 corresponding lines) crates/swc_ecma_lints/src/rules/no_loop_func.rs:91 — crates/swc_ecma_lints/src/rules/no_loop_func.rs:91-131 | crates/swc_ecma_lints/src/rules/no_use_before_define.rs:147-181 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:2518 — crates/swc_ecma_lexer/src/common/parser/expr.rs:2518-2556 | crates/swc_ecma_parser/src/parser/expr.rs:3343-3377 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:583 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:583-630 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:745-779 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/swc_ecma_lexer/src/lexer/mod.rs:172 — crates/swc_ecma_lexer/src/lexer/mod.rs:172-214 | crates/swc_ecma_parser/src/lexer/mod.rs:359-393 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/misc.rs:1621 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:1621-1659 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:1665-1699 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2178 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2178-2219 | crates/swc_ecma_parser/src/lexer/mod.rs:2356-2390 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×6
  • Edited copy of a member (30 corresponding lines) crates/swc_ecma_codegen/src/lib.rs:1623 — crates/swc_ecma_codegen/src/lib.rs:1623-1652 | crates/swc_ecma_codegen/src/lib.rs:1658-1687 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1830 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1830-1859 | crates/swc_ecma_parser/src/parser/typescript.rs:3804-3834 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1630 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1630-1659 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2003-2033 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:934 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:934-963 | crates/swc_ecma_parser/src/lexer/mod.rs:1341-1375 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/swc_ecma_lints/src/rules/no_alert.rs:132 — crates/swc_ecma_lints/src/rules/no_alert.rs:132-161 | crates/swc_ecma_lints/src/rules/radix.rs:200-229 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/swc_html_parser/src/parser/open_elements_stack.rs:169 — crates/swc_html_parser/src/parser/open_elements_stack.rs:169-200 | crates/swc_html_parser/src/parser/open_elements_stack.rs:297-326 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×6
  • Edited copy of a member (25 corresponding lines) crates/swc_ecma_lexer/src/common/parser/jsx.rs:97 — crates/swc_ecma_lexer/src/common/parser/jsx.rs:97-121 | crates/swc_ecma_parser/src/parser/jsx.rs:119-144 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/swc_ecma_lexer/src/common/parser/object.rs:27 — crates/swc_ecma_lexer/src/common/parser/object.rs:27-51 | crates/swc_ecma_parser/src/parser/object.rs:25-49 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1154 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1154-1185 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1198-1222 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:50 — crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:50-75 | crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:77-101 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:235 — crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:235-260 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:310-334 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:89 — crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:89-113 | crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:126-154 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×6
  • Edited copy of a member (20 corresponding lines) crates/swc_estree_compat/src/swcify/expr.rs:303 — crates/swc_estree_compat/src/swcify/expr.rs:303-322 | crates/swc_estree_compat/src/swcify/expr.rs:518-537 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/swc_ecma_ast/src/prop.rs:130 — crates/swc_ecma_ast/src/prop.rs:130-149 | crates/swc_ecma_utils/src/lib.rs:1554-1573 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:128 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:128-149 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:130-149 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/swc_ecma_compat_es2015/src/parameters.rs:76 — crates/swc_ecma_compat_es2015/src/parameters.rs:76-95 | crates/swc_ecma_compat_es2015/src/parameters.rs:734-753 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:234 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:234-254 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:274-293 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:540 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:540-559 | crates/swc_ecma_parser/src/parser/typescript.rs:1348-1367 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×6
  • Edited copy of a member (6 corresponding lines) crates/swc_sourcemap/src/decoder.rs:330 — crates/swc_sourcemap/src/decoder.rs:330-335 | crates/swc_sourcemap/src/detector.rs:110-115 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:283 — crates/swc_estree_compat/src/babelify/expr.rs:283-288 | crates/swc_estree_compat/src/babelify/typescript.rs:1069-1075 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:264 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:264-269 | crates/swc_ecma_parser/src/parser/typescript.rs:957-962 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/swc_css_parser/src/lexer/mod.rs:69 — crates/swc_css_parser/src/lexer/mod.rs:69-76 | crates/swc_html_parser/src/lexer/mod.rs:568-573 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/swc_css_parser/src/lexer/mod.rs:81 — crates/swc_css_parser/src/lexer/mod.rs:81-88 | crates/swc_html_parser/src/lexer/mod.rs:998-1003 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/swc_ecma_transforms_react/src/jsx/mod.rs:265 — crates/swc_ecma_transforms_react/src/jsx/mod.rs:265-273 | crates/swc_ecma_transforms_react/src/lib.rs:59-64 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×6
  • Duplicated block (29 lines × 2) bindings/binding_html_node/src/lib.rs:240 — bindings/binding_html_node/src/lib.rs:240-268 | bindings/binding_html_wasm/src/lib.rs:284-312 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/swc_css_compat/src/compiler/custom_media.rs:109 — crates/swc_css_compat/src/compiler/custom_media.rs:109-137 | crates/swc_css_compat/src/compiler/custom_media.rs:185-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_compat/src/compiler/custom_media.rs:109` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `media_condition` to `&mut MediaCondition` in one and `&mut MediaConditionWithoutOr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (29 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1035 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1035-1063 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1198-1226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:1035` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:368 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:368-396 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:430-458 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:368` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1338 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1338-1366 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1659-1687 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1338` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) bindings/binding_html_node/src/tag_omission.rs:17 — bindings/binding_html_node/src/tag_omission.rs:17-45 | bindings/binding_html_wasm/src/tag_omission.rs:17-45 — before extracting anything, compare `bindings/binding_html_node/src/tag_omission.rs` and `bindings/binding_html_wasm/src/tag_omission.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_html_node/src/tag_omission.rs:17` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×6
  • Duplicated block (25 lines × 2) crates/swc_ecma_codegen/src/lib.rs:1628 — crates/swc_ecma_codegen/src/lib.rs:1628-1652 | crates/swc_ecma_codegen/src/lib.rs:1663-1687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_codegen/src/lib.rs:1628` 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 (25 lines × 2) crates/swc_ecma_compat_es2015/src/classes/mod.rs:134 — crates/swc_ecma_compat_es2015/src/classes/mod.rs:134-158 | crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:342-366 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/classes/mod.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:854 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:854-878 | crates/swc_ecma_parser/src/lexer/mod.rs:1263-1287 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:854` 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 (25 lines × 2) crates/swc_ecma_lexer/src/common/parser/util.rs:50 — crates/swc_ecma_lexer/src/common/parser/util.rs:50-74 | crates/swc_ecma_parser/src/parser/jsx.rs:521-545 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:355 — crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:355-379 | crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:423-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:355` 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 (25 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:698 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:698-722 | crates/swc_ecma_parser/src/lexer/mod.rs:1127-1151 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:698` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×6
  • Duplicated block (15 lines × 3) bindings/binding_html_node/src/lib.rs:182 — bindings/binding_html_node/src/lib.rs:182-196 | bindings/binding_html_wasm/src/lib.rs:244-258 | crates/swc_html_minifier/src/option.rs:224-238 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (15 lines × 3) crates/swc_css_codegen/src/writer/basic.rs:172 — crates/swc_css_codegen/src/writer/basic.rs:172-186 | crates/swc_html_codegen/src/writer/basic.rs:170-184 | crates/swc_xml_codegen/src/writer/basic.rs:170-184 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (15 lines × 3) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1391 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1391-1405 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1469-1483 | crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1524-1538 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1391` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) crates/swc_ecma_transforms_module/src/amd.rs:474 — crates/swc_ecma_transforms_module/src/amd.rs:474-488 | crates/swc_ecma_transforms_module/src/common_js.rs:373-387 | crates/swc_ecma_transforms_module/src/umd.rs:220-234 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/common_js.rs` as WHOLE FILES: this scan already matched 4 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 `crates/swc_ecma_transforms_module/src/amd.rs:474` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) crates/swc_xml_parser/src/lexer/mod.rs:569 — crates/swc_xml_parser/src/lexer/mod.rs:569-583 | crates/swc_xml_parser/src/lexer/mod.rs:891-905 | crates/swc_xml_parser/src/lexer/mod.rs:958-972 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_xml_parser/src/lexer/mod.rs:907` calls `push` and `crates/swc_xml_parser/src/lexer/mod.rs:585` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) crates/swc_xml_parser/src/lexer/mod.rs:2100 — crates/swc_xml_parser/src/lexer/mod.rs:2100-2114 | crates/swc_xml_parser/src/lexer/mod.rs:2140-2154 | crates/swc_xml_parser/src/lexer/mod.rs:2181-2195 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:2100` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:508 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:508-519 | bindings/binding_typescript_wasm/src/error_reporter.rs:508-519 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:508-519 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 3) crates/swc_css_parser/src/parser/values_and_units/mod.rs:765 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:765-776 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1242-1253 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1529-1540 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:765` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:704 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:704-715 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1200-1211 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1290-1301 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&ClassMethod` in one and `&MethodProp` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 3) crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:249 — crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:249-260 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:350-361 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:372-383 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/swc_css_prefixer/src/prefixer.rs:3007 — crates/swc_css_prefixer/src/prefixer.rs:3007-3018 | crates/swc_css_prefixer/src/prefixer.rs:3029-3040 | crates/swc_css_prefixer/src/prefixer.rs:3051-3062 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:3007` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/swc_css_prefixer/src/prefixer.rs:925 — crates/swc_css_prefixer/src/prefixer.rs:925-936 | crates/swc_css_prefixer/src/prefixer.rs:958-969 | crates/swc_css_prefixer/src/prefixer.rs:974-985 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:925` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×6
  • Duplicated block (10–11 lines × 2) crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs:150 — crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs:150-160 | crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs:162-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:491 — crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:491-501 | crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:543-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:491` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&mut ForInStmt` in one and `&mut ForStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10–11 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:543 — crates/swc_ecma_lexer/src/common/parser/expr.rs:543-552 | crates/swc_ecma_lexer/src/common/parser/expr.rs:1925-1935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:543` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) crates/swc_ecma_lexer/src/parser/mod.rs:148 — crates/swc_ecma_lexer/src/parser/mod.rs:148-158 | crates/swc_ecma_lexer/src/parser/mod.rs:170-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_lexer/src/parser/mod.rs:181` calls `input`, `cur`, `input_mut` and `crates/swc_ecma_lexer/src/parser/mod.rs:160` 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–11 lines × 2) crates/swc_ecma_minifier/src/compress/pure/mod.rs:170 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:170-179 | crates/swc_ecma_minifier/src/compress/pure/mod.rs:420-430 — both copies are in the same file, so extract the block into 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/swc_ecma_transformer/src/es2015/typeof_symbol.rs:52 — crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:52-62 | crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:79-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×5
  • Edited copy of a member (18 corresponding lines) crates/swc_ecma_lexer/src/common/parser/module_item.rs:67 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:67-89 | crates/swc_ecma_lexer/src/common/parser/module_item.rs:760-949 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2457 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2457-2474 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2481-2498 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:567 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:567-587 | crates/swc_ecma_parser/src/parser/typescript.rs:1375-1392 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:27 — crates/swc_ecma_lexer/src/common/parser/pat.rs:27-44 | crates/swc_ecma_parser/src/parser/pat.rs:33-50 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/loops.rs:10 — crates/swc_ecma_minifier/src/compress/pure/loops.rs:10-28 | crates/swc_ecma_minifier/src/compress/pure/loops.rs:30-47 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/swc_plugin_runner/src/imported_fn/hygiene.rs:34 — crates/swc_plugin_runner/src/imported_fn/hygiene.rs:34-49 | crates/swc_plugin_runner/src/imported_fn/hygiene.rs:58-70 | crates/swc_plugin_runner/src/imported_fn/hygiene.rs:85-99 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/swc_ecma_transforms_module/src/rewriter/import_rewriter_swc.rs:45 — crates/swc_ecma_transforms_module/src/rewriter/import_rewriter_swc.rs:45-60 | crates/swc_ecma_transforms_module/src/rewriter/import_rewriter_swc.rs:62-76 | crates/swc_ecma_transforms_module/src/rewriter/import_rewriter_swc.rs:78-90 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/swc_plugin_runner/src/imported_fn/source_map.rs:171 — crates/swc_plugin_runner/src/imported_fn/source_map.rs:171-183 | crates/swc_plugin_runner/src/imported_fn/source_map.rs:192-204 | crates/swc_plugin_runner/src/imported_fn/source_map.rs:213-226 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/swc_ecma_parser/src/syntax.rs:28 — crates/swc_ecma_parser/src/syntax.rs:28-40 | crates/swc_ecma_parser/src/syntax.rs:64-79 | crates/swc_ecma_parser/src/syntax.rs:81-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/swc_ecma_transforms_base/src/resolver/mod.rs:1550 — crates/swc_ecma_transforms_base/src/resolver/mod.rs:1550-1566 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1607-1621 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1637-1649 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×5
  • Duplicated block (31 lines × 2) crates/swc_html_minifier/src/lib.rs:1391 — crates/swc_html_minifier/src/lib.rs:1391-1421 | crates/swc_html_minifier/src/lib.rs:1519-1549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_minifier/src/lib.rs:1391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (31 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3659 — crates/swc_html_parser/src/lexer/mod.rs:3659-3689 | crates/swc_xml_parser/src/lexer/mod.rs:2517-2547 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3659` 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 (31 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:4045 — crates/swc_html_parser/src/lexer/mod.rs:4045-4075 | crates/swc_xml_parser/src/lexer/mod.rs:2581-2611 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:4045` 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 (31 lines × 2) crates/swc_html_parser/src/parser/mod.rs:532 — crates/swc_html_parser/src/parser/mod.rs:532-562 | crates/swc_xml_parser/src/parser/mod.rs:200-230 — before extracting anything, compare `crates/swc_html_parser/src/parser/mod.rs` and `crates/swc_xml_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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 lines × 2) crates/swc_html_parser/src/parser/mod.rs:8390 — crates/swc_html_parser/src/parser/mod.rs:8390-8420 | crates/swc_html_parser/src/parser/mod.rs:8427-8457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:8390` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×5
  • Duplicated block (28 lines × 2) bindings/binding_html_node/src/util.rs:9 — bindings/binding_html_node/src/util.rs:9-36 | bindings/binding_html_wasm/src/util.rs:9-36 — before extracting anything, compare `bindings/binding_html_node/src/util.rs` and `bindings/binding_html_wasm/src/util.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (28 lines × 2) crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:203 — crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:203-230 | crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:483-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `e` to `&mut Expr` in one and `&mut SimpleAssignTarget` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (28 lines × 2) crates/swc_ecma_lexer/src/common/parser/module_item.rs:280 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:280-307 | crates/swc_ecma_parser/src/parser/module_item.rs:313-340 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/module_item.rs` and `crates/swc_ecma_parser/src/parser/module_item.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/module_item.rs:280` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (28 lines × 2) crates/swc_ecma_parser/src/parser/typescript.rs:5147 — crates/swc_ecma_parser/src/parser/typescript.rs:5147-5174 | crates/swc_ecma_parser/src/parser/typescript.rs:5304-5331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3554 — crates/swc_html_parser/src/lexer/mod.rs:3554-3581 | crates/swc_html_parser/src/lexer/mod.rs:4295-4322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3554` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:3551` calls `cur_pos` and `crates/swc_html_parser/src/lexer/mod.rs:4293` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×5
  • Duplicated block (27 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:1979 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1979-2005 | crates/swc_ecma_parser/src/parser/expr.rs:2718-2744 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:1979` 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 (27 lines × 2) crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:100 — crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:100-126 | crates/swc_ecma_transforms_proposal/src/export_default_from.rs:87-113 — before extracting anything, compare `crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs` and `crates/swc_ecma_transforms_proposal/src/export_default_from.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3229 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3229-3255 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3547-3573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3229` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` to `&mut ClassProp` in one and `&mut PrivateProp` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (27 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:4114 — crates/swc_html_parser/src/lexer/mod.rs:4114-4140 | crates/swc_xml_parser/src/lexer/mod.rs:2643-2669 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:4114` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:4141` calls `set_doctype_token_force_quirks` and `crates/swc_xml_parser/src/lexer/mod.rs:2670` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (27 lines × 2) crates/swc_html_parser/src/parser/mod.rs:2626 — crates/swc_html_parser/src/parser/mod.rs:2626-2652 | crates/swc_html_parser/src/parser/mod.rs:2688-2714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2626` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×5
  • Duplicated block (20 lines × 2) crates/swc_ecma_lexer/src/common/lexer/search.rs:16 — crates/swc_ecma_lexer/src/common/lexer/search.rs:16-35 | crates/swc_ecma_parser/src/lexer/search.rs:16-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1313 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1313-1332 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1631-1650 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs` and `crates/swc_ecma_parser/src/parser/class_and_fn.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1313` 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 (20 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:989 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:989-1008 | crates/swc_ecma_parser/src/parser/typescript.rs:2206-2225 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:989` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1272 — crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1272-1291 | crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1293-1312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1466 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1466-1485 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:2231-2250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1466` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×5
  • Duplicated block (14 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:673 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:673-686 | bindings/binding_typescript_wasm/src/error_reporter.rs:673-686 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:673-686 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 3) crates/swc_css_codegen/src/lib.rs:2503 — crates/swc_css_codegen/src/lib.rs:2503-2516 | crates/swc_html_codegen/src/lib.rs:899-912 | crates/swc_xml_codegen/src/lib.rs:305-318 — before extracting anything, compare `crates/swc_html_codegen/src/lib.rs` and `crates/swc_xml_codegen/src/lib.rs` as WHOLE FILES: this scan already matched 7 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 (14 lines × 3) crates/swc_ecma_parser/src/parser/class_and_fn.rs:1712 — crates/swc_ecma_parser/src/parser/class_and_fn.rs:1712-1725 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1792-1805 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1845-1858 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/class_and_fn.rs:1712` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) crates/swc_html_parser/src/lexer/mod.rs:3998 — crates/swc_html_parser/src/lexer/mod.rs:3998-4011 | crates/swc_html_parser/src/lexer/mod.rs:4120-4133 | crates/swc_xml_parser/src/lexer/mod.rs:2649-2662 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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/swc_xml_parser/src/lexer/mod.rs:2677 — crates/swc_xml_parser/src/lexer/mod.rs:2677-2690 | crates/swc_xml_parser/src/lexer/mod.rs:2733-2746 | crates/swc_xml_parser/src/lexer/mod.rs:2919-2932 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:2677` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) crates/swc_bundler/src/bundler/chunk/merge.rs:631 — crates/swc_bundler/src/bundler/chunk/merge.rs:631-643 | crates/swc_bundler/src/bundler/chunk/merge.rs:1301-1312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/chunk/merge.rs:631` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:634 — crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:634-645 | crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:649-661 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:634` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) crates/swc_ecma_regexp_ast/src/display.rs:34 — crates/swc_ecma_regexp_ast/src/display.rs:34-46 | crates/swc_ecma_regexp_ast/src/display.rs:198-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp_ast/src/display.rs:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) crates/swc_typescript/src/fast_dts/mod.rs:392 — crates/swc_typescript/src/fast_dts/mod.rs:392-404 | crates/swc_typescript/src/fast_dts/mod.rs:434-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_typescript/src/fast_dts/mod.rs:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) crates/swc_html_minifier/src/lib.rs:1636 — crates/swc_html_minifier/src/lib.rs:1636-1647 | crates/swc_html_minifier/src/lib.rs:1657-1669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_minifier/src/lib.rs:1636` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) crates/swc_ecma_lints/src/rules/critical_rules.rs:503 — crates/swc_ecma_lints/src/rules/critical_rules.rs:503-513 | crates/swc_ecma_lints/src/rules/critical_rules.rs:519-529 | crates/swc_ecma_lints/src/rules/critical_rules.rs:535-545 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lints/src/rules/critical_rules.rs:503` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `s` to `&ImportDefaultSpecifier` in one and `&ImportNamedSpecifier` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 3) crates/swc_ecma_minifier/src/compress/optimize/iife.rs:456 — crates/swc_ecma_minifier/src/compress/optimize/iife.rs:456-466 | crates/swc_ecma_minifier/src/compress/optimize/iife.rs:691-701 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1226-1236 — before extracting anything, compare `crates/swc_ecma_minifier/src/compress/optimize/iife.rs` and `crates/swc_ecma_minifier/src/compress/optimize/unused.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/iife.rs:456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `e` to `&mut CallExpr` in one and `&mut Expr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 3) crates/swc_ecma_minifier/src/compress/optimize/util.rs:515 — crates/swc_ecma_minifier/src/compress/optimize/util.rs:515-525 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:778-788 | crates/swc_ecma_minifier/src/compress/optimize/util.rs:871-881 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/util.rs:515` 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 (11 lines × 3) crates/swc_ecma_transforms_module/src/amd.rs:563 — crates/swc_ecma_transforms_module/src/amd.rs:563-573 | crates/swc_ecma_transforms_module/src/common_js.rs:459-469 | crates/swc_ecma_transforms_module/src/umd.rs:309-319 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/common_js.rs` as WHOLE FILES: this scan already matched 4 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 3) crates/swc_ecma_lexer/src/common/parser/module_item.rs:76 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:76-86 | crates/swc_ecma_lexer/src/common/parser/module_item.rs:800-810 | crates/swc_ecma_lexer/src/common/parser/module_item.rs:926-936 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×5
  • Duplicated block (9–10 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1437 — crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1437-1445 | crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1512-1521 — 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/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:255 — crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:255-263 | crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:409-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.rs:255` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `e` to `&BinExpr` in one and `&UnaryExpr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9–10 lines × 2) crates/swc_ecma_parser/src/parser/pat.rs:545 — crates/swc_ecma_parser/src/parser/pat.rs:545-554 | crates/swc_ecma_parser/src/parser/pat.rs:764-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `crate) fn parse_formal_param_pat(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_parser/src/parser/pat.rs:556` calls `Ok` and `crates/swc_ecma_parser/src/parser/pat.rs:774` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–10 lines × 2) crates/swc_ecma_transforms_module/src/module_record.rs:294 — crates/swc_ecma_transforms_module/src/module_record.rs:294-303 | crates/swc_ecma_transforms_module/src/module_record.rs:341-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_module/src/module_record.rs:294` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_transforms_module/src/module_record.rs:340` calls `Some` and `crates/swc_ecma_transforms_module/src/module_record.rs:292` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–10 lines × 2) crates/swc_ecma_parser/src/lexer/state.rs:265 — crates/swc_ecma_parser/src/lexer/state.rs:265-274 | crates/swc_ecma_parser/src/lexer/state.rs:284-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/lexer/state.rs:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:70 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:70-75 | bindings/binding_typescript_wasm/src/error_reporter.rs:70-75 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:70-75 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `bindings/binding_nodejs_support_wasm/src/error_reporter.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/swc_css_codegen_macros/src/lib.rs:12 — crates/swc_css_codegen_macros/src/lib.rs:12-17 | crates/swc_html_codegen_macros/src/lib.rs:12-17 | crates/swc_xml_codegen_macros/src/lib.rs:12-17 — before extracting anything, compare `crates/swc_css_codegen_macros/src/lib.rs` and `crates/swc_html_codegen_macros/src/lib.rs` 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_codegen_macros/src/lib.rs:12` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/swc_css_ast/src/at_rule.rs:40 — crates/swc_css_ast/src/at_rule.rs:40-45 | crates/swc_css_ast/src/base.rs:114-119 | crates/swc_css_ast/src/base.rs:323-328 — 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/swc_css_ast/src/at_rule.rs:49 — crates/swc_css_ast/src/at_rule.rs:49-54 | crates/swc_css_ast/src/base.rs:132-137 | crates/swc_css_ast/src/base.rs:332-337 — 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/swc_css_prefixer/src/prefixer.rs:3558 — crates/swc_css_prefixer/src/prefixer.rs:3558-3565 | crates/swc_css_prefixer/src/prefixer.rs:3583-3588 | crates/swc_css_prefixer/src/prefixer.rs:3603-3608 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:3558` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_prefixer/src/prefixer.rs:3589` calls `Some`, `clone` and `crates/swc_css_prefixer/src/prefixer.rs:3566` 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.
R8 · Dependency Hygiene · Unused dependency '@swc/counter' · ×5
  • Unused dependency '@swc/counter' — Declared in packages/core/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 '@swc/counter' — Declared in packages/html/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 '@swc/counter' — Declared in packages/minifier/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 '@swc/counter' — Declared in packages/react-compiler/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 '@swc/counter' — Declared in packages/types/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.
X3 · Exception handling · Swallowed exception (empty catch) · ×5
  • Swallowed exception (empty catch) packages/core/postinstall.js:109 — 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) packages/core/postinstall.js:140 — 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) packages/core/src/index.ts:80 — 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) packages/core/src/postinstall.ts:86 — 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) packages/core/src/postinstall.ts:136 — 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×4
  • Edited copy of a member (32 corresponding lines) crates/swc_common/src/private/content.rs:336 — crates/swc_common/src/private/content.rs:336-367 | crates/swc_common/src/private/content.rs:725-756 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:418 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:418-449 | crates/swc_ecma_parser/src/parser/typescript.rs:1129-1161 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:203 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:203-234 | crates/swc_ecma_parser/src/parser/typescript.rs:889-920 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2563 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2563-2594 | crates/swc_ecma_minifier/src/compress/optimize/mod.rs:2728-2759 — 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 (34 corresponding lines) · ×4
  • Edited copy of a member (34 corresponding lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:651 — crates/swc_ecma_lexer/src/common/parser/pat.rs:651-684 | crates/swc_ecma_parser/src/parser/pat.rs:796-829 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1487 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1487-1520 | crates/swc_ecma_parser/src/parser/typescript.rs:2913-2950 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1564 — crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1564-1597 | crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1599-1643 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) crates/swc_css_minifier/src/compressor/calc_sum.rs:38 — crates/swc_css_minifier/src/compressor/calc_sum.rs:38-71 | crates/swc_css_minifier/src/compressor/calc_sum.rs:73-106 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1878 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1878-1898 | crates/swc_ecma_parser/src/lexer/mod.rs:2097-2117 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/swc_ecma_transforms_react/src/jsx/mod.rs:416 — crates/swc_ecma_transforms_react/src/jsx/mod.rs:416-439 | crates/swc_ecma_transforms_react/src/jsx/mod.rs:447-467 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:291 — crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:291-318 | crates/swc_ecma_transforms_optimization/src/simplify/branch/mod.rs:336-356 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/swc_ecma_compat_es2015/src/spread.rs:204 — crates/swc_ecma_compat_es2015/src/spread.rs:204-224 | crates/swc_ecma_compat_es2022/src/optional_chaining_impl.rs:402-425 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:992 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:992-1017 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1023-1045 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/swc_ecma_parser/src/parser/expr.rs:790 — crates/swc_ecma_parser/src/parser/expr.rs:790-822 | crates/swc_ecma_parser/src/parser/expr.rs:948-970 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:192 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:192-214 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:195-220 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/swc_ecma_lexer/src/parser/mod.rs:163 — crates/swc_ecma_lexer/src/parser/mod.rs:163-185 | crates/swc_ecma_lexer/src/parser/mod.rs:271-293 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:478 — crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:478-501 | crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:503-527 | crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs:529-552 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/swc_common/src/comments.rs:92 — crates/swc_common/src/comments.rs:92-127 | crates/swc_common/src/comments.rs:548-571 | crates/swc_node_comments/src/lib.rs:136-159 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1786 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1786-1818 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2327-2350 | crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs:481-509 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/swc_ecma_compat_es2015/src/object_super.rs:24 — crates/swc_ecma_compat_es2015/src/object_super.rs:24-49 | crates/swc_ecma_compat_es2015/src/object_super.rs:51-74 | crates/swc_ecma_utils/src/function/fn_env_hoister.rs:283-306 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) crates/swc_ecma_ast/src/source_map.rs:68 — crates/swc_ecma_ast/src/source_map.rs:68-91 | crates/swc_ecma_ast/src/source_map.rs:98-122 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/swc_ts_fast_strip/src/erase/classes.rs:167 — crates/swc_ts_fast_strip/src/erase/classes.rs:167-190 | crates/swc_ts_fast_strip/src/erase/classes.rs:217-240 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/swc_xml_parser/src/lexer/mod.rs:567 — crates/swc_xml_parser/src/lexer/mod.rs:567-590 | crates/swc_xml_parser/src/lexer/mod.rs:889-914 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/search.rs:12 — crates/swc_ecma_lexer/src/common/lexer/search.rs:12-35 | crates/swc_ecma_parser/src/lexer/search.rs:12-35 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×4
  • Duplicated block (34 lines × 2) crates/swc_ecma_transforms_module/src/amd.rs:202 — crates/swc_ecma_transforms_module/src/amd.rs:202-235 | crates/swc_ecma_transforms_module/src/umd.rs:107-140 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/umd.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (34 lines × 2) crates/swc_html_codegen/src/lib.rs:1051 — crates/swc_html_codegen/src/lib.rs:1051-1084 | crates/swc_xml_codegen/src/lib.rs:375-408 — before extracting anything, compare `crates/swc_html_codegen/src/lib.rs` and `crates/swc_xml_codegen/src/lib.rs` as WHOLE FILES: this scan already matched 7 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 (34 lines × 2) crates/swc_xml_parser/src/lexer/mod.rs:2749 — crates/swc_xml_parser/src/lexer/mod.rs:2749-2782 | crates/swc_xml_parser/src/lexer/mod.rs:2785-2818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (34 lines × 2) crates/swc_xml_parser/src/lexer/mod.rs:2935 — crates/swc_xml_parser/src/lexer/mod.rs:2935-2968 | crates/swc_xml_parser/src/lexer/mod.rs:2971-3004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×4
  • Duplicated block (30 lines × 2) crates/hstr/src/lib.rs:304 — crates/hstr/src/lib.rs:304-333 | crates/hstr/src/wtf8_atom.rs:247-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (30 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2099 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2099-2128 | crates/swc_ecma_parser/src/lexer/mod.rs:2300-2329 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:2099` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (30 lines × 2) crates/swc_html_minifier/src/lib.rs:1218 — crates/swc_html_minifier/src/lib.rs:1218-1247 | crates/swc_html_minifier/src/lib.rs:1249-1278 — both copies are in the same file, so extract the block into 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) crates/swc_html_parser/src/lexer/mod.rs:2252 — crates/swc_html_parser/src/lexer/mod.rs:2252-2281 | crates/swc_html_parser/src/lexer/mod.rs:2303-2332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2252` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×4
  • Duplicated block (20–21 lines × 2) bindings/binding_core_node/src/parse.rs:197 — bindings/binding_core_node/src/parse.rs:197-217 | bindings/binding_core_node/src/parse.rs:239-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20–21 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:1992 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1992-2011 | crates/swc_ecma_lexer/src/common/parser/pat.rs:571-591 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:1992` 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 (20–21 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:539 — crates/swc_ecma_lexer/src/common/parser/pat.rs:539-558 | crates/swc_ecma_parser/src/parser/pat.rs:676-696 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:539` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20–21 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:2170 — crates/swc_html_parser/src/lexer/mod.rs:2170-2189 | crates/swc_html_parser/src/lexer/mod.rs:2385-2405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2170` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×4
  • Duplicated block (16–18 lines × 2) crates/swc_css_modules/src/lib.rs:165 — crates/swc_css_modules/src/lib.rs:165-182 | crates/swc_css_modules/src/lib.rs:184-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 (16–18 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2005 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2005-2022 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2309-2324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2005` it begins part-way through the construct above it, so those exact lines 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–18 lines × 2) crates/swc_ecma_minifier/src/compress/pure/misc.rs:904 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:904-921 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:964-979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/misc.rs:904` it begins part-way through the construct above it, so those exact lines 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–18 lines × 2) crates/swc_ecma_parser/src/lexer/mod.rs:793 — crates/swc_ecma_parser/src/lexer/mod.rs:793-808 | crates/swc_ecma_parser/src/lexer/mod.rs:824-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/lexer/mod.rs:793` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×4
  • Duplicated block (17 lines × 3) crates/swc_bundler/src/bundler/chunk/merge.rs:811 — crates/swc_bundler/src/bundler/chunk/merge.rs:811-827 | crates/swc_bundler/src/bundler/chunk/merge.rs:865-881 | crates/swc_bundler/src/bundler/chunk/merge.rs:990-1006 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/chunk/merge.rs:811` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) crates/swc_css_parser/src/parser/values_and_units/mod.rs:386 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:386-402 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:823-839 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1297-1313 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2698 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2698-2714 | crates/swc_ecma_parser/src/parser/typescript.rs:5107-5123 | crates/swc_ecma_parser/src/parser/typescript.rs:5289-5305 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire 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 × 3) crates/swc_native_addon/src/platform/windows.rs:361 — crates/swc_native_addon/src/platform/windows.rs:361-377 | crates/swc_native_addon/src/platform/windows.rs:449-465 | crates/swc_native_addon/src/platform/windows.rs:564-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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) crates/swc_ecma_parser/src/parser/mod.rs:402 — crates/swc_ecma_parser/src/parser/mod.rs:402-416 | crates/swc_ecma_parser/src/parser/mod.rs:433-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/mod.rs:402` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) crates/swc_ecma_transformer/src/es3/reserved_word.rs:224 — crates/swc_ecma_transformer/src/es3/reserved_word.rs:224-238 | crates/swc_ecma_transformer/src/es3/reserved_word.rs:258-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es3/reserved_word.rs:224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:797 — crates/swc_ecma_parser/src/parser/expr.rs:797-810 | crates/swc_ecma_parser/src/parser/expr.rs:830-844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn parse_no_substitution_template_literal( &mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14–15 lines × 2) crates/swc_ecma_lexer/src/common/parser/util.rs:78 — crates/swc_ecma_lexer/src/common/parser/util.rs:78-91 | crates/swc_ecma_parser/src/parser/typescript.rs:80-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×4
  • Duplicated block (9 lines × 3) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:401 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:401-409 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:969-977 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1509-1517 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:401` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/swc_html_parser/src/lexer/mod.rs:591 — crates/swc_html_parser/src/lexer/mod.rs:591-599 | crates/swc_html_parser/src/lexer/mod.rs:602-610 | crates/swc_html_parser/src/lexer/mod.rs:613-621 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 3) crates/swc_ecma_parser/src/parser/expr.rs:1425 — crates/swc_ecma_parser/src/parser/expr.rs:1425-1433 | crates/swc_ecma_parser/src/parser/expr.rs:1644-1652 | crates/swc_ecma_parser/src/parser/expr.rs:1760-1768 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:777 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:777-785 | bindings/binding_typescript_wasm/src/error_reporter.rs:777-785 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:777-785 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×4
  • Duplicated block (8 lines × 3) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1826 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1826-1833 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1858-1865 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1898-1905 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:1826` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:346 — crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:346-353 | crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:359-366 | crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:373-380 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:346` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&ForInStmt` in one and `&ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) crates/swc_html_parser/src/parser/mod.rs:8307 — crates/swc_html_parser/src/parser/mod.rs:8307-8314 | crates/swc_html_parser/src/parser/mod.rs:8326-8333 | crates/swc_html_parser/src/parser/mod.rs:8346-8353 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) bindings/binding_core_node/src/lib.rs:34 — bindings/binding_core_node/src/lib.rs:34-41 | bindings/binding_minifier_node/src/lib.rs:17-24 | bindings/binding_react_compiler_node/src/lib.rs:18-25 — 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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×4
  • JavaScript dependencies are not locked crates/swc_estree_compat/tests/package.json:18 — crates/swc_estree_compat/tests/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked crates/swc_node_bundler/tests/integration/react/package.json:13 — crates/swc_node_bundler/tests/integration/react/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked crates/swc_node_bundler/tests/package.json:12 — crates/swc_node_bundler/tests/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked crates/swc_node_bundler/tests/pass/resolve-name-fix/input/package.json:11 — crates/swc_node_bundler/tests/pass/resolve-name-fix/input/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×4
  • Swallowed exception (caught, then discarded) packages/core/postinstall.js:53 — `catch (_a)` 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) packages/core/postinstall.js:74 — `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) packages/core/src/postinstall.ts:19 — `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) packages/core/src/postinstall.ts:40 — `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) crates/swc_ecma_codegen/src/util/token_boundaries.rs:65 — crates/swc_ecma_codegen/src/util/token_boundaries.rs:65-99 | crates/swc_ecma_codegen/src/util/token_boundaries.rs:108-136 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2400 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2400-2428 | crates/swc_ecma_parser/src/parser/typescript.rs:4678-4706 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1971 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1971-1999 | crates/swc_ecma_parser/src/lexer/mod.rs:2185-2213 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:49 — crates/swc_ecma_lexer/src/common/parser/pat.rs:49-85 | crates/swc_ecma_parser/src/parser/pat.rs:144-183 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) crates/swc_html_parser/src/parser/mod.rs:524 — crates/swc_html_parser/src/parser/mod.rs:524-581 | crates/swc_xml_parser/src/parser/mod.rs:198-234 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:109 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:109-145 | crates/swc_ecma_parser/src/parser/typescript.rs:808-844 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (45 corresponding lines) · ×3
  • Edited copy of a member (45 corresponding lines) crates/swc_sourcemap/src/encoder.rs:59 — crates/swc_sourcemap/src/encoder.rs:59-103 | crates/swc_sourcemap/src/lazy/mod.rs:603-647 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) crates/swc_ecma_utils/src/function/fn_env_hoister.rs:75 — crates/swc_ecma_utils/src/function/fn_env_hoister.rs:75-119 | crates/swc_ecma_utils/src/function/fn_env_hoister.rs:138-198 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2611 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2611-2655 | crates/swc_ecma_parser/src/parser/typescript.rs:5004-5055 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:763 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:763-795 | crates/swc_ecma_parser/src/parser/stmt.rs:882-914 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) crates/swc_ecma_lexer/src/common/parser/object.rs:104 — crates/swc_ecma_lexer/src/common/parser/object.rs:104-136 | crates/swc_ecma_parser/src/parser/object.rs:134-167 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:432 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:432-470 | crates/swc_ecma_minifier/src/compress/optimize/mod.rs:3053-3085 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) bindings/binding_core_node/src/print.rs:56 — bindings/binding_core_node/src/print.rs:56-82 | bindings/binding_core_node/src/print.rs:111-145 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:1276 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1276-1302 | crates/swc_ecma_parser/src/parser/expr.rs:2109-2135 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/swc_ecma_compat_es2015/src/arrow.rs:85 — crates/swc_ecma_compat_es2015/src/arrow.rs:85-111 | crates/swc_ecma_compat_es2015/src/parameters.rs:578-612 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:851 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:851-878 | crates/swc_ecma_parser/src/lexer/mod.rs:1260-1287 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:1045 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:1045-1072 | crates/swc_ecma_parser/src/parser/stmt.rs:2370-2397 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1500 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1500-1527 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:1529-1565 — 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 copies of one member (3 members, 16+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/swc_config/src/glob.rs:16 — crates/swc_config/src/glob.rs:16-33 | crates/swc_config/src/regex.rs:56-71 | crates/swc_config/src/regex_js.rs:30-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/swc_html_parser/src/parser/mod.rs:8297 — crates/swc_html_parser/src/parser/mod.rs:8297-8320 | crates/swc_html_parser/src/parser/mod.rs:8325-8340 | crates/swc_html_parser/src/parser/mod.rs:8345-8360 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) tools/swc-releaser/src/main.rs:107 — tools/swc-releaser/src/main.rs:107-123 | tools/swc-releaser/src/main.rs:138-155 | tools/swc-releaser/src/main.rs:157-172 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/swc_bundler/src/bundler/export.rs:92 — crates/swc_bundler/src/bundler/export.rs:92-111 | crates/swc_bundler/src/bundler/import/mod.rs:163-176 | crates/swc_bundler/src/bundler/import/mod.rs:178-187 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) REDACTED:2375 — REDACTED:2375-2384 | REDACTED:2526-2538 | REDACTED:2565-2577 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:728 — crates/swc_estree_compat/src/babelify/expr.rs:728-737 | crates/swc_estree_compat/src/babelify/jsx.rs:83-92 | crates/swc_estree_compat/src/babelify/typescript.rs:1021-1030 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×3
  • Edited copy of a member (4 corresponding lines) crates/swc_css_lints/src/rules/color_hex_alpha.rs:17 — crates/swc_css_lints/src/rules/color_hex_alpha.rs:17-20 | crates/swc_css_lints/src/rules/color_hex_length.rs:17-20 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) bindings/binding_core_node/src/lib.rs:47 — bindings/binding_core_node/src/lib.rs:47-51 | crates/swc_cli_impl/src/commands/compile.rs:215-218 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/swc_css_lints/src/rules/selector_max_class.rs:8 — crates/swc_css_lints/src/rules/selector_max_class.rs:8-11 | crates/swc_css_lints/src/rules/selector_max_combinators.rs:10-13 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×3
  • Duplicated block (37 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:279 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:279-315 | crates/swc_ecma_parser/src/lexer/mod.rs:758-794 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:279` it does not close everything it opens, so those exact lines 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) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2526 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2526-2562 | crates/swc_ecma_parser/src/parser/typescript.rs:4861-4897 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:2526` 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 (37 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3681 — crates/swc_html_parser/src/lexer/mod.rs:3681-3717 | crates/swc_html_parser/src/lexer/mod.rs:3745-3781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3681` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:3680` calls `emit_error` and `crates/swc_html_parser/src/lexer/mod.rs:3744` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×3
  • Duplicated block (36 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1495 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1495-1530 | crates/swc_ecma_parser/src/lexer/mod.rs:1736-1771 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1495` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (36 lines × 2) crates/swc_ecma_lexer/src/common/parser/mod.rs:286 — crates/swc_ecma_lexer/src/common/parser/mod.rs:286-321 | crates/swc_ecma_parser/src/parser/mod.rs:1391-1426 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/mod.rs` and `crates/swc_ecma_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/mod.rs:286` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (36 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:2638 — crates/swc_html_parser/src/lexer/mod.rs:2638-2673 | crates/swc_html_parser/src/lexer/mod.rs:2690-2725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2638` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×3
  • Duplicated block (32 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:964 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:964-995 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1081-1112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:964` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (32 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1333 — crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1333-1364 | crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1448-1479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs:1333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `m` to `&mut Module` in one and `&mut Script` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (32 lines × 2) crates/swc_html_parser/src/parser/mod.rs:6555 — crates/swc_html_parser/src/parser/mod.rs:6555-6586 | crates/swc_html_parser/src/parser/mod.rs:6629-6660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:6555` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×3
  • Duplicated block (20 lines × 3) bindings/binding_nodejs_support_wasm/src/lib.rs:167 — bindings/binding_nodejs_support_wasm/src/lib.rs:167-186 | bindings/binding_typescript_wasm/src/lib.rs:89-108 | crates/swc_ts_fast_strip_binding/src/lib.rs:45-64 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/lib.rs` and `bindings/binding_typescript_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) bindings/binding_nodejs_support_wasm/src/lib.rs:252 — bindings/binding_nodejs_support_wasm/src/lib.rs:252-271 | bindings/binding_typescript_wasm/src/lib.rs:174-193 | crates/swc_ts_fast_strip_binding/src/lib.rs:130-149 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/lib.rs` and `bindings/binding_typescript_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) crates/swc_html_parser/src/parser/mod.rs:1958 — crates/swc_html_parser/src/parser/mod.rs:1958-1978 | crates/swc_html_parser/src/parser/mod.rs:2092-2114 | crates/swc_html_parser/src/parser/mod.rs:2263-2282 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1958` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×3
  • Duplicated block (19 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:1237 — crates/swc_html_parser/src/lexer/mod.rs:1237-1255 | crates/swc_html_parser/src/lexer/mod.rs:1266-1284 | crates/swc_html_parser/src/lexer/mod.rs:1295-1313 | crates/swc_html_parser/src/lexer/mod.rs:1321-1339 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:1237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:1262` calls `Some` and `crates/swc_html_parser/src/lexer/mod.rs:1321` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:3956 — crates/swc_html_parser/src/lexer/mod.rs:3956-3974 | crates/swc_html_parser/src/lexer/mod.rs:4016-4034 | crates/swc_html_parser/src/lexer/mod.rs:4085-4103 | crates/swc_html_parser/src/lexer/mod.rs:4149-4167 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3956` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 4) crates/swc_plugin_runner/src/imported_fn/comments.rs:160 — crates/swc_plugin_runner/src/imported_fn/comments.rs:160-178 | crates/swc_plugin_runner/src/imported_fn/comments.rs:195-213 | crates/swc_plugin_runner/src/imported_fn/comments.rs:274-292 | crates/swc_plugin_runner/src/imported_fn/comments.rs:304-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_plugin_runner/src/imported_fn/comments.rs:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×3
  • Duplicated block (15–16 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1411 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1411-1426 | crates/swc_ecma_parser/src/lexer/mod.rs:572-586 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) crates/swc_html_parser/src/parser/mod.rs:502 — crates/swc_html_parser/src/parser/mod.rs:502-517 | crates/swc_xml_parser/src/parser/mod.rs:165-179 — before extracting anything, compare `crates/swc_html_parser/src/parser/mod.rs` and `crates/swc_xml_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:502` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15–16 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:157 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:157-171 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:204-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×3
  • Duplicated block (12–14 lines × 2) crates/swc_bundler/src/bundler/chunk/merge.rs:670 — crates/swc_bundler/src/bundler/chunk/merge.rs:670-683 | crates/swc_bundler/src/bundler/chunk/merge.rs:1345-1356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/chunk/merge.rs:670` it does not close everything it opens, so those exact lines 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–14 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:746 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:746-757 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1314-1327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:746` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) crates/swc_ecma_transforms_base/src/rename/mod.rs:470 — crates/swc_ecma_transforms_base/src/rename/mod.rs:470-481 | crates/swc_ecma_transforms_base/src/rename/mod.rs:488-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_base/src/rename/mod.rs:470` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `m` to `&mut Module` in one and `&mut Script` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×3
  • Duplicated block (13 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:3305 — crates/swc_html_parser/src/lexer/mod.rs:3305-3317 | crates/swc_html_parser/src/lexer/mod.rs:3347-3360 | crates/swc_xml_parser/src/lexer/mod.rs:1603-1615 | crates/swc_xml_parser/src/lexer/mod.rs:1642-1655 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:3361` calls `append_to_comment_token` and `crates/swc_html_parser/src/lexer/mod.rs:3318` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:3985 — crates/swc_html_parser/src/lexer/mod.rs:3985-3999 | crates/swc_xml_parser/src/lexer/mod.rs:2425-2437 | crates/swc_xml_parser/src/lexer/mod.rs:2889-2902 | crates/swc_xml_parser/src/lexer/mod.rs:3014-3026 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3985` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:4000` calls `set_doctype_token_system_id` and `crates/swc_xml_parser/src/lexer/mod.rs:2438` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 4) crates/swc_estree_ast/src/class.rs:178 — crates/swc_estree_ast/src/class.rs:178-190 | crates/swc_estree_ast/src/class.rs:347-359 | crates/swc_estree_ast/src/object.rs:112-124 | crates/swc_estree_ast/src/object.rs:250-262 — before extracting anything, compare `crates/swc_estree_ast/src/class.rs` and `crates/swc_estree_ast/src/object.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_estree_ast/src/class.rs:178` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_estree_ast/src/class.rs:191` calls `serialize_entry`, `unwrap_or` and `crates/swc_estree_ast/src/class.rs:360` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×3
  • Duplicated block (11–13 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1121 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1121-1133 | crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1140-1150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–13 lines × 2) crates/swc_ecma_transforms_typescript/src/transform.rs:274 — crates/swc_ecma_transforms_typescript/src/transform.rs:274-286 | crates/swc_ecma_transforms_typescript/src/transform.rs:409-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&mut Vec<ModuleItem>` in one and `&mut Vec<Stmt>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11–13 lines × 2) crates/swc_ecma_transforms_typescript/src/transform.rs:1409 — crates/swc_ecma_transforms_typescript/src/transform.rs:1409-1419 | crates/swc_ecma_transforms_typescript/src/transform.rs:1455-1467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_typescript/src/transform.rs:1409` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×3
  • Duplicated block (12 lines × 4) bindings/binding_core_node/src/parse.rs:59 — bindings/binding_core_node/src/parse.rs:59-71 | bindings/binding_core_node/src/parse.rs:111-123 | bindings/binding_core_node/src/parse.rs:205-217 | bindings/binding_core_node/src/parse.rs:247-258 — 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 `bindings/binding_core_node/src/parse.rs:59` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `bindings/binding_core_node/src/parse.rs:57` calls `try_with`, `clone` and `bindings/binding_core_node/src/parse.rs:108` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:461 — crates/swc_html_parser/src/lexer/mod.rs:461-472 | crates/swc_html_parser/src/lexer/mod.rs:683-694 | crates/swc_html_parser/src/lexer/mod.rs:772-783 | crates/swc_html_parser/src/lexer/mod.rs:796-807 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `c` to `u8` in one and `char` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:809` calls `push` and `crates/swc_html_parser/src/lexer/mod.rs:474` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:3797 — crates/swc_html_parser/src/lexer/mod.rs:3797-3808 | crates/swc_html_parser/src/lexer/mod.rs:3859-3870 | crates/swc_html_parser/src/lexer/mod.rs:4183-4194 | crates/swc_html_parser/src/lexer/mod.rs:4245-4256 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3797` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) crates/swc_ecma_ast/src/source_map.rs:73 — crates/swc_ecma_ast/src/source_map.rs:73-83 | crates/swc_ecma_ast/src/source_map.rs:103-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_ast/src/source_map.rs: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 (11–12 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1006 — crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1006-1017 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1035-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1006` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&ForInStmt` in one and `&ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1004` calls `visit_with` and `crates/swc_ecma_minifier/src/usage_analyzer/analyzer/mod.rs:1033` 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) crates/swc_ecma_transforms_base/src/resolver/mod.rs:1652 — crates/swc_ecma_transforms_base/src/resolver/mod.rs:1652-1662 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1665-1676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut TsThisTypeOrIdent` in one and `&mut TsTypeQueryExpr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×3
  • Duplicated block (11 lines × 4) crates/swc_css_codegen/src/writer/basic.rs:114 — crates/swc_css_codegen/src/writer/basic.rs:114-124 | crates/swc_ecma_codegen/src/text_writer/basic_impl.rs:98-108 | crates/swc_html_codegen/src/writer/basic.rs:112-122 | crates/swc_xml_codegen/src/writer/basic.rs:112-122 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_codegen/src/writer/basic.rs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 4) crates/swc_css_modules/src/lib.rs:167 — crates/swc_css_modules/src/lib.rs:167-177 | crates/swc_css_modules/src/lib.rs:184-194 | crates/swc_css_modules/src/lib.rs:203-213 | crates/swc_css_modules/src/lib.rs:220-230 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_modules/src/lib.rs:179` calls `visit_mut_with` and `crates/swc_css_modules/src/lib.rs:215` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 4) crates/swc_xml_parser/src/lexer/mod.rs:2676 — crates/swc_xml_parser/src/lexer/mod.rs:2676-2686 | crates/swc_xml_parser/src/lexer/mod.rs:2732-2742 | crates/swc_xml_parser/src/lexer/mod.rs:2865-2875 | crates/swc_xml_parser/src/lexer/mod.rs:2918-2928 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:2676` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×3
  • Duplicated block (9 lines × 2 locations) packages/core/src/Visitor.ts:618 — packages/core/src/Visitor.ts:618 · packages/core/src/Visitor.ts:630 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) packages/core/src/Visitor.ts:1597 — packages/core/src/Visitor.ts:1597 · packages/core/src/Visitor.ts:1660 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) packages/core/src/index.ts:267 — packages/core/src/index.ts:267 · packages/core/src/index.ts:283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: lib.rs ↔ hook_utils.rs crates/swc_ecma_preset_env/src/lib.rs:1 — `crates/swc_ecma_preset_env/src/lib.rs` and `crates/swc_ecma_transformer/src/hook_utils.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 `769c9d29` feat(es/transformer): Merge `private_properties_in_object` (#11378); `752188ef` feat(es/transformer): Merge `object_rest_spread` (#11357); `25f3a472` feat(es/transformer): Merge `async_to_generator` (#11358) — run `git show` on any of them.
  • Change coupling: sequences.rs ↔ mod.rs crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1 — `crates/swc_ecma_minifier/src/compress/optimize/sequences.rs` and `crates/swc_ecma_minifier/src/usage_analyzer/alias/mod.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 `fb9ebeeb` fix(es/minifier): Make Infect Collect collect every used ident (#11998); `1a3a4b93` perf(es/minifier): Limit infection analysis by the entry size (#10006) (at that commit the file was still `crates/swc_ecma_usage_analyzer/src/alias/mod.rs`); `37616c33` perf(es/minifier): Make analyzer not call `collect_infects_from` recu… (at that commit the file was still `crates/swc_ecma_usage_analyzer/src/alias/mod.rs`) — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/swc_html_parser/src/lexer/mod.rs:428 — crates/swc_html_parser/src/lexer/mod.rs:428-454 | crates/swc_html_parser/src/lexer/mod.rs:483-518 | crates/swc_html_parser/src/lexer/mod.rs:523-558 | crates/swc_html_parser/src/lexer/mod.rs:893-928 | crates/swc_html_parser/src/lexer/mod.rs:1030-1065 — 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/swc_html_parser/src/lexer/mod.rs:459 — crates/swc_html_parser/src/lexer/mod.rs:459-478 | crates/swc_html_parser/src/lexer/mod.rs:681-700 | crates/swc_html_parser/src/lexer/mod.rs:745-765 | crates/swc_html_parser/src/lexer/mod.rs:770-789 | crates/swc_html_parser/src/lexer/mod.rs:794-817 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (136 corresponding lines) · ×2
  • Edited copy of a member (136 corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:1127 — crates/swc_ecma_lexer/src/common/parser/expr.rs:1127-1262 | crates/swc_ecma_parser/src/parser/expr.rs:1929-2071 — These two members are one piece of code written twice and then edited apart: 136 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (136 corresponding lines) crates/swc_css_minifier/src/compressor/rules.rs:375 — crates/swc_css_minifier/src/compressor/rules.rs:375-510 | crates/swc_css_minifier/src/compressor/rules.rs:512-663 — These two members are one piece of code written twice and then edited apart: 136 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (105 corresponding lines) · ×2
  • Edited copy of a member (105 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1668 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1668-1772 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:2042-2171 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (105 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:199 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:199-305 | crates/swc_ecma_parser/src/parser/stmt.rs:217-321 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (96 corresponding lines) · ×2
  • Edited copy of a member (96 corresponding lines) crates/swc_ecma_compat_es2015/src/classes/mod.rs:104 — crates/swc_ecma_compat_es2015/src/classes/mod.rs:104-199 | crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:313-414 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (96 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:599 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:599-694 | crates/swc_ecma_parser/src/parser/stmt.rs:709-815 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (72 corresponding lines) · ×2
  • Edited copy of a member (72 corresponding lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:832 — crates/swc_ecma_lexer/src/common/parser/pat.rs:832-903 | crates/swc_ecma_parser/src/parser/pat.rs:1045-1116 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (72 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:593 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:593-664 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:652-725 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×2
  • Edited copy of a member (60 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:54 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:54-113 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:36-95 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (60 corresponding lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:453 — crates/swc_ecma_lexer/src/common/parser/pat.rs:453-512 | crates/swc_ecma_parser/src/parser/pat.rs:588-648 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (67 corresponding lines) · ×2
  • Edited copy of a member (67 corresponding lines) crates/swc_ecma_transforms_classes/src/super_field.rs:74 — crates/swc_ecma_transforms_classes/src/super_field.rs:74-140 | crates/swc_ecma_transforms_classes/src/super_field.rs:199-278 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (67 corresponding lines) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3430 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3430-3520 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3766-3832 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×2
  • Edited copy of a member (1 corresponding lines) bindings/binding_core_wasm/src/lib.rs:47 — bindings/binding_core_wasm/src/lib.rs:47-47 | bindings/binding_minifier_wasm/src/lib.rs:13-13 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) crates/hstr/src/lib.rs:361 — crates/hstr/src/lib.rs:361-361 | crates/hstr/src/wtf8_atom.rs:383-383 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) crates/swc_ecma_transforms_testing/src/lib.rs:536 — crates/swc_ecma_transforms_testing/src/lib.rs:536-574 | crates/swc_ecma_transforms_testing/src/lib.rs:581-626 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1706 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1706-1744 | crates/swc_ecma_parser/src/parser/typescript.rs:3397-3435 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1284 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1284-1325 | crates/swc_ecma_parser/src/parser/typescript.rs:2612-2657 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) crates/swc_ecma_lexer/src/lexer/mod.rs:216 — crates/swc_ecma_lexer/src/lexer/mod.rs:216-260 | crates/swc_ecma_parser/src/lexer/mod.rs:395-436 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) crates/swc_ecma_parser/src/parser/mod.rs:448 — crates/swc_ecma_parser/src/parser/mod.rs:448-483 | crates/swc_ecma_parser/src/parser/mod.rs:707-742 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1573 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1573-1608 | crates/swc_ecma_parser/src/parser/typescript.rs:3055-3101 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) REDACTED:3433 — REDACTED:3433-3458 | REDACTED:3464-3482 | REDACTED:3580-3597 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1799 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1799-1818 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1935-1952 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2566-2583 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/swc_ecma_lints/src/rules/critical_rules.rs:499 — crates/swc_ecma_lints/src/rules/critical_rules.rs:499-513 | crates/swc_ecma_lints/src/rules/critical_rules.rs:515-529 | crates/swc_ecma_lints/src/rules/critical_rules.rs:531-545 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/swc_css_codegen/src/lib.rs:68 — crates/swc_css_codegen/src/lib.rs:68-82 | crates/swc_css_codegen/src/lib.rs:91-111 | crates/swc_css_codegen/src/lib.rs:1377-1391 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/swc_estree_compat/src/babelify/expr.rs:669 — crates/swc_estree_compat/src/babelify/expr.rs:669-674 | crates/swc_estree_compat/src/babelify/jsx.rs:98-103 | crates/swc_estree_compat/src/babelify/typescript.rs:1047-1052 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/arguments.rs:232 — crates/swc_ecma_minifier/src/compress/optimize/arguments.rs:232-242 | crates/swc_ecma_react_compiler/src/apply_renames.rs:95-100 | crates/swc_ecma_transforms_base/src/rename/ops.rs:591-596 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) crates/swc_html_parser/src/lexer/mod.rs:4951 — crates/swc_html_parser/src/lexer/mod.rs:4951-4953 | crates/swc_xml_parser/src/lexer/mod.rs:3125-3127 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) crates/swc_ecma_parser/src/parser/tsrx.rs:640 — crates/swc_ecma_parser/src/parser/tsrx.rs:640-642 | crates/swc_ecma_parser/src/parser/typescript.rs:195-199 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1868 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1868-1872 | crates/swc_ecma_parser/src/lexer/mod.rs:2088-2092 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/swc_bundler/src/inline.rs:109 — crates/swc_bundler/src/inline.rs:109-113 | crates/swc_ecma_minifier/src/compress/pure/vars.rs:473-477 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×2
  • Duplicated block (45 lines × 2) crates/ast_node/src/encoding/decode.rs:79 — crates/ast_node/src/encoding/decode.rs:79-123 | crates/ast_node/src/encoding/encode.rs:53-97 — before extracting anything, compare `crates/ast_node/src/encoding/decode.rs` and `crates/ast_node/src/encoding/encode.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast_node/src/encoding/decode.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (45 lines × 2) crates/swc_sourcemap/src/decoder.rs:163 — crates/swc_sourcemap/src/decoder.rs:163-207 | crates/swc_sourcemap/src/lazy/mod.rs:367-411 — before extracting anything, compare `crates/swc_sourcemap/src/decoder.rs` and `crates/swc_sourcemap/src/lazy/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_sourcemap/src/decoder.rs:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×2
  • Duplicated block (30–31 lines × 2) bindings/binding_core_node/src/transform.rs:167 — bindings/binding_core_node/src/transform.rs:167-196 | bindings/binding_core_node/src/transform.rs:240-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_core_node/src/transform.rs:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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–31 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1997 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1997-2026 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2070-2100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1997` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×2
  • Duplicated block (28–29 lines × 2) crates/swc_ecma_compat_es2015/src/template_literal.rs:162 — crates/swc_ecma_compat_es2015/src/template_literal.rs:162-190 | crates/swc_ecma_compat_es2015/src/template_literal.rs:205-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/template_literal.rs:162` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (28–29 lines × 2) crates/swc_html_parser/src/parser/mod.rs:1672 — crates/swc_html_parser/src/parser/mod.rs:1672-1700 | crates/swc_html_parser/src/parser/mod.rs:2130-2157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1672` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (27 lines × 3) · ×2
  • Duplicated block (27 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:478 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:478-504 | bindings/binding_typescript_wasm/src/error_reporter.rs:478-504 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:478-504 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (27 lines × 3) crates/swc_css_codegen/src/writer/basic.rs:114 — crates/swc_css_codegen/src/writer/basic.rs:114-140 | crates/swc_html_codegen/src/writer/basic.rs:112-138 | crates/swc_xml_codegen/src/writer/basic.rs:112-138 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×2
  • Duplicated block (25–27 lines × 2) crates/swc_ecma_minifier/src/compress/pure/mod.rs:1080 — crates/swc_ecma_minifier/src/compress/pure/mod.rs:1080-1106 | crates/swc_ecma_minifier/src/compress/pure/mod.rs:1153-1177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/mod.rs:1080` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25–27 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3728 — crates/swc_html_parser/src/lexer/mod.rs:3728-3754 | crates/swc_xml_parser/src/lexer/mod.rs:2700-2724 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3728` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:3755` calls `set_doctype_token_force_quirks` and `crates/swc_xml_parser/src/lexer/mod.rs:2725` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (21–26 lines × 2) · ×2
  • Duplicated block (21–26 lines × 2) crates/swc_html_parser/src/parser/mod.rs:5010 — crates/swc_html_parser/src/parser/mod.rs:5010-5030 | crates/swc_html_parser/src/parser/mod.rs:5036-5061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:5010` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (21–26 lines × 2) crates/swc_html_parser/src/parser/mod.rs:6593 — crates/swc_html_parser/src/parser/mod.rs:6593-6618 | crates/swc_html_parser/src/parser/mod.rs:6683-6703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×2
  • Duplicated block (24–25 lines × 2) crates/swc_ecma_compat_es2015/src/classes/mod.rs:880 — crates/swc_ecma_compat_es2015/src/classes/mod.rs:880-903 | crates/swc_ecma_compat_es2015/src/classes/mod.rs:908-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2015/src/classes/mod.rs:880` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (24–25 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr.rs:828 — crates/swc_ecma_lexer/src/common/parser/expr.rs:828-852 | crates/swc_ecma_lexer/src/common/parser/expr.rs:999-1022 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:828` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 3) · ×2
  • Duplicated block (20–21 lines × 3) crates/swc_common/src/comments.rs:97 — crates/swc_common/src/comments.rs:97-116 | crates/swc_common/src/comments.rs:550-570 | crates/swc_node_comments/src/lib.rs:138-158 — before extracting anything, compare `crates/swc_common/src/comments.rs` and `crates/swc_node_comments/src/lib.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_common/src/comments.rs:550` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (20–21 lines × 3) crates/swc_xml_parser/src/lexer/mod.rs:2418 — crates/swc_xml_parser/src/lexer/mod.rs:2418-2437 | crates/swc_xml_parser/src/lexer/mod.rs:2882-2902 | crates/swc_xml_parser/src/lexer/mod.rs:3007-3026 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:2418` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_xml_parser/src/lexer/mod.rs:2415` calls `cur_pos` and `crates/swc_xml_parser/src/lexer/mod.rs:3005` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:1450 — crates/swc_ecma_parser/src/parser/expr.rs:1450-1468 | crates/swc_ecma_parser/src/parser/expr.rs:1534-1553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:1450` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (19–20 lines × 2) crates/swc_ecma_preset_env/src/lib.rs:516 — crates/swc_ecma_preset_env/src/lib.rs:516-534 | crates/swc_ecma_preset_env/src/lib.rs:536-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_preset_env/src/lib.rs:536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) crates/swc_css_codegen/src/writer/basic.rs:143 — crates/swc_css_codegen/src/writer/basic.rs:143-160 | crates/swc_html_codegen/src/writer/basic.rs:141-158 | crates/swc_xml_codegen/src/writer/basic.rs:141-158 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 3) crates/swc_estree_compat/src/swcify/stmt.rs:440 — crates/swc_estree_compat/src/swcify/stmt.rs:440-457 | crates/swc_estree_compat/src/swcify/stmt.rs:532-549 | crates/swc_estree_compat/src/swcify/stmt.rs:629-646 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×2
  • Duplicated block (15–17 lines × 3) bindings/binding_html_node/src/lib.rs:412 — bindings/binding_html_node/src/lib.rs:412-428 | bindings/binding_html_wasm/src/lib.rs:456-472 | crates/swc_html_minifier/src/lib.rs:2754-2768 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `bindings/binding_html_node/src/lib.rs:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–17 lines × 3) crates/swc_ecma_lexer/src/common/lexer/mod.rs:315 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:315-329 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:346-362 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:459-475 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×2
  • Duplicated block (16 lines × 4) crates/swc_css_parser/src/parser/values_and_units/mod.rs:962 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:962-977 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1011-1026 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1079-1094 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1128-1143 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:962` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:3116 — crates/swc_html_parser/src/lexer/mod.rs:3116-3131 | crates/swc_html_parser/src/lexer/mod.rs:3266-3281 | crates/swc_xml_parser/src/lexer/mod.rs:1429-1444 | crates/swc_xml_parser/src/lexer/mod.rs:1563-1578 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) bindings/binding_core_node/src/parse.rs:111 — bindings/binding_core_node/src/parse.rs:111-126 | bindings/binding_core_node/src/parse.rs:205-220 | bindings/binding_core_node/src/parse.rs:247-262 — all 3 copies are in the same file, so extract the block into one function there and call 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 `bindings/binding_core_node/src/parse.rs:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 3) crates/swc_html_parser/src/lexer/mod.rs:463 — crates/swc_html_parser/src/lexer/mod.rs:463-478 | crates/swc_html_parser/src/lexer/mod.rs:685-700 | crates/swc_html_parser/src/lexer/mod.rs:774-789 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:463` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `c` to `u8` in one and `char` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) crates/swc_ecma_minifier/src/compress/pure/misc.rs:112 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:112-127 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:212-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/misc.rs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–16 lines × 2) crates/swc_ecma_parser/src/parser/mod.rs:464 — crates/swc_ecma_parser/src/parser/mod.rs:464-477 | crates/swc_ecma_parser/src/parser/mod.rs:718-733 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/mod.rs:718` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_parser/src/parser/mod.rs:734` calls `syntax`, `flow`, `report_duplicate_exports` and `crates/swc_ecma_parser/src/parser/mod.rs:479` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×2
  • Duplicated block (15 lines × 6) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2028 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2028-2042 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2081-2095 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2131-2145 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2181-2195 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2234-2248 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2284-2298 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2028` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 6) crates/swc_html_parser/src/parser/mod.rs:1687 — crates/swc_html_parser/src/parser/mod.rs:1687-1703 | crates/swc_html_parser/src/parser/mod.rs:2144-2160 | crates/swc_html_parser/src/parser/mod.rs:5101-5117 | crates/swc_html_parser/src/parser/mod.rs:5684-5698 | crates/swc_html_parser/src/parser/mod.rs:6305-6321 | crates/swc_html_parser/src/parser/mod.rs:6475-6491 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1687` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) crates/swc_ecma_lexer/src/common/parser/typescript.rs:1587 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:1587-1599 | crates/swc_ecma_parser/src/parser/typescript.rs:3079-3092 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/typescript.rs` and `crates/swc_ecma_parser/src/parser/typescript.rs` as WHOLE FILES: this scan already matched 10 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/typescript.rs:1587` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) crates/swc_macros_common/src/binder.rs:155 — crates/swc_macros_common/src/binder.rs:155-167 | crates/swc_macros_common/src/binder.rs:213-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_macros_common/src/binder.rs:155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) crates/swc_html_parser/src/lexer/mod.rs:2653 — crates/swc_html_parser/src/lexer/mod.rs:2653-2665 | crates/swc_html_parser/src/lexer/mod.rs:2705-2717 | crates/swc_html_parser/src/lexer/mod.rs:2785-2797 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2653` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:2784` calls `finish_attribute_token_value` and `crates/swc_html_parser/src/lexer/mod.rs:2652` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 3) crates/swc_ecma_parser/src/parser/expr.rs:1506 — crates/swc_ecma_parser/src/parser/expr.rs:1506-1518 | crates/swc_ecma_parser/src/parser/expr.rs:1608-1620 | crates/swc_ecma_parser/src/parser/expr.rs:1702-1714 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_ecma_parser/src/parser/expr.rs:1622` calls `unwrap_ts_non_null`, `is_opt_chain` and `crates/swc_ecma_parser/src/parser/expr.rs:1716` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×2
  • Duplicated block (10 lines × 5) crates/swc_css_parser/src/parser/values_and_units/mod.rs:248 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:248-257 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:264-273 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:308-317 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:333-342 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:358-367 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_css_parser/src/parser/values_and_units/mod.rs:246` calls `skip_ws` and `crates/swc_css_parser/src/parser/values_and_units/mod.rs:306` 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 × 5) crates/swc_html_parser/src/lexer/mod.rs:460 — crates/swc_html_parser/src/lexer/mod.rs:460-469 | crates/swc_html_parser/src/lexer/mod.rs:682-691 | crates/swc_html_parser/src/lexer/mod.rs:746-755 | crates/swc_html_parser/src/lexer/mod.rs:771-780 | crates/swc_html_parser/src/lexer/mod.rs:795-804 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `c` to `u8` in one and `char` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:809` calls `push` and `crates/swc_html_parser/src/lexer/mod.rs:474` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×2
  • Duplicated block (7–10 lines × 2) crates/swc_css_parser/src/lexer/mod.rs:901 — crates/swc_css_parser/src/lexer/mod.rs:901-910 | crates/swc_css_parser/src/lexer/mod.rs:954-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/lexer/mod.rs:901` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_parser/src/lexer/mod.rs:962` calls `push_str` and `crates/swc_css_parser/src/lexer/mod.rs:912` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7–10 lines × 2) crates/swc_css_prefixer/src/prefixer.rs:1904 — crates/swc_css_prefixer/src/prefixer.rs:1904-1913 | crates/swc_css_prefixer/src/prefixer.rs:3630-3636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_prefixer/src/prefixer.rs:1904` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:407 — crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:407-414 | crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:442-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs:407` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–10 lines × 2) crates/swc_ecma_parser/src/parser/stmt.rs:1807 — crates/swc_ecma_parser/src/parser/stmt.rs:1807-1816 | crates/swc_ecma_parser/src/parser/stmt.rs:1862-1869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/stmt.rs:1807` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn parse_flow_match_expr(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) crates/swc_ecma_minifier/src/compress/optimize/iife.rs:158 — crates/swc_ecma_minifier/src/compress/optimize/iife.rs:158-166 | crates/swc_ecma_minifier/src/compress/optimize/iife.rs:456-464 | crates/swc_ecma_minifier/src/compress/optimize/iife.rs:691-699 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1226-1234 — before extracting anything, compare `crates/swc_ecma_minifier/src/compress/optimize/iife.rs` and `crates/swc_ecma_minifier/src/compress/optimize/unused.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/iife.rs:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `e` to `&mut CallExpr` in one and `&mut Expr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 4) crates/swc_css_parser/src/parser/values_and_units/mod.rs:406 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:406-414 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:519-527 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:635-643 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:887-895 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) crates/swc_css_parser/src/parser/values_and_units/mod.rs:564 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:564-571 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:680-687 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:951-958 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1068-1075 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:564` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) crates/swc_estree_compat/src/babelify/typescript.rs:231 — crates/swc_estree_compat/src/babelify/typescript.rs:231-238 | crates/swc_estree_compat/src/babelify/typescript.rs:250-257 | crates/swc_estree_compat/src/babelify/typescript.rs:287-294 | crates/swc_estree_compat/src/babelify/typescript.rs:307-314 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) crates/swc_ecma_parser/src/parser/expr.rs:2888 — crates/swc_ecma_parser/src/parser/expr.rs:2888-2894 | crates/swc_ecma_parser/src/parser/expr.rs:2934-2941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/expr.rs:2934` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) crates/swc_ecma_parser/src/parser/mod.rs:398 — crates/swc_ecma_parser/src/parser/mod.rs:398-404 | crates/swc_ecma_parser/src/parser/mod.rs:460-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) crates/swc_ecma_parser/src/parser/stmt.rs:1798 — crates/swc_ecma_parser/src/parser/stmt.rs:1798-1804 | crates/swc_ecma_parser/src/parser/stmt.rs:1854-1859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn parse_flow_match_expr(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6–7 lines × 2) crates/swc_ecma_transformer/src/regexp.rs:316 — crates/swc_ecma_transformer/src/regexp.rs:316-321 | crates/swc_ecma_transformer/src/regexp.rs:370-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) crates/swc_ecma_lexer/src/common/lexer/mod.rs:289 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:289-294 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:395-400 | crates/swc_ecma_parser/src/lexer/mod.rs:768-773 | crates/swc_ecma_parser/src/lexer/mod.rs:873-878 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:289` it does not close everything it opens, so those exact lines 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/swc_css_minifier/src/compressor/calc_sum.rs:527 — crates/swc_css_minifier/src/compressor/calc_sum.rs:527-532 | crates/swc_css_minifier/src/compressor/calc_sum.rs:543-548 | crates/swc_css_minifier/src/compressor/calc_sum.rs:581-586 | crates/swc_css_minifier/src/compressor/calc_sum.rs:591-596 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_minifier/src/compressor/calc_sum.rs:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×2
  • Duplicated block (13 lines × 2 locations) packages/core/src/Visitor.ts:712 — packages/core/src/Visitor.ts:712 · packages/core/src/Visitor.ts:1652 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (13 lines × 2 locations) packages/core/src/index.ts:295 — packages/core/src/index.ts:295 · packages/core/src/index.ts:341 — 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×2
  • Duplicated block (11 lines × 2 locations) packages/core/src/Visitor.ts:912 — packages/core/src/Visitor.ts:912 · packages/core/src/Visitor.ts:1001 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) packages/core/src/index.ts:160 — packages/core/src/index.ts:160 · packages/core/src/index.ts:213 — 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.
R11 · Import Boundaries · Boundary violation [package · ×2
  • Boundary violation [package:test-suite-dependency] REDACTED:4 — REDACTED:4 imports bindings/binding_es_ast_viewer/__tests__/parse.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:relative-cross-package] packages/html/webcontainer-fallback.cjs:23 — packages/html/webcontainer-fallback.cjs:23 reaches into another package with a relative path (./node_modules/@swc/html-wasm/wasm.js) — import the package by name instead.
R4 · Test Coverage · This test file cannot be loaded · ×2
  • This test file cannot be loaded crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts:2 — crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts:2 imports '../fnv1a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded crates/swc_ecma_minifier/tests/terser/compress/export/dynamic_import/input.js:1 — crates/swc_ecma_minifier/tests/terser/compress/export/dynamic_import/input.js:1 imports './traditional.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
S1 · Web-Security Posture · Weak hash algorithm · ×2
  • Weak hash algorithm crates/dbg-swc/src/es/minifier/reduce.rs:132 — 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/swc_ecma_transforms_react/src/refresh/hook.rs:106 — 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.
D17 · Explicit Debt · TodoComment repeated across 11 files · ×1
  • TodoComment repeated across 11 files packages/types/index.ts:7 — The identical TodoComment appears in 11 files (11 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 11 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO:". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · TodoComment repeated across 24 files · ×1
  • TodoComment repeated across 24 files crates/swc_xml_parser/src/lexer/mod.rs:486 — The identical TodoComment appears in 24 files (46 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 46 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 145 shared lines) · ×1
  • Near-duplicate member family (3 members, 145 shared lines) bindings/binding_html_node/src/lib.rs:294 — bindings/binding_html_node/src/lib.rs:294-497 | bindings/binding_html_wasm/src/lib.rs:338-541 | crates/swc_html_minifier/src/lib.rs:2679-2834 — These 3 members are variants of one another: a block of 145 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 pair (95 shared lines) · ×1
  • Near-duplicate member pair (95 shared lines) crates/swc_ecma_lexer/src/common/parser/pat.rs:117 — crates/swc_ecma_lexer/src/common/parser/pat.rs:117-393 | crates/swc_ecma_parser/src/parser/pat.rs:231-524 — These two members are variants of one another: 95 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 · Near-duplicate member pair (78 shared lines) · ×1
  • Near-duplicate member pair (78 shared lines) crates/ast_node/src/encoding/decode.rs:5 — crates/ast_node/src/encoding/decode.rs:5-284 | crates/ast_node/src/encoding/encode.rs:5-237 — 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.
D4 · Code Duplication · Near-duplicate member pair (75 shared lines) · ×1
  • Near-duplicate member pair (75 shared lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2030 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2030-2146 | crates/swc_ecma_parser/src/lexer/mod.rs:2243-2335 — 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.
D4 · Code Duplication · Near-duplicate member pair (74 shared lines) · ×1
  • Near-duplicate member pair (74 shared lines) crates/swc_ecma_parser/src/parser/expr.rs:1308 — crates/swc_ecma_parser/src/parser/expr.rs:1308-1580 | crates/swc_ecma_parser/src/parser/expr.rs:1588-1743 — These two members are variants of one another: 74 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 · Near-duplicate member pair (69 shared lines) · ×1
  • Near-duplicate member pair (69 shared lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1435 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1435-1551 | crates/swc_ecma_parser/src/lexer/mod.rs:1676-1791 — These two members are variants of one another: 69 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 · Near-duplicate member pair (55 shared lines) · ×1
  • Near-duplicate member pair (55 shared lines) crates/swc_html_parser/src/parser/mod.rs:395 — crates/swc_html_parser/src/parser/mod.rs:395-522 | crates/swc_xml_parser/src/parser/mod.rs:112-196 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (52 shared lines) · ×1
  • Near-duplicate member pair (52 shared lines) crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:19 — crates/swc_ecma_transformer/src/es2020/export_namespace_from.rs:19-126 | crates/swc_ecma_transforms_proposal/src/export_default_from.rs:13-113 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (51 shared lines) · ×1
  • Near-duplicate member pair (51 shared lines) bindings/binding_minifier_node/src/minify.rs:48 — bindings/binding_minifier_node/src/minify.rs:48-225 | crates/swc/src/lib.rs:1034-1221 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (45 shared lines) · ×1
  • Near-duplicate member pair (45 shared lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:824 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:824-875 | crates/swc_ecma_parser/src/parser/stmt.rs:943-994 — 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.
D4 · Code Duplication · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:697 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:697-849 | crates/swc_ecma_parser/src/lexer/mod.rs:1126-1258 — 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.
D4 · Code Duplication · Near-duplicate member pair (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) crates/swc_ecma_transforms_base/src/rename/ops.rs:396 — crates/swc_ecma_transforms_base/src/rename/ops.rs:396-455 | crates/swc_ecma_transforms_base/src/rename/ops.rs:530-589 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (35 shared lines) · ×1
  • Near-duplicate member pair (35 shared lines) crates/swc_html_parser/src/parser/mod.rs:8364 — crates/swc_html_parser/src/parser/mod.rs:8364-8495 | crates/swc_xml_parser/src/parser/mod.rs:508-570 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (25 shared lines) · ×1
  • Near-duplicate member pair (25 shared lines) crates/swc_ecma_parser/src/parser/stmt.rs:1797 — crates/swc_ecma_parser/src/parser/stmt.rs:1797-1851 | crates/swc_ecma_parser/src/parser/stmt.rs:1853-1928 — 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.
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/swc_ecma_lints/src/rules/dot_notation.rs:54 — crates/swc_ecma_lints/src/rules/dot_notation.rs:54-70 | crates/swc_ecma_lints/src/rules/eqeqeq.rs:46-58 | crates/swc_ecma_lints/src/rules/no_alert.rs:64-76 | crates/swc_ecma_lints/src/rules/no_bitwise.rs:98-110 | crates/swc_ecma_lints/src/rules/no_compare_neg_zero.rs:29-41 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:189-209 | crates/swc_ecma_lints/src/rules/no_empty_pattern.rs:29-41 | crates/swc_ecma_lints/src/rules/no_loop_func.rs:52-82 | crates/swc_ecma_lints/src/rules/no_obj_calls.rs:41-53 | crates/swc_ecma_lints/src/rules/no_param_reassign.rs:55-67 | crates/swc_ecma_lints/src/rules/no_prototype_builtins.rs:43-56 | crates/swc_ecma_lints/src/rules/prefer_const.rs:79-91 | crates/swc_ecma_lints/src/rules/yoda.rs:58-75 — 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 (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2001 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2001-2042 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2049-2095 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2102-2145 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2152-2195 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2202-2248 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2255-2298 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2305-2344 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Edited copy of a member (391 corresponding lines) · ×1
  • Edited copy of a member (391 corresponding lines) crates/swc_ecma_lexer/src/common/parser/module_item.rs:368 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:368-758 | crates/swc_ecma_parser/src/parser/module_item.rs:413-900 — These two members are one piece of code written twice and then edited apart: 391 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (270 corresponding lines) · ×1
  • Edited copy of a member (270 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:1080 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:1080-1349 | crates/swc_ecma_parser/src/parser/stmt.rs:1973-2294 — These two members are one piece of code written twice and then edited apart: 270 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (215 corresponding lines) · ×1
  • Edited copy of a member (215 corresponding lines) crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1371 — crates/swc_ecma_lexer/src/common/parser/class_and_fn.rs:1371-1589 | crates/swc_ecma_parser/src/parser/class_and_fn.rs:1692-1906 — These two members are one piece of code written twice and then edited apart: 215 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (135 corresponding lines) · ×1
  • Edited copy of a member (135 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:374 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:374-508 | crates/swc_ecma_parser/src/parser/stmt.rs:399-565 — These two members are one piece of code written twice and then edited apart: 135 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (92 corresponding lines) · ×1
  • Edited copy of a member (92 corresponding lines) crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1216 — crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1216-1307 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1309-1421 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (87 corresponding lines) · ×1
  • Edited copy of a member (87 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:954 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:954-1040 | crates/swc_ecma_parser/src/parser/typescript.rs:2168-2259 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (101 corresponding lines) · ×1
  • Edited copy of a member (101 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1695 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1695-1795 | crates/swc_ecma_parser/src/lexer/mod.rs:1916-2020 — These two members are one piece of code written twice and then edited apart: 101 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) crates/swc_sourcemap/src/lazy/mod.rs:511 — crates/swc_sourcemap/src/lazy/mod.rs:511-600 | crates/swc_sourcemap/src/types.rs:1483-1565 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (88 corresponding lines) · ×1
  • Edited copy of a member (88 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1043 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1043-1140 | crates/swc_ecma_parser/src/lexer/mod.rs:1427-1514 — These two members are one piece of code written twice and then edited apart: 88 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) crates/swc_ecma_lexer/src/common/parser/module_item.rs:94 — crates/swc_ecma_lexer/src/common/parser/module_item.rs:94-192 | crates/swc_ecma_parser/src/parser/module_item.rs:65-166 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) crates/swc_compiler_base/src/source_map_scopes.rs:443 — crates/swc_compiler_base/src/source_map_scopes.rs:443-525 | crates/swc_compiler_base/src/source_map_scopes.rs:534-608 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (82 corresponding lines) · ×1
  • Edited copy of a member (82 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:116 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:116-197 | crates/swc_ecma_parser/src/parser/stmt.rs:130-215 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:576 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:576-651 | crates/swc_ecma_parser/src/lexer/mod.rs:1002-1080 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:945 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:945-1007 | crates/swc_ecma_parser/src/parser/stmt.rs:1064-1129 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (65 corresponding lines) · ×1
  • Edited copy of a member (65 corresponding lines) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1979 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1979-2044 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2052-2116 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (69 corresponding lines) · ×1
  • Edited copy of a member (69 corresponding lines) crates/swc_css_compat/src/compiler/custom_media.rs:70 — crates/swc_css_compat/src/compiler/custom_media.rs:70-152 | crates/swc_css_compat/src/compiler/custom_media.rs:157-225 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) crates/swc_ecma_lexer/src/lexer/mod.rs:265 — crates/swc_ecma_lexer/src/lexer/mod.rs:265-349 | crates/swc_ecma_parser/src/lexer/mod.rs:440-509 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:475 — crates/swc_ecma_lexer/src/common/parser/expr.rs:475-527 | crates/swc_ecma_parser/src/parser/expr.rs:1128-1180 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) crates/swc_ecma_lexer/src/common/parser/stmt.rs:311 — crates/swc_ecma_lexer/src/common/parser/stmt.rs:311-372 | crates/swc_ecma_parser/src/parser/stmt.rs:327-391 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2228 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2228-2286 | crates/swc_ecma_parser/src/parser/typescript.rs:4473-4529 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) crates/swc_ecma_transformer/src/common/statement_injector.rs:113 — crates/swc_ecma_transformer/src/common/statement_injector.rs:113-159 | crates/swc_ecma_transformer/src/common/statement_injector.rs:161-204 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) crates/swc_html_codegen/src/lib.rs:1046 — crates/swc_html_codegen/src/lib.rs:1046-1129 | crates/swc_xml_codegen/src/lib.rs:370-430 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1904 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1904-1965 | crates/swc_ecma_parser/src/lexer/mod.rs:2122-2180 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) crates/swc_ecma_compat_es2015/src/object_super.rs:214 — crates/swc_ecma_compat_es2015/src/object_super.rs:214-267 | crates/swc_ecma_transforms_classes/src/super_field.rs:302-366 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:105 — crates/swc_ecma_lexer/src/common/parser/expr.rs:105-156 | crates/swc_ecma_parser/src/parser/expr.rs:679-733 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 57+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 57+ corresponding lines) crates/swc_css_codegen_macros/src/lib.rs:19 — crates/swc_css_codegen_macros/src/lib.rs:19-77 | crates/swc_html_codegen_macros/src/lib.rs:19-76 | crates/swc_xml_codegen_macros/src/lib.rs:19-75 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 57 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) bindings/binding_core_node/src/transform.rs:166 — bindings/binding_core_node/src/transform.rs:166-211 | bindings/binding_core_node/src/transform.rs:239-279 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) crates/swc_sourcemap/src/encoder.rs:105 — crates/swc_sourcemap/src/encoder.rs:105-147 | crates/swc_sourcemap/src/lazy/mod.rs:649-691 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) crates/swc_ecma_minifier/src/compress/pure/misc.rs:398 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:398-443 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:446-491 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) crates/swc_ecma_lexer/src/common/parser/typescript.rs:2364 — crates/swc_ecma_lexer/src/common/parser/typescript.rs:2364-2394 | crates/swc_ecma_parser/src/parser/typescript.rs:4638-4672 — 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 copies of one member (3 members, 46+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 46+ corresponding lines) crates/swc_css_codegen/src/lib.rs:2623 — crates/swc_css_codegen/src/lib.rs:2623-2671 | crates/swc_css_codegen/src/lib.rs:2673-2718 | crates/swc_css_codegen/src/lib.rs:2720-2784 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:99 — crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:99-138 | crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs:140-183 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) crates/swc_common/src/syntax_pos/hygiene.rs:180 — crates/swc_common/src/syntax_pos/hygiene.rs:180-216 | crates/swc_common/src/syntax_pos/hygiene.rs:233-264 | crates/swc_common/src/syntax_pos/hygiene.rs:408-438 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) crates/swc_ecma_lints/src/rules/no_empty_function.rs:292 — crates/swc_ecma_lints/src/rules/no_empty_function.rs:292-317 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:319-344 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:346-372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/swc_ecma_lexer/src/common/parser/expr.rs:161 — crates/swc_ecma_lexer/src/common/parser/expr.rs:161-180 | crates/swc_ecma_lexer/src/common/parser/typescript.rs:1102-1125 | crates/swc_ecma_parser/src/parser/typescript.rs:2330-2353 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 26+ corresponding lines) crates/swc_css_parser/src/parser/values_and_units/mod.rs:1825 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:1825-1850 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1857-1890 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1897-1928 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2424-2450 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) crates/swc_estree_compat/src/swcify/stmt.rs:435 — crates/swc_estree_compat/src/swcify/stmt.rs:435-459 | crates/swc_estree_compat/src/swcify/stmt.rs:526-551 | crates/swc_estree_compat/src/swcify/stmt.rs:623-652 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:342 — crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:342-353 | crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:355-366 | crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs:368-380 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) crates/swc_css_codegen/src/writer/basic.rs:68 — crates/swc_css_codegen/src/writer/basic.rs:68-94 | crates/swc_html_codegen/src/writer/basic.rs:68-94 | crates/swc_xml_codegen/src/writer/basic.rs:68-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/swc_ecma_lexer/src/common/lexer/number.rs:31 — crates/swc_ecma_lexer/src/common/lexer/number.rs:31-60 | crates/swc_ecma_lexer/src/common/lexer/number.rs:62-72 | crates/swc_ecma_lexer/src/common/lexer/number.rs:74-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) crates/swc_css_codegen/src/lib.rs:600 — crates/swc_css_codegen/src/lib.rs:600-610 | crates/swc_css_codegen/src/lib.rs:731-741 | crates/swc_css_codegen/src/lib.rs:744-753 | crates/swc_css_codegen/src/lib.rs:908-918 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) crates/ast_node/src/encoding/mod.rs:11 — crates/ast_node/src/encoding/mod.rs:11-24 | crates/ast_node/src/encoding/mod.rs:47-59 | crates/ast_node/src/spanned.rs:30-43 | crates/from_variant/src/lib.rs:22-35 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) crates/swc_common/src/errors/emitter.rs:1602 — crates/swc_common/src/errors/emitter.rs:1602-1610 | crates/swc_common/src/errors/emitter.rs:1612-1620 | crates/swc_common/src/errors/emitter.rs:1624-1632 | crates/swc_common/src/errors/emitter.rs:1634-1642 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/swc_css_lints/src/rules/at_rule_no_unknown.rs:19 — crates/swc_css_lints/src/rules/at_rule_no_unknown.rs:19-32 | crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs:22-35 | crates/swc_css_lints/src/rules/no_invalid_position_at_import_rule.rs:21-34 | crates/swc_css_lints/src/rules/unit_no_unknown.rs:19-32 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/swc_common/src/private/content.rs:599 — crates/swc_common/src/private/content.rs:599-607 | crates/swc_common/src/private/content.rs:631-639 | crates/swc_common/src/private/content.rs:667-673 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:821 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:821-824 | bindings/binding_typescript_wasm/src/error_reporter.rs:821-824 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:821-824 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:770 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:770-772 | bindings/binding_typescript_wasm/src/error_reporter.rs:770-772 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:770-772 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (194 lines × 2) · ×1
  • Duplicated block (194 lines × 2) bindings/binding_html_node/src/lib.rs:505 — bindings/binding_html_node/src/lib.rs:505-698 | bindings/binding_html_wasm/src/lib.rs:549-742 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (101 lines × 2) · ×1
  • Duplicated block (101 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3199 — crates/swc_html_parser/src/lexer/mod.rs:3199-3299 | crates/swc_xml_parser/src/lexer/mod.rs:1496-1596 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3199` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (83 lines × 3) · ×1
  • Duplicated block (83 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:529 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:529-611 | bindings/binding_typescript_wasm/src/error_reporter.rs:529-611 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:529-611 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (79 lines × 2) · ×1
  • Duplicated block (79 lines × 2) crates/swc_html_codegen/src/lib.rs:128 — crates/swc_html_codegen/src/lib.rs:128-206 | crates/swc_xml_codegen/src/lib.rs:72-150 — before extracting anything, compare `crates/swc_html_codegen/src/lib.rs` and `crates/swc_xml_codegen/src/lib.rs` as WHOLE FILES: this scan already matched 7 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.
D4 · Code Duplication · Duplicated block (75 lines × 2) · ×1
  • Duplicated block (75 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1213 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1213-1287 | crates/swc_ecma_parser/src/lexer/mod.rs:1587-1661 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1213` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (70–73 lines × 2) · ×1
  • Duplicated block (70–73 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3067 — crates/swc_html_parser/src/lexer/mod.rs:3067-3139 | crates/swc_xml_parser/src/lexer/mod.rs:1382-1451 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3067` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (70 lines × 3) · ×1
  • Duplicated block (70 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:83 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:83-152 | bindings/binding_typescript_wasm/src/error_reporter.rs:83-152 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:83-152 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (66–68 lines × 3) · ×1
  • Duplicated block (66–68 lines × 3) bindings/binding_html_node/src/lib.rs:343 — bindings/binding_html_node/src/lib.rs:343-410 | bindings/binding_html_wasm/src/lib.rs:387-454 | crates/swc_html_minifier/src/lib.rs:2687-2752 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `bindings/binding_html_node/src/lib.rs:343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_html_minifier/src/lib.rs:2685` calls `get_css_options` and `bindings/binding_html_node/src/lib.rs:341` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (67–68 lines × 2) · ×1
  • Duplicated block (67–68 lines × 2) crates/swc_ecma_lexer/src/common/parser/expr_ext.rs:11 — crates/swc_ecma_lexer/src/common/parser/expr_ext.rs:11-78 | crates/swc_ecma_parser/src/parser/util.rs:106-172 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr_ext.rs` and `crates/swc_ecma_parser/src/parser/util.rs` as WHOLE FILES: 93% 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr_ext.rs:11` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (64–66 lines × 3) · ×1
  • Duplicated block (64–66 lines × 3) bindings/binding_html_node/src/lib.rs:430 — bindings/binding_html_node/src/lib.rs:430-495 | bindings/binding_html_wasm/src/lib.rs:474-539 | crates/swc_html_minifier/src/lib.rs:2771-2834 — before extracting anything, compare `bindings/binding_html_node/src/lib.rs` and `bindings/binding_html_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `bindings/binding_html_node/src/lib.rs:430` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (78 lines × 3) · ×1
  • Duplicated block (78 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:364 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:364-441 | bindings/binding_typescript_wasm/src/error_reporter.rs:364-441 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:364-441 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (65 lines × 4) · ×1
  • Duplicated block (65 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:1546 — crates/swc_html_parser/src/lexer/mod.rs:1546-1610 | crates/swc_html_parser/src/lexer/mod.rs:1660-1724 | crates/swc_html_parser/src/lexer/mod.rs:1782-1846 | crates/swc_html_parser/src/lexer/mod.rs:2072-2136 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:1546` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (65 lines × 3) · ×1
  • Duplicated block (65 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:228 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:228-292 | bindings/binding_typescript_wasm/src/error_reporter.rs:228-292 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:228-292 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:2140 — crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:2140-2201 | crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:2215-2276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:2140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (59 lines × 2) · ×1
  • Duplicated block (59 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:4171 — crates/swc_html_parser/src/lexer/mod.rs:4171-4229 | crates/swc_html_parser/src/lexer/mod.rs:4233-4291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (91 lines × 2) · ×1
  • Duplicated block (91 lines × 2) crates/swc_ecma_transforms_module/src/amd.rs:425 — crates/swc_ecma_transforms_module/src/amd.rs:425-515 | crates/swc_ecma_transforms_module/src/umd.rs:171-261 — before extracting anything, compare `crates/swc_ecma_transforms_module/src/amd.rs` and `crates/swc_ecma_transforms_module/src/umd.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_module/src/amd.rs:425` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (55 lines × 3) · ×1
  • Duplicated block (55 lines × 3) bindings/binding_nodejs_support_wasm/src/lib.rs:190 — bindings/binding_nodejs_support_wasm/src/lib.rs:190-244 | bindings/binding_typescript_wasm/src/lib.rs:112-166 | crates/swc_ts_fast_strip_binding/src/lib.rs:68-122 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/lib.rs` and `bindings/binding_typescript_wasm/src/lib.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (54 lines × 3) · ×1
  • Duplicated block (54 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:301 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:301-354 | bindings/binding_typescript_wasm/src/error_reporter.rs:301-354 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:301-354 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1152 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1152-1204 | crates/swc_ecma_parser/src/lexer/mod.rs:1526-1578 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (58 lines × 3) · ×1
  • Duplicated block (58 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:161 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:161-218 | bindings/binding_typescript_wasm/src/error_reporter.rs:161-218 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:161-218 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (45–49 lines × 2) · ×1
  • Duplicated block (45–49 lines × 2) crates/swc_ecma_lexer/src/common/parser/pat.rs:121 — crates/swc_ecma_lexer/src/common/parser/pat.rs:121-165 | crates/swc_ecma_parser/src/parser/pat.rs:261-309 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/pat.rs` and `crates/swc_ecma_parser/src/parser/pat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/pat.rs:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (42 lines × 3) · ×1
  • Duplicated block (42 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:693 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:693-734 | bindings/binding_typescript_wasm/src/error_reporter.rs:693-734 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:693-734 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:4968 — crates/swc_html_parser/src/lexer/mod.rs:4968-5007 | crates/swc_xml_parser/src/lexer/mod.rs:3142-3181 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (37–39 lines × 2) · ×1
  • Duplicated block (37–39 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:577 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:577-613 | crates/swc_ecma_parser/src/lexer/mod.rs:1003-1041 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (32–39 lines × 2) · ×1
  • Duplicated block (32–39 lines × 2) crates/swc_html_parser/src/parser/mod.rs:2359 — crates/swc_html_parser/src/parser/mod.rs:2359-2397 | crates/swc_html_parser/src/parser/mod.rs:2453-2484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2359` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1728 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1728-1765 | crates/swc_ecma_parser/src/lexer/mod.rs:1953-1990 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:1728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) crates/swc_xml_parser/src/lexer/mod.rs:2094 — crates/swc_xml_parser/src/lexer/mod.rs:2094-2131 | crates/swc_xml_parser/src/lexer/mod.rs:2134-2170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (27–38 lines × 2) · ×1
  • Duplicated block (27–38 lines × 2) crates/swc_xml_parser/src/lexer/mod.rs:2425 — crates/swc_xml_parser/src/lexer/mod.rs:2425-2462 | crates/swc_xml_parser/src/lexer/mod.rs:3014-3040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:2425` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_xml_parser/src/lexer/mod.rs:2415` calls `cur_pos` and `crates/swc_xml_parser/src/lexer/mod.rs:3005` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37 lines × 3) · ×1
  • Duplicated block (37 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:628 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:628-664 | bindings/binding_typescript_wasm/src/error_reporter.rs:628-664 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:628-664 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (35–36 lines × 3) · ×1
  • Duplicated block (35–36 lines × 3) crates/swc_css_codegen_macros/src/lib.rs:20 — crates/swc_css_codegen_macros/src/lib.rs:20-55 | crates/swc_html_codegen_macros/src/lib.rs:20-54 | crates/swc_xml_codegen_macros/src/lib.rs:20-54 — before extracting anything, compare `crates/swc_css_codegen_macros/src/lib.rs` and `crates/swc_html_codegen_macros/src/lib.rs` 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_codegen_macros/src/lib.rs:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–36 lines × 2) · ×1
  • Duplicated block (29–36 lines × 2) crates/swc_html_parser/src/parser/mod.rs:4087 — crates/swc_html_parser/src/parser/mod.rs:4087-4115 | crates/swc_html_parser/src/parser/mod.rs:4126-4161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:4087` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (35 lines × 4) · ×1
  • Duplicated block (35 lines × 4) crates/swc_html_parser/src/lexer/mod.rs:484 — crates/swc_html_parser/src/lexer/mod.rs:484-518 | crates/swc_html_parser/src/lexer/mod.rs:524-558 | crates/swc_html_parser/src/lexer/mod.rs:894-928 | crates/swc_html_parser/src/lexer/mod.rs:1031-1065 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `c` to `u8` in one and `Option<char>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:658 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:658-692 | crates/swc_ecma_parser/src/lexer/mod.rs:1087-1121 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (20–34 lines × 2) · ×1
  • Duplicated block (20–34 lines × 2) crates/swc_html_parser/src/parser/mod.rs:2397 — crates/swc_html_parser/src/parser/mod.rs:2397-2430 | crates/swc_html_parser/src/parser/mod.rs:6036-6055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2397` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (31–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3333 — crates/swc_html_parser/src/lexer/mod.rs:3333-3365 | crates/swc_xml_parser/src/lexer/mod.rs:1630-1660 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3333` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3811 — crates/swc_html_parser/src/lexer/mod.rs:3811-3843 | crates/swc_html_parser/src/lexer/mod.rs:3873-3905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3811` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–32 lines × 2) · ×1
  • Duplicated block (29–32 lines × 2) crates/swc_node_bundler/src/loaders/swc.rs:169 — crates/swc_node_bundler/src/loaders/swc.rs:169-200 | crates/swc_node_bundler/src/loaders/swc.rs:266-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_node_bundler/src/loaders/swc.rs:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–31 lines × 2) · ×1
  • Duplicated block (14–31 lines × 2) crates/swc_html_parser/src/parser/mod.rs:3195 — crates/swc_html_parser/src/parser/mod.rs:3195-3208 | crates/swc_html_parser/src/parser/mod.rs:3404-3434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:3195` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (30 lines × 5) · ×1
  • Duplicated block (30 lines × 5) crates/swc_css_parser/src/parser/values_and_units/mod.rs:422 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:422-451 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:533-562 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:649-678 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:782-811 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1546-1575 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:422` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3436 — crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3436-3465 | crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3772-3800 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_proposal/src/decorator_impl.rs:3436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&mut Vec<ModuleItem>` in one and `&mut Vec<Stmt>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) crates/swc_html_parser/src/parser/mod.rs:1544 — crates/swc_html_parser/src/parser/mod.rs:1544-1573 | crates/swc_html_parser/src/parser/mod.rs:1638-1665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1544` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–30 lines × 2) · ×1
  • Duplicated block (12–30 lines × 2) crates/swc_html_parser/src/parser/mod.rs:5445 — crates/swc_html_parser/src/parser/mod.rs:5445-5456 | crates/swc_html_parser/src/parser/mod.rs:5458-5487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:5458` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2900 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2900-2927 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:3000-3026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2900` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1586 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1586-1613 | crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1618-1643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:1586` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–28 lines × 2) · ×1
  • Duplicated block (16–28 lines × 2) crates/swc_html_parser/src/parser/mod.rs:698 — crates/swc_html_parser/src/parser/mod.rs:698-713 | crates/swc_html_parser/src/parser/mod.rs:2317-2344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:698` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_html_parser/src/parser/mod.rs:2316` calls `reconstruct_active_formatting_elements` and `crates/swc_html_parser/src/parser/mod.rs:697` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:1233 — crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:1233-1272 | crates/swc_ecma_transformer/src/es2018/object_rest_spread.rs:1286-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.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) crates/swc_ecma_utils/src/function/fn_env_hoister.rs:92 — crates/swc_ecma_utils/src/function/fn_env_hoister.rs:92-117 | crates/swc_ecma_utils/src/function/fn_env_hoister.rs:155-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_utils/src/function/fn_env_hoister.rs:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:445 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:445-470 | bindings/binding_typescript_wasm/src/error_reporter.rs:445-470 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:445-470 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1267 — crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1267-1292 | crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1381-1406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/unused.rs:1267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn ignore_unused_args_of_call(&mut` in one and `crate) fn ignore_unused_args_of_new(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (25 lines × 5) · ×1
  • Duplicated block (25 lines × 5) crates/swc_html_parser/src/parser/mod.rs:1679 — crates/swc_html_parser/src/parser/mod.rs:1679-1703 | crates/swc_html_parser/src/parser/mod.rs:2136-2160 | crates/swc_html_parser/src/parser/mod.rs:5093-5117 | crates/swc_html_parser/src/parser/mod.rs:6297-6321 | crates/swc_html_parser/src/parser/mod.rs:6467-6491 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1679` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) crates/swc_css_codegen/src/writer/basic.rs:244 — crates/swc_css_codegen/src/writer/basic.rs:244-268 | crates/swc_html_codegen/src/writer/basic.rs:238-262 | crates/swc_xml_codegen/src/writer/basic.rs:238-262 — before extracting anything, compare `crates/swc_css_codegen/src/writer/basic.rs` and `crates/swc_html_codegen/src/writer/basic.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2226 — crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2226-2249 | crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs:297-318 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs:2226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 5) · ×1
  • Duplicated block (23 lines × 5) crates/swc_css_parser/src/parser/values_and_units/mod.rs:577 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:577-599 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:693-715 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:901-923 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1368-1390 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1453-1475 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:577` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) crates/swc_html_parser/src/parser/mod.rs:2570 — crates/swc_html_parser/src/parser/mod.rs:2570-2592 | crates/swc_html_parser/src/parser/mod.rs:2630-2652 | crates/swc_html_parser/src/parser/mod.rs:2692-2714 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2570` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) crates/swc_bundler/src/bundler/chunk/merge.rs:803 — crates/swc_bundler/src/bundler/chunk/merge.rs:803-824 | crates/swc_bundler/src/bundler/chunk/merge.rs:981-1003 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/bundler/chunk/merge.rs:803` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 6) · ×1
  • Duplicated block (22 lines × 6) crates/swc_css_parser/src/parser/values_and_units/mod.rs:584 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:584-605 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:700-721 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:908-929 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1375-1396 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1460-1481 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1504-1525 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:584` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (21–22 lines × 4) · ×1
  • Duplicated block (21–22 lines × 4) crates/swc_css_parser/src/lexer/mod.rs:753 — crates/swc_css_parser/src/lexer/mod.rs:753-773 | crates/swc_css_parser/src/lexer/mod.rs:877-897 | crates/swc_css_parser/src/lexer/mod.rs:1053-1074 | crates/swc_css_parser/src/lexer/mod.rs:1470-1490 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/lexer/mod.rs:753` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) crates/swc_css_codegen/src/lib.rs:2634 — crates/swc_css_codegen/src/lib.rs:2634-2655 | crates/swc_css_codegen/src/lib.rs:2678-2699 | crates/swc_css_codegen/src/lib.rs:2734-2755 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_css_codegen/src/lib.rs:2630` calls `push` and `crates/swc_css_codegen/src/lib.rs:2677` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–22 lines × 2) · ×1
  • Duplicated block (15–22 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3002 — crates/swc_html_parser/src/lexer/mod.rs:3002-3023 | crates/swc_xml_parser/src/lexer/mod.rs:386-400 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3002` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) crates/swc_html_parser/src/lexer/mod.rs:3948 — crates/swc_html_parser/src/lexer/mod.rs:3948-3969 | crates/swc_html_parser/src/lexer/mod.rs:4009-4029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3948` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/swc_html_parser/src/parser/mod.rs:1955 — crates/swc_html_parser/src/parser/mod.rs:1955-1974 | crates/swc_html_parser/src/parser/mod.rs:2089-2110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1955` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) crates/swc_html_parser/src/lexer/mod.rs:2993 — crates/swc_html_parser/src/lexer/mod.rs:2993-3013 | crates/swc_xml_parser/src/lexer/mod.rs:1312-1332 | crates/swc_xml_parser/src/lexer/mod.rs:1358-1378 — before extracting anything, compare `crates/swc_html_parser/src/lexer/mod.rs` and `crates/swc_xml_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 608 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:2993` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–21 lines × 2) · ×1
  • Duplicated block (14–21 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:1350 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:1350-1370 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:1379-1392 — both copies are in the same file, so extract the 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) crates/swc_html_parser/src/lexer/mod.rs:3692 — crates/swc_html_parser/src/lexer/mod.rs:3692-3711 | crates/swc_html_parser/src/lexer/mod.rs:3756-3775 | crates/swc_html_parser/src/lexer/mod.rs:4078-4097 | crates/swc_html_parser/src/lexer/mod.rs:4142-4161 | crates/swc_html_parser/src/lexer/mod.rs:4308-4327 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:3692` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) crates/swc_ecma_parser/src/parser/object.rs:89 — crates/swc_ecma_parser/src/parser/object.rs:89-106 | crates/swc_ecma_parser/src/parser/object.rs:328-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_parser/src/parser/object.rs:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–19 lines × 6) · ×1
  • Duplicated block (10–19 lines × 6) crates/swc_html_parser/src/parser/mod.rs:1612 — crates/swc_html_parser/src/parser/mod.rs:1612-1621 | crates/swc_html_parser/src/parser/mod.rs:1700-1717 | crates/swc_html_parser/src/parser/mod.rs:2157-2175 | crates/swc_html_parser/src/parser/mod.rs:5114-5131 | crates/swc_html_parser/src/parser/mod.rs:5695-5712 | crates/swc_html_parser/src/parser/mod.rs:6318-6332 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1700` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–19 lines × 5) · ×1
  • Duplicated block (12–19 lines × 5) crates/swc_html_parser/src/parser/mod.rs:2260 — crates/swc_html_parser/src/parser/mod.rs:2260-2278 | crates/swc_html_parser/src/parser/mod.rs:6446-6457 | crates/swc_html_parser/src/parser/mod.rs:6534-6545 | crates/swc_html_parser/src/parser/mod.rs:6604-6615 | crates/swc_html_parser/src/parser/mod.rs:6690-6701 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:2260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) crates/swc_bundler/src/modules/sort/stmt.rs:262 — crates/swc_bundler/src/modules/sort/stmt.rs:262-275 | crates/swc_bundler/src/modules/sort/stmt.rs:280-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_bundler/src/modules/sort/stmt.rs:262` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) crates/swc_ecma_parser/src/parser/typescript.rs:309 — crates/swc_ecma_parser/src/parser/typescript.rs:309-325 | crates/swc_ecma_parser/src/parser/typescript.rs:371-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) crates/swc_html_minifier/src/lib.rs:1462 — crates/swc_html_minifier/src/lib.rs:1462-1480 | crates/swc_html_minifier/src/lib.rs:1500-1515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_minifier/src/lib.rs:1462` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 5) · ×1
  • Duplicated block (18 lines × 5) crates/swc_html_parser/src/lexer/mod.rs:435 — crates/swc_html_parser/src/lexer/mod.rs:435-452 | crates/swc_html_parser/src/lexer/mod.rs:493-510 | crates/swc_html_parser/src/lexer/mod.rs:533-550 | crates/swc_html_parser/src/lexer/mod.rs:903-920 | crates/swc_html_parser/src/lexer/mod.rs:1040-1057 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/lexer/mod.rs:435` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `c` to `u8` in one and `Option<char>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_html_parser/src/lexer/mod.rs:492` calls `push` and `crates/swc_html_parser/src/lexer/mod.rs:434` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–18 lines × 2) · ×1
  • Duplicated block (11–18 lines × 2) crates/swc_ecma_lexer/src/common/lexer/mod.rs:2052 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:2052-2062 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:2121-2138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:2121` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:393 — crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:393-410 | crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:413-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&mut ForInStmt` in one and `&mut ForOfStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (27–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) crates/swc_html_parser/src/parser/mod.rs:396 — crates/swc_html_parser/src/parser/mod.rs:396-424 | crates/swc_xml_parser/src/parser/mod.rs:113-139 — before extracting anything, compare `crates/swc_html_parser/src/parser/mod.rs` and `crates/swc_xml_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 7) · ×1
  • Duplicated block (17 lines × 7) crates/swc_css_parser/src/parser/values_and_units/mod.rs:2002 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:2002-2018 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2050-2066 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2103-2119 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2153-2169 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2203-2219 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2256-2272 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:2306-2322 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2002` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2121` calls `is_time_unit`, `Err`, `Expected` and `crates/swc_css_parser/src/parser/values_and_units/mod.rs:2022` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–17 lines × 7) · ×1
  • Duplicated block (16–17 lines × 7) crates/swc_xml_parser/src/lexer/mod.rs:2670 — crates/swc_xml_parser/src/lexer/mod.rs:2670-2685 | crates/swc_xml_parser/src/lexer/mod.rs:2725-2741 | crates/swc_xml_parser/src/lexer/mod.rs:2761-2777 | crates/swc_xml_parser/src/lexer/mod.rs:2797-2813 | crates/swc_xml_parser/src/lexer/mod.rs:2859-2874 | crates/swc_xml_parser/src/lexer/mod.rs:2947-2963 | crates/swc_xml_parser/src/lexer/mod.rs:2983-2999 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_xml_parser/src/lexer/mod.rs:2670` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_xml_parser/src/lexer/mod.rs:2669` calls `emit_error` and `crates/swc_xml_parser/src/lexer/mod.rs:2858` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) crates/ast_node/src/encoding/decode.rs:140 — crates/ast_node/src/encoding/decode.rs:140-163 | crates/ast_node/src/encoding/encode.rs:109-131 — before extracting anything, compare `crates/ast_node/src/encoding/decode.rs` and `crates/ast_node/src/encoding/encode.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast_node/src/encoding/decode.rs:140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) crates/swc_ecma_minifier/src/compress/optimize/arguments.rs:30 — crates/swc_ecma_minifier/src/compress/optimize/arguments.rs:30-46 | crates/swc_ecma_minifier/src/compress/optimize/arguments.rs:58-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/arguments.rs:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) crates/swc_html_parser/src/parser/mod.rs:6217 — crates/swc_html_parser/src/parser/mod.rs:6217-6233 | crates/swc_html_parser/src/parser/mod.rs:6488-6501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:6217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) crates/swc_ecma_lexer/src/common/lexer/mod.rs:290 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:290-305 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:396-410 | crates/swc_ecma_parser/src/lexer/mod.rs:769-784 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) crates/swc_css_parser/src/parser/values_and_units/mod.rs:960 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:960-974 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1009-1023 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1077-1091 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1126-1140 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1172-1186 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:960` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–15 lines × 4) · ×1
  • Duplicated block (11–15 lines × 4) crates/swc_ecma_lexer/src/common/parser/expr.rs:398 — crates/swc_ecma_lexer/src/common/parser/expr.rs:398-408 | crates/swc_ecma_lexer/src/common/parser/typescript.rs:2894-2904 | crates/swc_ecma_parser/src/parser/expr.rs:166-180 | crates/swc_ecma_parser/src/parser/typescript.rs:5560-5570 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/expr.rs` and `crates/swc_ecma_parser/src/parser/expr.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/expr.rs:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) crates/swc_html_parser/src/parser/mod.rs:3192 — crates/swc_html_parser/src/parser/mod.rs:3192-3206 | crates/swc_html_parser/src/parser/mod.rs:3401-3415 | crates/swc_html_parser/src/parser/mod.rs:3681-3695 | crates/swc_html_parser/src/parser/mod.rs:5562-5576 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_html_parser/src/parser/mod.rs:3696` calls `clear_to_last_marker` and `crates/swc_html_parser/src/parser/mod.rs:3207` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) crates/swc_ecma_minifier/src/compress/pure/misc.rs:1931 — crates/swc_ecma_minifier/src/compress/pure/misc.rs:1931-1943 | crates/swc_ecma_minifier/src/compress/pure/misc.rs:1948-1962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/misc.rs:1931` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 11) · ×1
  • Duplicated block (14 lines × 11) crates/swc_css_parser/src/parser/values_and_units/mod.rs:420 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:420-433 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:531-544 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:575-588 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:647-660 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:691-704 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:780-793 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:899-912 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1257-1270 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1366-1379 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1451-1464 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1544-1557 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:420` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14 lines × 7) · ×1
  • Duplicated block (14 lines × 7) crates/swc_html_parser/src/parser/mod.rs:1606 — crates/swc_html_parser/src/parser/mod.rs:1606-1619 | crates/swc_html_parser/src/parser/mod.rs:1694-1707 | crates/swc_html_parser/src/parser/mod.rs:2151-2164 | crates/swc_html_parser/src/parser/mod.rs:5108-5121 | crates/swc_html_parser/src/parser/mod.rs:5689-5702 | crates/swc_html_parser/src/parser/mod.rs:6312-6325 | crates/swc_html_parser/src/parser/mod.rs:6482-6495 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_html_parser/src/parser/mod.rs:1606` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) bindings/binding_core_node/src/util.rs:49 — bindings/binding_core_node/src/util.rs:49-62 | bindings/binding_html_node/src/util.rs:21-34 | bindings/binding_html_wasm/src/util.rs:21-34 | bindings/binding_minifier_node/src/util.rs:42-55 — before extracting anything, compare `bindings/binding_core_node/src/util.rs` and `bindings/binding_minifier_node/src/util.rs` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/binding_core_node/src/util.rs:49` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) crates/swc_ecma_transforms_base/src/resolver/mod.rs:1334 — crates/swc_ecma_transforms_base/src/resolver/mod.rs:1334-1345 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1348-1361 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1364-1375 | crates/swc_ecma_transforms_base/src/resolver/mod.rs:1437-1448 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `ty` to `&mut TsConstructorType` in one and `&mut TsFnType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1908 — crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1908-1920 | crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1937-1949 | crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1972-1985 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1908` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) crates/swc_css_parser/src/parser/values_and_units/mod.rs:250 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:250-262 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:266-278 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:293-305 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:310-322 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:335-347 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_css_parser/src/parser/values_and_units/mod.rs:246` calls `skip_ws` and `crates/swc_css_parser/src/parser/values_and_units/mod.rs:306` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:212 — crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:212-223 | crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:228-239 | crates/swc_ecma_compat_es2022/src/class_properties/mod.rs:273-285 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) crates/ast_node/src/encoding/decode.rs:9 — crates/ast_node/src/encoding/decode.rs:9-20 | crates/ast_node/src/encoding/decode.rs:190-199 | crates/ast_node/src/encoding/encode.rs:173-182 — before extracting anything, compare `crates/ast_node/src/encoding/decode.rs` and `crates/ast_node/src/encoding/encode.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) crates/swc/src/config/mod.rs:447 — crates/swc/src/config/mod.rs:447-458 | crates/swc/src/config/mod.rs:489-499 | crates/swc/src/config/mod.rs:523-533 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc/src/config/mod.rs:447` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9–12 lines × 3) · ×1
  • Duplicated block (9–12 lines × 3) crates/swc_ecma_lexer/src/common/lexer/mod.rs:311 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:311-319 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:339-350 | crates/swc_ecma_parser/src/lexer/mod.rs:790-798 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–12 lines × 3) · ×1
  • Duplicated block (4–12 lines × 3) crates/swc_ecma_transforms_typescript/src/shared.rs:21 — crates/swc_ecma_transforms_typescript/src/shared.rs:21-32 | crates/swc_ecma_transforms_typescript/src/transform.rs:583-586 | crates/swc_ecma_utils/src/lib.rs:2609-2620 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 14) · ×1
  • Duplicated block (11 lines × 14) crates/swc_css_parser/src/parser/values_and_units/mod.rs:418 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:418-428 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:459-469 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:529-539 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:573-583 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:645-655 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:689-699 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:778-788 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:852-862 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:897-907 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1255-1265 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1364-1374 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1449-1459 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1490-1500 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1542-1552 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:418` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_css_parser/src/parser/values_and_units/mod.rs:470` calls `is_math_function`, `Ok`, `Some` and `crates/swc_css_parser/src/parser/values_and_units/mod.rs:429` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) crates/swc_ecma_transforms_testing/src/lib.rs:264 — crates/swc_ecma_transforms_testing/src/lib.rs:264-273 | crates/swc_ecma_transforms_testing/src/lib.rs:542-551 | crates/swc_ecma_transforms_testing/src/lib.rs:595-605 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transforms_testing/src/lib.rs:595` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 13) · ×1
  • Duplicated block (10 lines × 13) crates/swc_ecma_lints/src/rules/dot_notation.rs:61 — crates/swc_ecma_lints/src/rules/dot_notation.rs:61-70 | crates/swc_ecma_lints/src/rules/eqeqeq.rs:49-58 | crates/swc_ecma_lints/src/rules/no_alert.rs:67-76 | crates/swc_ecma_lints/src/rules/no_bitwise.rs:101-110 | crates/swc_ecma_lints/src/rules/no_compare_neg_zero.rs:32-41 | crates/swc_ecma_lints/src/rules/no_empty_function.rs:200-209 | crates/swc_ecma_lints/src/rules/no_empty_pattern.rs:32-41 | crates/swc_ecma_lints/src/rules/no_loop_func.rs:73-82 | crates/swc_ecma_lints/src/rules/no_obj_calls.rs:44-53 | crates/swc_ecma_lints/src/rules/no_param_reassign.rs:58-67 | crates/swc_ecma_lints/src/rules/no_prototype_builtins.rs:47-56 | crates/swc_ecma_lints/src/rules/prefer_const.rs:82-91 | crates/swc_ecma_lints/src/rules/yoda.rs:66-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 13 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lints/src/rules/dot_notation.rs:61` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 8) · ×1
  • Duplicated block (10 lines × 8) crates/swc_html_parser/src/parser/mod.rs:1612 — crates/swc_html_parser/src/parser/mod.rs:1612-1621 | crates/swc_html_parser/src/parser/mod.rs:1700-1709 | crates/swc_html_parser/src/parser/mod.rs:2157-2166 | crates/swc_html_parser/src/parser/mod.rs:5114-5123 | crates/swc_html_parser/src/parser/mod.rs:5695-5704 | crates/swc_html_parser/src/parser/mod.rs:6217-6226 | crates/swc_html_parser/src/parser/mod.rs:6318-6327 | crates/swc_html_parser/src/parser/mod.rs:6488-6497 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) crates/swc_css_parser/src/parser/values_and_units/mod.rs:733 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:733-742 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:767-776 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1244-1253 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1531-1540 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:733` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) crates/swc_ecma_lexer/src/common/lexer/mod.rs:313 — crates/swc_ecma_lexer/src/common/lexer/mod.rs:313-321 | crates/swc_ecma_lexer/src/common/lexer/mod.rs:343-352 | crates/swc_ecma_parser/src/lexer/mod.rs:792-800 | crates/swc_ecma_parser/src/lexer/mod.rs:822-831 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/lexer/mod.rs` and `crates/swc_ecma_parser/src/lexer/mod.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 694 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/lexer/mod.rs:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 14) · ×1
  • Duplicated block (8–9 lines × 14) crates/swc_css_parser/src/parser/values_and_units/mod.rs:458 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:458-465 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:572-579 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:688-695 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:777-784 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:851-858 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:896-903 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:959-967 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1008-1016 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1076-1084 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1125-1133 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1171-1179 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1363-1370 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1448-1455 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1489-1496 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1043 — crates/swc_ecma_minifier/src/compress/optimize/mod.rs:1043-1050 | crates/swc_ecma_minifier/src/compress/optimize/sequences.rs:1436-1444 | crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:1512-1519 — 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) crates/swc_ecma_minifier/src/compress/pure/vars.rs:103 — crates/swc_ecma_minifier/src/compress/pure/vars.rs:103-111 | crates/swc_ecma_minifier/src/compress/pure/vars.rs:123-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/compress/pure/vars.rs:103` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) crates/swc_ecma_lexer/src/common/parser/mod.rs:236 — crates/swc_ecma_lexer/src/common/parser/mod.rs:236-242 | crates/swc_ecma_lexer/src/common/parser/mod.rs:247-253 | crates/swc_ecma_parser/src/parser/mod.rs:1341-1347 | crates/swc_ecma_parser/src/parser/mod.rs:1352-1358 — before extracting anything, compare `crates/swc_ecma_lexer/src/common/parser/mod.rs` and `crates/swc_ecma_parser/src/parser/mod.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/common/parser/mod.rs:236` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `&Self::Token` in one and `Token` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) crates/swc_css_minifier/src/compressor/calc_sum.rs:457 — crates/swc_css_minifier/src/compressor/calc_sum.rs:457-462 | crates/swc_css_minifier/src/compressor/calc_sum.rs:466-471 | crates/swc_css_minifier/src/compressor/calc_sum.rs:475-480 | crates/swc_css_minifier/src/compressor/calc_sum.rs:484-489 | crates/swc_css_minifier/src/compressor/calc_sum.rs:493-498 | crates/swc_css_minifier/src/compressor/calc_sum.rs:502-507 | crates/swc_css_minifier/src/compressor/calc_sum.rs:511-516 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_minifier/src/compressor/calc_sum.rs:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (3–6 lines × 4) · ×1
  • Duplicated block (3–6 lines × 4) crates/swc_ecma_transformer/src/es2015/instanceof.rs:95 — crates/swc_ecma_transformer/src/es2015/instanceof.rs:95-100 | crates/swc_ecma_transformer/src/es2015/instanceof.rs:112-117 | crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:182-184 | crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:197-199 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_transformer/src/es2015/instanceof.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/swc_ecma_transformer/src/es2015/instanceof.rs:94` calls `Some`, `Expr`, `first` and `crates/swc_ecma_transformer/src/es2015/typeof_symbol.rs:182` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (39 lines × 3) · ×1
  • Duplicated block (39 lines × 3) crates/swc_css_codegen/src/ctx.rs:11 — crates/swc_css_codegen/src/ctx.rs:11-50 | crates/swc_html_codegen/src/ctx.rs:11-49 | crates/swc_xml_codegen/src/ctx.rs:11-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_codegen/src/ctx.rs:11` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) crates/swc_ecma_minifier/src/usage_analyzer/alias/ctx.rs:8 — crates/swc_ecma_minifier/src/usage_analyzer/alias/ctx.rs:8-50 | crates/swc_ecma_minifier/src/usage_analyzer/analyzer/ctx.rs:15-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_minifier/src/usage_analyzer/alias/ctx.rs:8` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) bindings/binding_nodejs_support_wasm/src/error_reporter.rs:860 — bindings/binding_nodejs_support_wasm/src/error_reporter.rs:860-864 | bindings/binding_typescript_wasm/src/error_reporter.rs:860-864 | crates/swc_ts_fast_strip_binding/src/error_reporter.rs:860-864 — before extracting anything, compare `bindings/binding_nodejs_support_wasm/src/error_reporter.rs` and `bindings/binding_typescript_wasm/src/error_reporter.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 617 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) crates/swc_ecma_lints/src/rules/constructor_super.rs:69 — crates/swc_ecma_lints/src/rules/constructor_super.rs:69-79 | crates/swc_ecma_lints/src/rules/no_restricted_syntax.rs:86-96 | crates/swc_ecma_lints/src/rules/no_throw_literal.rs:32-42 | crates/swc_ecma_lints/src/rules/prefer_object_spread.rs:61-71 | crates/swc_ecma_lints/src/rules/symbol_description.rs:79-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 9) · ×1
  • Duplicated block (11 lines × 9) crates/swc_ecma_lints/src/rules/default_case_last.rs:31 — crates/swc_ecma_lints/src/rules/default_case_last.rs:31-41 | crates/swc_ecma_lints/src/rules/no_await_in_loop.rs:35-45 | crates/swc_ecma_lints/src/rules/no_cond_assign.rs:33-43 | crates/swc_ecma_lints/src/rules/no_debugger.rs:31-41 | crates/swc_ecma_lints/src/rules/no_new.rs:31-41 | crates/swc_ecma_lints/src/rules/no_new_object.rs:41-51 | crates/swc_ecma_lints/src/rules/no_sparse_arrays.rs:31-41 | crates/swc_ecma_lints/src/rules/no_var.rs:31-41 | crates/swc_ecma_lints/src/rules/valid_typeof.rs:53-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 9 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) crates/swc_ecma_minifier/src/util/mod.rs:71 — crates/swc_ecma_minifier/src/util/mod.rs:71-78 | crates/swc_ecma_minifier/src/util/mod.rs:80-87 | crates/swc_ecma_minifier/src/util/mod.rs:93-100 | crates/swc_ecma_utils/src/lib.rs:227-234 | crates/swc_ecma_utils/src/lib.rs:237-244 | crates/swc_ecma_utils/src/lib.rs:247-254 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) crates/swc_sourcemap/src/hermes.rs:76 — crates/swc_sourcemap/src/hermes.rs:76-81 | crates/swc_sourcemap/src/hermes.rs:87-92 | crates/swc_sourcemap/src/types.rs:533-538 | crates/swc_sourcemap/src/types.rs:599-604 | crates/swc_sourcemap/src/types.rs:1339-1344 | crates/swc_sourcemap/src/types.rs:1355-1360 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/swc_sourcemap/src/types.rs:1348` calls `encode` and `crates/swc_sourcemap/src/hermes.rs:87` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17 lines × 16) · ×1
  • Duplicated block (17 lines × 16) crates/swc_css_parser/src/parser/values_and_units/mod.rs:433 — crates/swc_css_parser/src/parser/values_and_units/mod.rs:433-451 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:477-495 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:544-562 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:588-606 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:660-678 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:704-722 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:747-763 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:793-811 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:912-930 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:977-995 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1026-1044 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1094-1112 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1143-1161 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1270-1288 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1508-1526 | crates/swc_css_parser/src/parser/values_and_units/mod.rs:1557-1575 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_css_parser/src/parser/values_and_units/mod.rs:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) crates/swc_ecma_lexer/src/parser/mod.rs:240 — crates/swc_ecma_lexer/src/parser/mod.rs:240-262 | crates/swc_ecma_parser/src/parser/mod.rs:610-630 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/swc_ecma_lexer/src/parser/mod.rs:240` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Node.js 20 package.json:109 — package.json declares Node.js 20 as this project's engines.node, and Node.js 20, support ended 2026-04-30. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-04-30 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D5 · Coupling · Unstable project binding_macros · ×1
  • Unstable project binding_macros — binding_macros has instability 0.83 with 1 dependents.
D5 · Coupling · Unstable project swc · ×1
  • Unstable project swc — swc has instability 0.91 with 3 dependents.
D5 · Coupling · Unstable project swc_bundler · ×1
  • Unstable project swc_bundler — swc_bundler has instability 0.83 with 2 dependents.
D5 · Coupling · Unstable project swc_compiler_base · ×1
  • Unstable project swc_compiler_base — swc_compiler_base has instability 0.82 with 2 dependents.
D5 · Coupling · Unstable project swc_core · ×1
  • Unstable project swc_core — swc_core has instability 0.88 with 6 dependents.
D5 · Coupling · Unstable project swc_ecma_compat_bugfixes · ×1
  • Unstable project swc_ecma_compat_bugfixes — swc_ecma_compat_bugfixes has instability 0.88 with 1 dependents.
D5 · Coupling · Unstable project swc_ecma_compat_es2015 · ×1
  • Unstable project swc_ecma_compat_es2015 — swc_ecma_compat_es2015 has instability 0.85 with 2 dependents.
D5 · Coupling · Unstable project swc_ecma_compat_es2017 · ×1
  • Unstable project swc_ecma_compat_es2017 — swc_ecma_compat_es2017 has instability 0.83 with 1 dependents.
D5 · Coupling · Unstable project swc_ecma_compat_es2019 · ×1
  • Unstable project swc_ecma_compat_es2019 — swc_ecma_compat_es2019 has instability 0.83 with 1 dependents.
D5 · Coupling · Unstable project swc_ecma_compat_es2020 · ×1
  • Unstable project swc_ecma_compat_es2020 — swc_ecma_compat_es2020 has instability 0.88 with 1 dependents.
D5 · Coupling · Unstable project swc_ecma_compat_es2022 · ×1
  • Unstable project swc_ecma_compat_es2022 — swc_ecma_compat_es2022 has instability 0.82 with 2 dependents.
D5 · Coupling · Unstable project swc_ecma_regexp · ×1
  • Unstable project swc_ecma_regexp — swc_ecma_regexp has instability 0.83 with 1 dependents.
D5 · Coupling · Unstable project swc_ecma_transforms_compat · ×1
  • Unstable project swc_ecma_transforms_compat — swc_ecma_transforms_compat has instability 0.85 with 3 dependents.
D5 · Coupling · Unstable project swc_ecma_transforms_testing · ×1
  • Unstable project swc_ecma_transforms_testing — swc_ecma_transforms_testing has instability 0.91 with 1 dependents.
D5 · Coupling · Unstable project swc_html_minifier · ×1
  • Unstable project swc_html_minifier — swc_html_minifier has instability 0.90 with 2 dependents.
D5 · Coupling · Unstable project swc_node_bundler · ×1
  • Unstable project swc_node_bundler — swc_node_bundler has instability 0.92 with 1 dependents.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 37 typed · 127 plain JS — the untyped files are bindings/binding_core_wasm/__tests__/error.js, bindings/binding_core_wasm/__tests__/simple.js, bindings/binding_es_ast_viewer/__tests__/parse.js, bindings/binding_es_ast_viewer/scripts/package.mjs, bindings/binding_es_ast_viewer/src/es_ast_viewer_node.js, bindings/binding_html_wasm/__tests__/simple.js (+121 more). 0 production file(s) opt out entirely with @ts-nocheck · 18 @ts-ignore suppression(s).
R10 · Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (45 matched lines × 2 locations) packages/core/postinstall.js:70 — packages/core/postinstall.js:70 · packages/core/src/postinstall.ts:37 — the two spans are one implementation copied and then locally edited — 281 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 (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) packages/core/src/index.ts:313 — packages/core/src/index.ts:313 · packages/core/src/index.ts:359 — 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.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) packages/core/src/index.ts:389 — packages/core/src/index.ts:389 · packages/core/src/index.ts:419 — 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.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) crates/swc/scripts/sync_flow_projects.js:56 — crates/swc/scripts/sync_flow_projects.js:56 · crates/swc_ecma_parser/scripts/sync_flow_hermes_metadata.js:11 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (12 lines × 4 locations) · ×1
  • Duplicated block (12 lines × 4 locations) packages/core/src/Visitor.ts:258 — packages/core/src/Visitor.ts:258 · packages/core/src/Visitor.ts:658 · packages/core/src/Visitor.ts:833 · packages/core/src/Visitor.ts:1507 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 3 locations) · ×1
  • Duplicated block (12 lines × 3 locations) packages/core/src/Visitor.ts:322 — packages/core/src/Visitor.ts:322 · packages/core/src/Visitor.ts:837 · packages/core/src/Visitor.ts:1511 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (10 lines × 4 locations) · ×1
  • Duplicated block (10 lines × 4 locations) packages/core/src/Visitor.ts:842 — packages/core/src/Visitor.ts:842 · packages/core/src/Visitor.ts:1082 · packages/core/src/Visitor.ts:1220 · packages/core/src/Visitor.ts:1658 — 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.
R10 · Code Duplication · Duplicated block (10 lines × 3 locations) · ×1
  • Duplicated block (10 lines × 3 locations) packages/core/src/index.ts:183 — packages/core/src/index.ts:183 · packages/core/src/index.ts:226 · packages/core/src/index.ts:248 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (8 lines × 11 locations) · ×1
  • Duplicated block (8 lines × 11 locations) packages/core/src/Visitor.ts:529 — packages/core/src/Visitor.ts:529 · packages/core/src/Visitor.ts:558 · packages/core/src/Visitor.ts:694 · packages/core/src/Visitor.ts:791 · +7 more site(s) not listed — all 11 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.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) packages/core/src/index.ts:151 — packages/core/src/index.ts:151 · packages/core/src/index.ts:160 — 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.
R10 · Code Duplication · Duplicated block with local edits (7 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (7 matched lines × 2 locations) scripts/native/assemble.mjs:69 — scripts/native/assemble.mjs:69 · scripts/native/extract.mjs:15 — the two spans are one implementation copied and then locally edited — 50 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 (5 lines × 2 locations) · ×1
  • Duplicated block (5 lines × 2 locations) packages/html/webcontainer-fallback.cjs:25 — packages/html/webcontainer-fallback.cjs:25 · packages/html/webcontainer-fallback.cjs:31 — 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.
R2 · Cyclomatic Complexity · Complex function test_case (cyclomatic 54, cognitive 93) · ×1
  • Complex function test_case (cyclomatic 54, cognitive 93) REDACTED:105 — test_case has cyclomatic complexity 54 and cognitive complexity 93; 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 classifyChanges (cyclomatic 24, cognitive 12) · ×1
  • Complex function classifyChanges (cyclomatic 24, cognitive 12) scripts/github/change-detection.mjs:61 — classifyChanges has cyclomatic complexity 24 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 (top-level) (cyclomatic 17, cognitive 23) · ×1
  • Complex function (top-level) (cyclomatic 17, cognitive 23) scripts/validate-binary.js:2 — (top-level) has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 16, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 18) packages/core/postinstall.js:66 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function search (cyclomatic 16, cognitive 15) · ×1
  • Complex function search (cyclomatic 16, cognitive 15) crates/swc_ecma_transforms/scripts/del.js:10 — search has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 assertAllObjectHasTypeFiled (cyclomatic 14, cognitive 21) · ×1
  • Complex function assertAllObjectHasTypeFiled (cyclomatic 14, cognitive 21) packages/core/__tests__/plugin_test.mjs:4 — assertAllObjectHasTypeFiled has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function analyzePublishOrder (cyclomatic 14, cognitive 21) · ×1
  • Complex function analyzePublishOrder (cyclomatic 14, cognitive 21) scripts/github/publish-order.mjs:46 — analyzePublishOrder has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateBinary (cyclomatic 14, cognitive 14) · ×1
  • Complex function validateBinary (cyclomatic 14, cognitive 14) packages/core/src/postinstall.ts:31 — validateBinary has cyclomatic complexity 14 and cognitive complexity 14; 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 reminify (cyclomatic 13, cognitive 25) · ×1
  • Complex function reminify (cyclomatic 13, cognitive 25) REDACTED:620 — reminify has cyclomatic complexity 13 and cognitive complexity 25; 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 (anonymous) (cyclomatic 13, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 13, cognitive 18) REDACTED:521 — (anonymous) has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateReport (cyclomatic 13, cognitive 13) · ×1
  • Complex function validateReport (cyclomatic 13, cognitive 13) scripts/native/contracts.mjs:7 — validateReport has cyclomatic complexity 13 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 (anonymous) (cyclomatic 12, cognitive 20) · ×1
  • Complex function (anonymous) (cyclomatic 12, cognitive 20) scripts/native/workflow.test.mjs:223 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 20; 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 transformSync (cyclomatic 12, cognitive 17) · ×1
  • Complex function transformSync (cyclomatic 12, cognitive 17) packages/core/src/index.ts:341 — transformSync has cyclomatic complexity 12 and cognitive complexity 17; 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 transform (cyclomatic 11, cognitive 15) · ×1
  • Complex function transform (cyclomatic 11, cognitive 15) packages/core/src/index.ts:295 — transform has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function compileBundleOptions (cyclomatic 11, cognitive 13) · ×1
  • Complex function compileBundleOptions (cyclomatic 11, cognitive 13) packages/core/src/spack.ts:9 — compileBundleOptions has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 visit (cyclomatic 11, cognitive 12) · ×1
  • Complex function visit (cyclomatic 11, cognitive 12) scripts/github/publish-order.mjs:137 — visit has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · packages/types/index.ts · ×1
  • packages/types/index.ts: 2460 lines of code packages/types/index.ts:1 — packages/types/index.ts has 2460 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/core/src/Visitor.ts · ×1
  • packages/core/src/Visitor.ts: 1679 lines of code packages/core/src/Visitor.ts:1 — packages/core/src/Visitor.ts has 1679 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/core/src/index.ts · ×1
  • packages/core/src/index.ts: 544 lines of code packages/core/src/index.ts:1 — packages/core/src/index.ts has 544 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · The declared test suite includes a file that cannot be loaded · ×1
  • The declared test suite includes a file that cannot be loaded crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts:2 — This repository declares test tooling, and the ✓ above records that declaration — but crates/swc/tests/compile/jsc-paths/vercel-site/1/input/identity.ts and 1 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
R7 · Dead Code · Dead file (~153 LoC) · ×1
  • Dead file (~153 LoC) scripts/native/finalize.mjs — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~107 LoC) · ×1
  • Dead file (~107 LoC) scripts/sourcemap/vlq.js — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (scripts/sourcemap/decode.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~93 LoC) · ×1
  • Dead file (~93 LoC) crates/swc_ecma_minifier/scripts/_/samply-script.js — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~92 LoC) · ×1
  • Dead file (~92 LoC) crates/swc_ecma_minifier/scripts/mangler/charfreq.js — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~85 LoC) · ×1
  • Dead file (~85 LoC) crates/swc_ecma_minifier/scripts/jsprops.js — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~69 LoC) · ×1
  • Dead file (~69 LoC) scripts/sourcemap/decode.js — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~67 LoC) · ×1
  • Dead file (~67 LoC) packages/html/webcontainer-fallback.cjs — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~45 LoC) · ×1
  • Dead file (~45 LoC) crates/swc_bundler/src/bundler/helpers/_require.js — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~44 LoC) · ×1
  • Dead file (~44 LoC) crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~26 LoC) · ×1
  • Dead file (~26 LoC) bindings/binding_typescript_wasm/scripts/patch.mjs — no import path from any entry point (50 application, 36 tooling, 2843 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'acorn-jsx' · ×1
  • Unused dependency 'acorn-jsx' — 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.
R8 · Dependency Hygiene · Unused dependency 'axios' · ×1
  • Unused dependency 'axios' — 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.
R8 · Dependency Hygiene · Unused dependency 'benchmark' · ×1
  • Unused dependency 'benchmark' — 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.
R8 · Dependency Hygiene · Unused dependency 'bootstrap' · ×1
  • Unused dependency 'bootstrap' — 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.
R8 · Dependency Hygiene · Unused dependency 'class-validator' · ×1
  • Unused dependency 'class-validator' — 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.
R8 · Dependency Hygiene · Unused dependency 'cspell' · ×1
  • Unused dependency 'cspell' — 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.
R8 · Dependency Hygiene · Unused dependency 'js-beautify' · ×1
  • Unused dependency 'js-beautify' — 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.
R8 · Dependency Hygiene · Unused dependency 'swc-plugin-coverage-instrument' · ×1
  • Unused dependency 'swc-plugin-coverage-instrument' — 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.
Minor — 599 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×279
  • Orphaned file crates/swc_ecma_compat_es2015/src/spread.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/swc_ecma_transforms_base/src/rename/analyer_and_collector.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/swc_common/src/comments.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/swc_estree_ast/src/expr.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/swc_bundler/src/bundler/finalize.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/swc_ecma_minifier/src/util/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/swc_ecma_transforms_proposal/src/explicit_resource_management.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/swc_ecma_minifier/src/compress/pure/vars.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/swc_css_compat/src/compiler/custom_media.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/swc_bundler/src/bundler/load.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/swc_ecma_lexer/src/common/parser/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/swc_css_parser/src/parser/input.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/swc_common/src/errors/diagnostic.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/swc_css_minifier/src/compressor/color.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/swc_ecma_lexer/src/lexer/table.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/swc_html_parser/src/error.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/swc_html_parser/src/parser/open_elements_stack.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/swc_ecma_compat_es2022/src/optional_chaining_impl.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/binding_macros/src/wasm.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/swc_ecma_ast/src/stmt.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/swc_ecma_lexer/src/common/parser/jsx.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/swc_common/src/rustc_data_structures/stable_hasher.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/ast_node/src/enum_deserialize.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/swc_ecma_lexer/src/common/lexer/token.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/jsdoc/src/ast.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.
  • + 254 more in this group — see findings.md.
D10 · Test Quality · Mock-dominated test · ×85
  • Mock-dominated test: should set version, hermes version, and not publish crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:105 — This test sets up 10 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 8 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: main → RC0: should skip Hermes version crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:133 — This test sets up 10 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 8 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: RC0 → RC1: should skip Hermes version and artifacts crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:163 — This test sets up 11 test doubles (for example `jest .fn`) against 0 real object(s) of its own, and its only verification is 8 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should publish crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:210 — This test sets up 8 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should publish non-latest crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:357 — This test sets up 7 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should publish latest stable crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:395 — This test sets up 7 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should publish next crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-npm-test.js:469 — This test sets up 7 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should publish all updated packages crates/swc/tests/flow-projects/react-native/corpus/scripts/releases-ci/__tests__/publish-updated-packages-test.js:102 — This test sets up 5 test doubles (for example `jest.spyOn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: calls buildComponentSchema with ast and wrapComponentSchema with the result crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js:441 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: calls buildModuleSchema with ast and wrapModuleSchema with the result crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js:502 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: negotiates responder transfer: current responder can refuse termination crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/renderer/core/__tests__/ResponderEventTarget-itest.js:305 — This test sets up 4 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: negotiates responder transfer: current responder allows termination crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/renderer/core/__tests__/ResponderEventTarget-itest.js:353 — This test sets up 3 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: can handle multiple listeners and unsubscribe crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Utilities/__tests__/SceneTracker-test.js:16 — This test sets up 3 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called if provided in config crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:244 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called if provided in config crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:252 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called after `onMouseEnter` crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:285 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called after no delay by default crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:296 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: falls back to no delay if `delayHoverIn` is omitted crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:309 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called after a configured delay crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:322 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called synchronously if delay is 0ms crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:338 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called after `onMouseLeave`, and after onHoverIn crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:378 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called with no delay by default crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:395 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called after a configured delay crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:414 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called synchronously if delay is 0ms crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:438 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: is called if pressed for 500ms crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js:459 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • + 60 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×64
  • redundant comment crates/swc/benches/assets/parser.ts:1918 — 7 comments in this file only repeat the code they sit on (lines 1918, 1993, 3085, 3481, 8535, 8540, 8762), for example "find the next statement containing an `await`". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/benches/assets/renderer.ts:1048 — "check if this is a slot fragment with :slotted scope ids" repeats the code it sits on: 5 of its 6 words (check, slot, fragment, scope, ids) are already in `if (fragmentSlotScopeIds)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/benches/assets/visitor-expanded-parser.ts:1922 — 14 comments in this file only repeat the code they sit on (lines 1922, 1997, 3089, 3485, 8539, 8544, 8766, 12298, 12373, 13465, 13861, 18915, 18920, 19142), for example "find the next statement containing an `await`". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/benches/assets/vue-id.ts:2262 — 215 comments in this file only repeat the code they sit on (lines 2262, 4828, 4840, 9186, 10674, 13964, 16530, 16542, 20888, 22376, 25666, 28232, 28244, 32590, 34078, 37368, 39934, 39946, 44292, 45780, 49070, 51636, 51648, 55994, 57482, 60772, 63338, 63350, 67696, 69184, 72474, 75040, 75052, 79398, 80886, 84176, 86742, 86754, 91100, 92588, 95878, 98444, 98456, 102802, 104290, 107580, 110146, 110158, 114504, 115992, 119282, 121848, 121860, 126206, 127694, 130984, 133550, 133562, 137908, 139396, 142686, 145252, 145264, 149610, 151098, 154388, 156954, 156966, 161312, 162800, 166090, 168656, 168668, 173014, 174502, 177792, 180358, 180370, 184716, 186204, 189494, 192060, 192072, 196418, 197906, 201196, 203762, 203774, 208120, 209608, 212898, 215464, 215476, 219822, 221310, 224600, 227166, 227178, 231524, 233012, 236302, 238868, 238880, 243226, 244714, 248004, 250570, 250582, 254928, 256416, 259706, 262272, 262284, 266630, 268118, 271408, 273974, 273986, 278332, 279820, 283110, 285676, 285688, 290034, 291522, 294812, 297378, 297390, 301736, 303224, 306514, 309080, 309092, 313438, 314926, 318216, 320782, 320794, 325140, 326628, 329918, 332484, 332496, 336842, 338330, 341620, 344186, 344198, 348544, 350032, 353322, 355888, 355900, 360246, 361734, 365024, 367590, 367602, 371948, 373436, 376726, 379292, 379304, 383650, 385138, 388428, 390994, 391006, 395352, 396840, 400130, 402696, 402708, 407054, 408542, 411832, 414398, 414410, 418756, 420244, 423534, 426100, 426112, 430458, 431946, 435236, 437802, 437814, 442160, 443648, 446938, 449504, 449516, 453862, 455350, 458640, 461206, 461218, 465564, 467052, 470342, 472908, 472920, 477266, 478754, 482044, 484610, 484622, 488968, 490456, 493746, 496312, 496324, 500670, 502158), for example "check if this is a slot fragment with :slotted scope ids". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/compile/integration/deno-unit/input/console_test.ts:861 — 6 comments in this file only repeat the code they sit on (lines 861, 887, 918, 1147, 1167, 1200), for example "console.group test". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/compile/integration/deno-unit/output/console_test.ts:1066 — 6 comments in this file only repeat the code they sit on (lines 1066, 1080, 1098, 1276, 1294, 1328), for example "console.group test". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/compile/integration/ecosystem-ci/1/input/1.ts:185 — "'x-custom-jwt-property-name': 'namedSaveToJWT value'" repeats the code it sits on: 6 of its 7 words (custom, jwt, property, named, save, value) are already in `expect(customJWTPropertyKey).toEqual(namedSaveToJWTValue)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/compile/integration/ecosystem-ci/1/output/1.ts:154 — "'x-custom-jwt-property-name': 'namedSaveToJWT value'" repeats the code it sits on: 6 of its 7 words (custom, jwt, property, named, save, value) are already in `expect(customJWTPropertyKey).toEqual(_shared.namedSaveToJWTValue);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native-web/corpus/packages/react-native-web/src/exports/StyleSheet/compiler/index.js:510 — "Create rules for each of the keyframes" repeats the code it sits on: 3 of its 3 words (create, rules, keyframes) are already in `const [identifier, keyframesRules] = createKeyframes(keyframes);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/dev-middleware/src/__tests__/InspectorProxyCustomMessageHandler-test.js:95 — "Mock the device to return a normal React (Native) page" repeats the code it sits on: 6 of its 7 words (mock, device, return, react, native, page) are already in `device.getPages.mockImplementation(() => [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/dev-middleware/src/__tests__/InspectorProxyCustomMessageHandler-test.js:115 — "Find the synthetic page" repeats the code it sits on: 3 of its 3 words (find, synthetic, page) are already in `const syntheticPage = pageList.find(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/dev-middleware/src/__tests__/InspectorProxyCustomMessageHandler-test.js:195 — "Send a message to the device" repeats the code it sits on: 3 of its 3 words (send, message, device) are already in `createCustomMessageHandler.mock.calls[0][0].device.sendMessage({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/dev-middleware/src/inspector-proxy/Device.js:135 — "A base HTTP(S) URL to the server, relative to this server." repeats the code it sits on: 4 of its 5 words (base, url, server, relative) are already in `#serverRelativeBaseUrl: ReadonlyURL;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-codegen/src/parsers/errors.js:148 — "+genericName: string;" repeats the code it sits on: 3 of its 3 words (generic, name, string) are already in `constructor(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-codegen/src/parsers/parsers-commons.js:787 — "Parse Module Name" repeats the code it sits on: 3 of its 3 words (parse, module, name) are already in `const moduleName = parseModuleName(hasteModuleName, moduleSpec, ast, parser);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-compatibility-check/src/VersionDiffing.js:127 — "Wrap each error with the property path context" repeats the code it sits on: 4 of its 5 words (wrap, error, path, context) are already in `return errors.map(error =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-compatibility-check/src/VersionDiffing.js:194 — "Wrap each error with the parameter path context" repeats the code it sits on: 5 of its 5 words (wrap, error, parameter, path, context) are already in `return errors.map(error =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-compatibility-check/src/VersionDiffing.js:733 — "Wrap each error with the parameter path context" repeats the code it sits on: 5 of its 5 words (wrap, error, parameter, path, context) are already in `return errors.map(error =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Animated/animations/SpringAnimation.js:221 — "Set the initial velocity to the last velocity" repeats the code it sits on: 4 of its 4 words (set, initial, velocity, last) are already in `this._initialVelocity = this._lastVelocity;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js:101 — "Handle animated props on `refreshControl`." repeats the code it sits on: 4 of its 5 words (animated, props, refresh, control) are already in `const [refreshControlAnimatedProps, refreshControlRef] = useAnimatedProps<`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js:185 — "Maps string inputs an RGBA color or an array of numeric components" repeats the code it sits on: 7 of its 8 words (maps, string, inputs, color, array, numeric, components) are already in `function mapStringToNumericComponents(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Blob/__tests__/URL-test.js:102 — "URLSearchParams: Empty" repeats the code it sits on: 4 of its 4 words (url, search, params, empty) are already in `const emptyParams = new URLSearchParams('');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Blob/__tests__/URL-test.js:107 — "URLSearchParams: Array (for multiple values of the same key)" repeats the code it sits on: 6 of its 7 words (url, search, params, array, values, key) are already in `const paramsFromArray = new URLSearchParams([`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Components/StatusBar/StatusBar.js:250 — "The current merged values from the props stack." repeats the code it sits on: 4 of its 5 words (current, values, props, stack) are already in `static _currentValues: ?StackProps = null;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Lists/FlatList.js:161 — "removeClippedSubviewsOrDefault(this.props.removeClippedSubviews)" repeats the code it sits on: 4 of its 5 words (remove, clipped, subviews, default) are already in `function removeClippedSubviewsOrDefault(removeClippedSubviews: ?boolean)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 39 more in this group — see findings.md.
D19 · Documentation Quality · Documentation · ×49
  • Documentation: no build, run or usage example packages/core/scripts/npm/darwin-arm64/README.md:1 — `darwin-arm64` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/darwin-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/darwin-x64/README.md:1 — `darwin-x64` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/darwin-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-arm-gnueabihf/README.md:1 — `linux-arm-gnueabihf` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-arm-gnueabihf/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-arm64-gnu/README.md:1 — `linux-arm64-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-arm64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-arm64-musl/README.md:1 — `linux-arm64-musl` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-arm64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-ppc64-gnu/README.md:1 — `linux-ppc64-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-ppc64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-s390x-gnu/README.md:1 — `linux-s390x-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-s390x-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-x64-gnu/README.md:1 — `linux-x64-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-x64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/linux-x64-musl/README.md:1 — `linux-x64-musl` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/linux-x64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/win32-arm64-msvc/README.md:1 — `win32-arm64-msvc` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/win32-arm64-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/win32-ia32-msvc/README.md:1 — `win32-ia32-msvc` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/win32-ia32-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/core/scripts/npm/win32-x64-msvc/README.md:1 — `win32-x64-msvc` is a published package (`package.json` without `"private": true`) and neither `packages/core/scripts/npm/win32-x64-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/darwin-arm64/README.md:1 — `darwin-arm64` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/darwin-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/darwin-x64/README.md:1 — `darwin-x64` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/darwin-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-arm-gnueabihf/README.md:1 — `linux-arm-gnueabihf` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-arm-gnueabihf/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-arm64-gnu/README.md:1 — `linux-arm64-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-arm64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-arm64-musl/README.md:1 — `linux-arm64-musl` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-arm64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-ppc64-gnu/README.md:1 — `linux-ppc64-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-ppc64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-s390x-gnu/README.md:1 — `linux-s390x-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-s390x-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-x64-gnu/README.md:1 — `linux-x64-gnu` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-x64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/linux-x64-musl/README.md:1 — `linux-x64-musl` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/linux-x64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/win32-arm64-msvc/README.md:1 — `win32-arm64-msvc` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/win32-arm64-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/win32-ia32-msvc/README.md:1 — `win32-ia32-msvc` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/win32-ia32-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/html/scripts/npm/win32-x64-msvc/README.md:1 — `win32-x64-msvc` is a published package (`package.json` without `"private": true`) and neither `packages/html/scripts/npm/win32-x64-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/minifier/scripts/npm/darwin-arm64/README.md:1 — `darwin-arm64` is a published package (`package.json` without `"private": true`) and neither `packages/minifier/scripts/npm/darwin-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • + 24 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate crates/swc_bundler/src/bundler/helpers/_require.js:13 — `Object.defineProperty && Object.getOwnPropertyDescriptor` appears character-identically in 2 files — crates/swc_bundler/src/bundler/helpers/_require.js, packages/helpers/esm/_interop_require_wildcard.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/helpers/esm/_using.js:10 — `Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")` appears character-identically in 2 files — packages/helpers/esm/_using.js, packages/helpers/esm/_using_ctx.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/helpers/esm/_using.js:13 — `Symbol.dispose || Symbol.for("Symbol.dispose")` appears character-identically in 2 files — packages/helpers/esm/_using.js, packages/helpers/esm/_using_ctx.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/helpers/esm/_apply_decs_2203_r.js:404 — `Symbol.metadata || Symbol.for("Symbol.metadata")` appears character-identically in 2 files — packages/helpers/esm/_apply_decs_2203_r.js, packages/helpers/esm/_apply_decs_2311.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/core/postinstall.js:70 — `name === "@swc/core" || name === "@swc/workspace"` appears character-identically in 2 files — packages/core/postinstall.js, packages/core/src/postinstall.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/native/runtime.mjs:109 — `name.startsWith("package/") && !name.split("/").includes("..") && !name.includes("\\")` appears character-identically in 2 files — scripts/native/runtime.mjs, scripts/native/tarballs.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/lexer/mod.rs:718 — `!START_WITH_ZERO || self.cur().unwrap() == b'0'` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/lexer/mod.rs, crates/swc_ecma_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_html_codegen/src/lib.rs:1108 — `!c.is_ascii_alphanumeric() || entity_temporary_buffer.len() > 32` appears character-identically in 2 files — crates/swc_html_codegen/src/lib.rs, crates/swc_html_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_transforms_module/src/amd.rs:506 — `!export_bindings.is_empty() && !is_export_assign` appears character-identically in 3 files — crates/swc_ecma_transforms_module/src/amd.rs, crates/swc_ecma_transforms_module/src/common_js.rs, crates/swc_ecma_transforms_module/src/umd.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lints/src/rules/no_alert.rs:153 — `!inside_arrow_fn && (inside_class || self.is_inside_object())` appears character-identically in 2 files — crates/swc_ecma_lints/src/rules/no_alert.rs, crates/swc_ecma_lints/src/rules/radix.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/parser/mod.rs:314 — `!is_eval_or_arguments && !expr.is_valid_simple_assignment_target(self.ctx().contains(Context::Strict)) && should_deny(expr, deny_call)` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/parser/mod.rs, crates/swc_ecma_parser/src/parser/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate bindings/binding_nodejs_support_wasm/src/error_reporter.rs:177 — `!line.span_line_only(hl) && line.span_applies_gutter(hl)` appears character-identically in 3 files — bindings/binding_nodejs_support_wasm/src/error_reporter.rs, bindings/binding_typescript_wasm/src/error_reporter.rs, crates/swc_ts_fast_strip_binding/src/error_reporter.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate bindings/binding_nodejs_support_wasm/src/error_reporter.rs:377 — `!line.span_line_only(hl) && line.span_ends(hl)` appears character-identically in 3 files — bindings/binding_nodejs_support_wasm/src/error_reporter.rs, bindings/binding_typescript_wasm/src/error_reporter.rs, crates/swc_ts_fast_strip_binding/src/error_reporter.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_transforms_module/src/amd.rs:440 — `!module_usage.has_named() && import_interop.is_node()` appears character-identically in 2 files — crates/swc_ecma_transforms_module/src/amd.rs, crates/swc_ecma_transforms_module/src/umd.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/lexer/mod.rs:2204 — `!next_byte.is_ascii() || next_byte == b'\\'` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/lexer/mod.rs, crates/swc_ecma_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_transforms_module/src/amd.rs:237 — `!self.config.ignore_dynamic || !self.config.preserve_import_meta` appears character-identically in 2 files — crates/swc_ecma_transforms_module/src/amd.rs, crates/swc_ecma_transforms_module/src/common_js.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/lexer/mod.rs:1806 — `!self.input().is_at_start() || self.cur() != Some(b'!')` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/lexer/mod.rs, crates/swc_ecma_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_minifier/src/compress/pure/bools.rs:29 — `!self.options.conditionals && !self.options.bools` appears character-identically in 2 files — crates/swc_ecma_minifier/src/compress/pure/bools.rs, crates/swc_ecma_minifier/src/compress/pure/conds.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_minifier/src/compress/optimize/iife.rs:455 — `!self.options.unused && !self.options.reduce_vars` appears character-identically in 2 files — crates/swc_ecma_minifier/src/compress/optimize/iife.rs, crates/swc_ecma_minifier/src/compress/optimize/unused.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/lexer/mod.rs:728 — `(!START_WITH_ZERO || lazy_integer.end - lazy_integer.start == BytePos(1)) && self.eat(b'n')` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/lexer/mod.rs, crates/swc_ecma_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_parser/src/parser/object.rs:156 — `(self.input().syntax().dts() || self.type_ctx().contains(TypeContext::InDeclare)) && self.input_mut().eat(Token::QuestionMark)` appears character-identically in 2 files — crates/swc_ecma_parser/src/parser/object.rs, crates/swc_ecma_parser/src/parser/pat.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate bindings/binding_nodejs_support_wasm/src/error_reporter.rs:780 — `(span.offset() >= self.offset && span.offset() < self.offset + self.length) || (span.offset() < self.offset && span.offset() + spanlen > sel…` appears character-identically in 3 files — bindings/binding_nodejs_support_wasm/src/error_reporter.rs, bindings/binding_typescript_wasm/src/error_reporter.rs, crates/swc_ts_fast_strip_binding/src/error_reporter.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/lexer/mod.rs:282 — `C == b'<' && self.is(b'!') && self.peek() == Some(b'-') && self.peek_ahead() == Some(b'-')` appears character-identically in 2 files — crates/swc_ecma_lexer/src/lexer/mod.rs, crates/swc_ecma_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/lexer/mod.rs:578 — `RADIX == 2 || RADIX == 8 || RADIX == 10 || RADIX == 16` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/lexer/mod.rs, crates/swc_ecma_parser/src/lexer/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/swc_ecma_lexer/src/common/parser/pat.rs:662 — `accessibility.is_none() && !is_override && !readonly` appears character-identically in 2 files — crates/swc_ecma_lexer/src/common/parser/pat.rs, crates/swc_ecma_parser/src/parser/pat.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging crates/testing/src/output.rs:139 — `debug!` at line 139 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/testing/src/output.rs:168 — `debug!` at line 168 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/testing/src/output.rs:176 — `debug!` at line 176 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_plugin_runner/src/cache.rs:120 — `debug!` at line 120 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_node_bundler/src/loaders/swc.rs:86 — `debug!` at line 86 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_graph_analyzer/src/lib.rs:70 — `debug!` at line 70 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_graph_analyzer/src/lib.rs:92 — `debug!` at line 92 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:115 — `trace!` at line 115 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:307 — `trace!` at line 307 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:310 — `trace!` at line 310 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:316 — `debug!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:325 — `debug!` at line 325 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:664 — `trace!` at line 664 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:670 — `trace!` at line 670 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/mod.rs:677 — `trace!` at line 677 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:84 — `trace!` at line 84 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:109 — `trace!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:151 — `trace!` at line 151 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:155 — `trace!` at line 155 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:221 — `trace!` at line 221 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:237 — `trace!` at line 237 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:329 — `trace!` at line 329 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:358 — `trace!` at line 358 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:363 — `trace!` at line 363 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/swc_ecma_transforms_optimization/src/simplify/inlining/scope.rs:384 — `trace!` at line 384 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
D10 · Test Quality · No direct assertions · ×9
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/terser/compress/try_catch/parent_scope_of_catch_block_is_not_the_try_block/input.js:9 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/mangle/issue-5766/1/input.js:9 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/fixture/issues/unused-let-initialization/input.js:8 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/fixture/issues/unused-let-initialization/input.js:9 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/fixture/issues/unused-let-initialization/output.js:8 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/fixture/issues/unused-let-initialization/output.js:11 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/benches-full/d3.js:5490 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/benches-full/d3.js:5508 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: (unnamed test) crates/swc_ecma_minifier/tests/benches-full/d3.js:5517 — No conventional assertion call was detected, and 9 of 9 tests in `crates/swc_ecma_minifier` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
X9 · Subsumed condition operand · Subsumed condition operand · ×6
  • Subsumed condition operand crates/swc_ecma_parser/tests/typescript.rs:153 — `file_name.contains("tsc/inlineJsxFactoryDeclarationsx")` can never decide this `||` — every value satisfying `file_name.contains("tsc/inlineJsxFactoryDeclarationsx")` also satisfies `file_name.contains("tsc/inlineJsxFactoryDeclarations")`, 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/swc_ecma_parser/tests/typescript.rs:155 — `file_name.contains("tsc/tsxAttributeResolution5x")` can never decide this `||` — every value satisfying `file_name.contains("tsc/tsxAttributeResolution5x")` also satisfies `file_name.contains("tsc/tsxAttributeResolution5")`, 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/swc_ecma_parser/tests/typescript.rs:156 — `file_name.contains("tsc/tsxErrorRecovery2x")` can never decide this `||` — every value satisfying `file_name.contains("tsc/tsxErrorRecovery2x")` also satisfies `file_name.contains("tsc/tsxErrorRecovery2")`, 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/swc_ecma_parser/tests/typescript.rs:157 — `file_name.contains("tsc/tsxErrorRecovery3x")` can never decide this `||` — every value satisfying `file_name.contains("tsc/tsxErrorRecovery3x")` also satisfies `file_name.contains("tsc/tsxErrorRecovery3")`, 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/swc_ecma_parser/tests/typescript.rs:160 — `file_name.contains("tsc/tsxTypeArgumentsJsxPreserveOutputx")` can never decide this `||` — every value satisfying `file_name.contains("tsc/tsxTypeArgumentsJsxPreserveOutputx")` also satisfies `file_name.contains("tsc/tsxTypeArgumentsJsxPreserveOutput")`, 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/swc_ecma_parser/tests/typescript.rs:164 — `file_name.contains("tsc/unicodeEscapesInJsxtagsx")` can never decide this `||` — every value satisfying `file_name.contains("tsc/unicodeEscapesInJsxtagsx")` also satisfies `file_name.contains("tsc/unicodeEscapesInJsxtags")`, 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.
D30 · Dependency Vulnerabilities · Low CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 14 significant file(s) lose their only recent owner: bindings/binding_nodejs_support_wasm/src/nodejs.rs, crates/swc_native_addon/src/platform/windows.rs, crates/swc_ecma_compat_regexp/src/unicode_property.rs, crates/swc_ecma_transformer/src/regexp.rs, crates/testing/src/lib.rs, crates/swc_ecma_transformer/src/common/statement_injector.rs, crates/swc_ecma_transformer/src/es2020/nullish_coalescing.rs, crates/swc_cli_impl/src/commands/compile/paths.rs (+6 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: crates/swc_ecma_codegen/src/typescript.rs, crates/swc_ecma_transforms_base/src/fixer/typescript.rs, crates/testing_macros/src/fixture.rs, crates/ast_node/src/ast_node_macro.rs, crates/swc_ecma_lexer/src/parser/typescript.rs. Pair on, review, or document these before any departure.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D10 · Test Quality · Test project verifies nothing · ×1
  • Test project verifies nothing: crates/swc_ecma_minifier crates/swc_ecma_minifier/tests/terser/compress/try_catch/parent_scope_of_catch_block_is_not_the_try_block/input.js:9 — No conventional assertion call was detected in 9 of 9 tests in `crates/swc_ecma_minifier` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 5 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (25 single-owned of 705 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; 705 of the 1143 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/ast_node/src/encoding/decode.rs, crates/ast_node/src/encoding/encode.rs, crates/swc_ecma_lexer/src/common/parser/ident.rs, crates/swc_ecma_ast/src/source_map.rs, crates/swc_config/src/types/bool_or_data.rs, crates/swc_ecma_minifier/src/compress/optimize/util/tests.rs.
D20 · ADR Quality · ADR considers only one option · ×1
  • ADR considers only one option docs/adr/00003-reserve-bytepos-0-for-dummy-span.md:17 — `docs/adr/00003-reserve-bytepos-0-for-dummy-span.md:17` lists one option, "Adding one empty file to `SourceMap` each time we create one.", so the record shows no choice being made. List the alternatives that were rejected and why, or remove the section.
D20 · ADR Quality · ADR consequences name no cost · ×1
  • ADR consequences name no cost docs/adr/00003-reserve-bytepos-0-for-dummy-span.md:26 — `docs/adr/00003-reserve-bytepos-0-for-dummy-span.md:26` records the good consequences of the decision and has no section for the bad ones. State what this decision costs or rules out.
D20 · ADR Quality · ADR has no Consequences section · ×1
  • ADR has no Consequences section docs/adr/00004-add-ast-path-info-to-visitor.md:1 — docs/adr/00004-add-ast-path-info-to-visitor.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 279 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/swc_ecma_compat_es2015/src/spread.rs, crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs, crates/swc_common/src/comments.rs, crates/swc_estree_ast/src/expr.rs, crates/swc_bundler/src/bundler/finalize.rs, crates/swc_ecma_minifier/src/util/mod.rs, crates/swc_ecma_transforms_proposal/src/explicit_resource_management.rs, crates/swc_ecma_minifier/src/compress/pure/vars.rs (and 271 more) (331 orphaned of 706 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; 706 of the 1143 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift CONTRIBUTING.md:127 — CONTRIBUTING.md names Node.js 16, but the repository declares engines `>= 20`, engines `>=24`, engines `>=18`, pinned 26. 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.
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API crates/swc_estree_ast/src/class.rs:416 — 1 public type in `swc_estree_ast.class` is marked as implementation by its own namespace, folder or name: `ClassImpl` (crates/swc_estree_ast/src/class.rs:416, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 28/31 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `bindings/swc_cli`, `crates/swc-ast-explorer`, `xtask`.
R7 · Dead Code · Unused module-local declaration 'inferBinaryName' · ×1
  • Unused module-local declaration 'inferBinaryName' packages/core/e2e/plugins/plugins.compat.test.js:49 — 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.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~0.3 `!` null assertions per 1k TypeScript source lines — 2 assertion(s) across the 6395 source line(s) of the 11 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: packages/core/src/postinstall.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
X7 · Silent fallback defaults · Silent fallback default on Err · ×1
  • Silent fallback default on Err crates/swc/src/config/mod.rs:2426 — `default_env_name` turns every `Err` into `"development".into()` — 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.
Minor — 698 finding(s)
D10 · Test Quality · Skipped (documented) · ×644
  • Skipped (documented): (unnamed test) crates/swc_typescript/tests/oxc_fixture/strip-internal.ts:5 — 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) crates/swc_ecma_transforms_typescript/tests/lowering/class-properties/standard/private-method-overload-and-abstract/input.ts:2 — 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) crates/swc_ecma_transforms_typescript/tests/lowering/class-properties/standard/private-method-overload-and-abstract/input.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) crates/swc_ecma_transforms_typescript/tests/lowering/class-properties/standard/private-method-overload-and-abstract/input.ts:6 — 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) crates/swc_ecma_transforms_proposal/tests/decorators/issue-7499/1/input.js:8 — 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) crates/swc_ecma_transforms_proposal/tests/decorators/issue-7499/1/output.js:22 — 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) crates/swc_ecma_transforms_proposal/tests/decorators/issue-7358/2/input.js:1 — 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) crates/swc_ecma_transforms_proposal/tests/decorators/issue-7358/2/output.js:1 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/issue-2678/output.amd.js:19 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/issue-2678/output.cjs: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): (unnamed test) crates/swc_ecma_transforms_module/tests/fixture/common/issue-2678/output.umd.js:22 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/issue-2549/output.amd.js:28 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/issue-2549/output.cjs:24 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/issue-2549/output.umd.js:31 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop-node/remap/output.amd.js:28 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop-node/remap/output.cjs:31 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop-node/remap/output.umd.js:31 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop-node/overview/output.amd.js:22 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop-node/overview/output.cjs:16 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop-node/overview/output.umd.js:25 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop/remap/output.amd.js:28 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop/remap/output.cjs:24 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop/remap/output.umd.js:31 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop/overview/output.amd.js:22 — 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) crates/swc_ecma_transforms_module/tests/fixture/common/interop/overview/output.cjs:12 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • + 619 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated · ×50
  • Outdated: anyhow — `anyhow` is locked at 1.0.103 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0.98"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: arbitrary — `arbitrary` is locked at 1.4.1 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/swc_atoms/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arbitrary` and commit the updated REDACTED.
  • Outdated: auto_impl — `auto_impl` is locked at 1.2.0 but 1.4.0 is the current stable release on crates.io, and it already satisfies the `"1.2.0"` requirement declared in crates/swc_css_codegen/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p auto_impl` and commit the updated REDACTED.
  • Outdated: backtrace — `backtrace` is locked at 0.3.76 but 0.3.77 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in bindings/binding_core_node/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p backtrace` and commit the updated REDACTED.
  • Outdated: bitflags — `bitflags` is locked at 2.10.0 but 2.13.2 is the current stable release on crates.io, and it already satisfies the `"2.5.0"` requirement declared in crates/swc_css_codegen/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitflags` and commit the updated REDACTED.
  • Outdated: bitvec — `bitvec` is locked at 1.0.1 but 1.1.1 is the current stable release on crates.io, and it already satisfies the `"1.0.1"` requirement declared in crates/swc_sourcemap/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitvec` and commit the updated REDACTED.
  • Outdated: bumpalo — `bumpalo` is locked at 3.19.0 but 3.20.4 is the current stable release on crates.io, and it already satisfies the `"3.16.0"` requirement declared in crates/swc_allocator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bumpalo` and commit the updated REDACTED.
  • Outdated: cbor4ii — `cbor4ii` is locked at 1.2.0 but 1.2.4 is the current stable release on crates.io, and it already satisfies the `"1.2"` requirement declared in crates/jsdoc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cbor4ii` and commit the updated REDACTED.
  • Outdated: clap — `clap` is locked at 4.5.9 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.4.6"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: dashmap — `dashmap` is locked at 6.1.0 but 6.2.1 is the current stable release on crates.io, and it already satisfies the `"6.1.0"` requirement declared in crates/preset_env_base/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p dashmap` and commit the updated REDACTED.
  • Outdated: data-encoding — `data-encoding` is locked at 2.9.0 but 2.11.1 is the current stable release on crates.io, and it already satisfies the `"2.3.3"` requirement declared in crates/swc_sourcemap/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p data-encoding` and commit the updated REDACTED.
  • Outdated: either — `either` is locked at 1.17.0 but 1.19.0 is the current stable release on crates.io, and it already satisfies the `"1.10.0"` requirement declared in crates/swc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p either` and commit the updated REDACTED.
  • Outdated: enumset — `enumset` is locked at 1.1.5 but 1.1.15 is the current stable release on crates.io, and it already satisfies the `"1.1.2"` requirement declared in crates/swc_plugin_backend_wasmer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p enumset` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.0.34 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/dbg-swc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: globset — `globset` is locked at 0.4.20 but 0.4.21 is the current stable release on crates.io, and it already satisfies the `"0.4.16"` requirement declared in crates/swc_config/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p globset` and commit the updated REDACTED.
  • Outdated: icu_properties — `icu_properties` is locked at 2.1.2 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.0.0"` requirement declared in crates/swc_ecma_compat_regexp/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p icu_properties` and commit the updated REDACTED.
  • Outdated: if_chain — `if_chain` is locked at 1.0.2 but 1.0.3 is the current stable release on crates.io, and it already satisfies the `"1.0.0"` requirement declared in crates/swc_sourcemap/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p if_chain` and commit the updated REDACTED.
  • Outdated: js-sys — `js-sys` is locked at 0.3.77 but 0.3.107 is the current stable release on crates.io, and it already satisfies the `"0.3.77"` requirement declared in bindings/binding_nodejs_support_wasm/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p js-sys` and commit the updated REDACTED.
  • Outdated: memchr — `memchr` is locked at 2.7.6 but 2.8.3 is the current stable release on crates.io, and it already satisfies the `"2.6.1"` requirement declared in crates/swc_ecma_codegen/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memchr` and commit the updated REDACTED.
  • Outdated: napi — `napi` is locked at 3.3.0 but 3.16.2 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in bindings/binding_core_node/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p napi` and commit the updated REDACTED.
  • Outdated: napi-build — `napi-build` is locked at 2.2.3 but 2.6.0 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in bindings/binding_core_node/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p napi-build` and commit the updated REDACTED.
  • Outdated: napi-derive — `napi-derive` is locked at 3.2.5 but 3.7.1 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in bindings/binding_core_node/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p napi-derive` and commit the updated REDACTED.
  • Outdated: notify — `notify` is locked at 8.2.0 but 8.2.2 is the current stable release on crates.io, and it already satisfies the `"8.0.0"` requirement declared in crates/swc_cli_impl/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p notify` and commit the updated REDACTED.
  • Outdated: num_cpus — `num_cpus` is locked at 1.16.0 but 1.17.0 is the current stable release on crates.io, and it already satisfies the `"1.13.1"` requirement declared in crates/swc_ecma_minifier/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p num_cpus` and commit the updated REDACTED.
  • Outdated: once_cell — `once_cell` is locked at 1.21.3 but 1.21.4 is the current stable release on crates.io, and it already satisfies the `"1.19.0"` requirement declared in crates/binding_macros/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p once_cell` and commit the updated REDACTED.
  • + 25 more in this group — see findings.md.
D24 · Comment Value · doc comments repeat the names · ×3
  • doc comments repeat the names packages/types/index.ts:643 — 0 of 0 documented parameters and 3 of 152 summaries in `@swc/types` only repeat the member or parameter name (e.g. "Keep class names." for `keepClassNames`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names crates/swc/tests/compile/module/regressions/issues-1xxx/1333/case2/input/index.js:148 — 46 of 924 documented parameters and 69 of 5834 summaries in `@swc/workspace` only repeat the member or parameter name (e.g. "The client instance." for `client`). 8 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names crates/swc_ecma_minifier/tests/benches-full/echarts.js:3993 — 6 of 400 documented parameters and 4 of 459 summaries in `minifier` only repeat the member or parameter name (e.g. "Get precision" for `getPrecision`). 40 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: swc_common — swc_common: abstractness 0.20, instability 0.08, distance 0.72 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-da06269a6e82444cadb5634392aaf992/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-da06269a6e82444cadb5634392aaf992/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/Libraries/Renderer --exclude crates/swc/tests/flow-projects/react-native/corpus/packages/react-native/src/private/featureflags/specs --exclude crates/swc/tests/flow-projects/react-native/corpus/packages/react-native-babel-preset/src/__tests__/__fixtures__/output --exclude crates/swc/tests/serde --exclude crates/swc/tests/srcmap/case-none-file --exclude crates/swc/tests/srcmap/issue-11424-scopes --exclude crates/swc/tests/srcmap/issue-4578 --exclude crates/swc/tests/srcmap/issue-622 --exclude crates/swc/tests/srcmap/issue-706 --exclude crates/swc/tests/srcmap/stacktrace/deno-10014/input --exclude crates/swc/tests/srcmap/stacktrace/issue-1685/input --exclude crates/swc/tests/srcmap/stacktrace/issue-7506/input --exclude crates/swc/tests/srcmap/stacktrace/issue-9742/input --exclude crates/swc/tests/tsc-references --exclude crates/swc_css_codegen/tests/fixture --exclude crates/swc_css_codegen/tests/options --exclude crates/swc_css_lints/tests/rules/pass --exclude crates/swc_css_minifier/tests/fixture --exclude crates/swc_css_prefixer/tests/fixture --exclude crates/swc_ecma_codegen/tests/fixture/big-int --exclude crates/swc_ecma_codegen/tests/fixture/generic-type-assertion --exclude crates/swc_ecma_codegen/tests/fixture/inline-script-regex --exclude crates/swc_ecma_codegen/tests/fixture/issue-10978 --exclude crates/swc_ecma_codegen/tests/fixture/issue-5912 --exclude crates/swc_ecma_codegen/tests/fixture/issue-6589 --exclude crates/swc_ecma_codegen/tests/fixture/issue-9561 --exclude crates/swc_ecma_codegen/tests/fixture/issue-9758 --exclude crates/swc_ecma_codegen/tests/fixture/issue-9849 --exclude crates/swc_ecma_codegen/tests/fixture/issues --exclude crates/swc_ecma_codegen/tests/fixture/next --exclude crates/swc_ecma_codegen/tests/fixture/next-36251 --exclude crates/swc_ecma_codegen/tests/fixture/node-erm --exclude crates/swc_ecma_codegen/tests/fixture/non-null-review-new --exclude crates/swc_ecma_codegen/tests/fixture/non-null-review-pattern --exclude crates/swc_ecma_codegen/tests/fixture/non-null-review-type-assertion --exclude crates/swc_ecma_codegen/tests/fixture/number --exclude crates/swc_ecma_codegen/tests/fixture/optional-call-type-arguments --exclude crates/swc_ecma_codegen/tests/fixture/reduce-escaped-newline --exclude crates/swc_ecma_codegen/tests/fixture/regex-division-boundary --exclude crates/swc_ecma_codegen/tests/fixture/semi --exclude crates/swc_ecma_codegen/tests/fixture/stc --exclude crates/swc_ecma_codegen/tests/fixture/string --exclude crates/swc_ecma_codegen/tests/fixture/template-literal --exclude crates/swc_ecma_codegen/tests/fixture/template-unicode-escapes/ascii-only --exclude crates/swc_ecma_codegen/tests/fixture/template-unicode-escapes/basic --exclude crates/swc_ecma_codegen/tests/fixture/template-unicode-escapes/inline-script/ascii-only --exclude crates/swc_ecma_codegen/tests/fixture/template-unicode-escapes/inline-script/closing-tag --exclude crates/swc_ecma_codegen/tests/fixture/template-unicode-escapes/inline-script/disabled --exclude crates/swc_ecma_codegen/tests/fixture/template-unicode-escapes/syntax --exclude crates/swc_ecma_codegen/tests/fixture/tsx-generic-arrow-comma --exclude crates/swc_ecma_codegen/tests/fixture/typed-arrow-parameters --exclude crates/swc_ecma_codegen/tests/fixture/typescript --exclude crates/swc_ecma_codegen/tests/fixture/typescript-this-param --exclude crates/swc_ecma_codegen/tests/fixture/vercel --exclude crates/swc_ecma_codegen/tests/test262 --exclude crates/swc_ecma_codegen/tests/test262-min --exclude crates/swc_ecma_lints/tests/pass --exclude crates/swc_ecma_minifier/tests/fixture/check --exclude crates/swc_ecma_minifier/tests/fixture/comparison --exclude crates/swc_ecma_minifier/tests/fixture/issues/10041 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10054 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10178 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10250 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10281 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10328 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10412 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10425 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10448 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10466 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10473 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10532 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10539 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10630 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10633 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10700 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10720 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10721 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10746 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10807 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10816 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10824 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10849 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10859 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10876 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10885 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10918 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10935 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10936 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10938 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10981 --exclude crates/swc_ecma_minifier/tests/fixture/issues/10986 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11007 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11034 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11079 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11082 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11083 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11084 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11089 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11102 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11103 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11105 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11108 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11133 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11158 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11257 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11303 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11320 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11321 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11368 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11512 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11512-exhaustive --exclude crates/swc_ecma_minifier/tests/fixture/issues/11512-simple --exclude crates/swc_ecma_minifier/tests/fixture/issues/11545 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11645 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11684 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11730 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11730_class_expr --exclude crates/swc_ecma_minifier/tests/fixture/issues/11755 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11829 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11835 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11871 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11944 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11970 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11977 --exclude crates/swc_ecma_minifier/tests/fixture/issues/11983 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12008 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12032 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12118 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12126 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12128 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12311 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12315 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12373 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12380 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12416 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12492 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12538 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12570 --exclude crates/swc_ecma_minifier/tests/fixture/issues/12669/another --exclude crates/swc_ecma_minifier/tests/fixture/issues/2011 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2028 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2044 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2072 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2078 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2214 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2257 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2262 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2319 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2558 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2605 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2614 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2679 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2779 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2807 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2923 --exclude crates/swc_ecma_minifier/tests/fixture/issues/2926 --exclude crates/swc_ecma_minifier/tests/fixture/issues/3126 --exclude crates/swc_ecma_minifier/tests/fixture/issues/3173 --exclude crates/swc_ecma_minifier/tests/fixture/issues/3256 --exclude crates/swc_ecma_minifier/tests/fixture/issues/3629 --exclude crates/swc_ecma_minifier/tests/fixture/issues/3709 --exclude crates/swc_ecma_minifier/tests/fixture/issues/3710 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4234 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4249 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4386 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4412 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4515 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4841 --exclude crates/swc_ecma_minifier/tests/fixture/issues/4845 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5280 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5306 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5343 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5588 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5680 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5682 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5684 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5693 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5846 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5864 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5865 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5910 --exclude crates/swc_ecma_minifier/tests/fixture/issues/5955 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6049 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6141 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6146 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6175 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6192 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6279 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6344 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6407 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6422 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6463 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6492 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6508 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6509 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6628 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6636 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6730 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6751 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6791 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6837 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6864 --exclude crates/swc_ecma_minifier/tests/fixture/issues/6957 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7004 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7009 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7045 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7111 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7194 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7228 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7241 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7287 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7331 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7402 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7412 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7457 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7472 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7500 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7568 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7575 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7591 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7634 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7641 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7678 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7683 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7697 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7714 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7739 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7742 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7749 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7754 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7770 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7783 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7784 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7821 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7839 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7847 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7969 --exclude crates/swc_ecma_minifier/tests/fixture/issues/7984 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8119 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8136 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8161 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8173 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8228 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8271 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8284 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8324 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8337 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8398 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8465 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8567 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8622 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8626 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8643 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8670 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8692 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8704 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8705 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8706 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8714 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8715 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8717 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8718 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8737 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8806 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8813 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8826 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8841 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8844 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8880 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8886 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8907 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8919 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8923 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8924 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8953 --exclude crates/swc_ecma_minifier/tests/fixture/issues/8974 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9007 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9030 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9148 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9176 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9186 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9263 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9453 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9459 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9460/alternate-identifiers --exclude crates/swc_ecma_minifier/tests/fixture/issues/9460/report --exclude crates/swc_ecma_minifier/tests/fixture/issues/9460/safe-initializers --exclude crates/swc_ecma_minifier/tests/fixture/issues/9466 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9468 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9500 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9504 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-arrow-functions --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-destructuring --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-keep-fargs --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-methods --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-mixed-params --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-nested-defaults --exclude crates/swc_ecma_minifier/tests/fixture/issues/9610-side-effects --exclude crates/swc_ecma_minifier/tests/fixture/issues/9619 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9628 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9650 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9739 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741_collision --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741_collision_function --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741_disabled --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741_global_objects --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741_multiple_methods --exclude crates/swc_ecma_minifier/tests/fixture/issues/9741_threshold --exclude crates/swc_ecma_minifier/tests/fixture/issues/9757 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9785 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9823 --exclude crates/swc_ecma_minifier/tests/fixture/issues/9922 --exclude crates/swc_ecma_minifier/tests/fixture/issues/arguments-parameter-injection-limit --exclude crates/swc_ecma_minifier/tests/fixture/issues/buble --exclude crates/swc_ecma_minifier/tests/fixture/issues/cycle-1 --exclude crates/swc_ecma_minifier/tests/fixture/issues/cycle-2 --exclude crates/swc_ecma_minifier/tests/fixture/issues/d3-color --exclude crates/swc_ecma_minifier/tests/fixture/issues/d3-time-format --exclude crates/swc_ecma_minifier/tests/fixture/issues/emotion --exclude crates/swc_ecma_minifier/tests/fixture/issues/export --exclude crates/swc_ecma_minifier/tests/fixture/issues/firebase --exclude crates/swc_ecma_minifier/tests/fixture/issues/firebase-core --exclude crates/swc_ecma_minifier/tests/fixture/issues/firebase-firestore --exclude crates/swc_ecma_minifier/tests/fixture/issues/framer-motion --exclude crates/swc_ecma_minifier/tests/fixture/issues/issue-2604 --exclude crates/swc_ecma_minifier/tests/fixture/issues/lit_comparisons --exclude crates/swc_ecma_minifier/tests/fixture/issues/moment --exclude crates/swc_ecma_minifier/tests/fixture/issues/murmur2 --exclude crates/swc_ecma_minifier/tests/fixture/issues/nested-iife-return-not-last --exclude crates/swc_ecma_minifier/tests/fixture/issues/nested-spread-array --exclude crates/swc_ecma_minifier/tests/fixture/issues/non-finite-number-method-call --exclude crates/swc_ecma_minifier/tests/fixture/issues/noop-sequence-calls/annotated --exclude crates/swc_ecma_minifier/tests/fixture/issues/noop-sequence-calls/without-reduce-vars --exclude crates/swc_ecma_minifier/tests/fixture/issues/noop-sequence-calls/without-side-effects --exclude crates/swc_ecma_minifier/tests/fixture/issues/quagga2 --exclude crates/swc_ecma_minifier/tests/fixture/issues/react --exclude crates/swc_ecma_minifier/tests/fixture/issues/react-autosuggest --exclude crates/swc_ecma_minifier/tests/fixture/issues/react-autowhatever --exclude crates/swc_ecma_minifier/tests/fixture/issues/react-countup --exclude crates/swc_ecma_minifier/tests/fixture/issues/react-instancesearch --exclude crates/swc_ecma_minifier/tests/fixture/issues/regexp --exclude crates/swc_ecma_minifier/tests/fixture/issues/spread-primitives --exclude crates/swc_ecma_minifier/tests/fixture/issues/spread-primitives-void-call --exclude crates/swc_ecma_minifier/tests/fixture/issues/stylis --exclude crates/swc_ecma_minifier/tests/fixture/issues/typescript --exclude crates/swc_ecma_minifier/tests/fixture/issues/unused-let-initialization --exclude crates/swc_ecma_minifier/tests/fixture/issues/vercel --exclude crates/swc_ecma_minifier/tests/fixture/member_expr --exclude crates/swc_ecma_minifier/tests/fixture/next/30498 --exclude crates/swc_ecma_minifier/tests/fixture/next/31077 --exclude crates/swc_ecma_minifier/tests/fixture/next/31084 --exclude crates/swc_ecma_minifier/tests/fixture/next/33265 --exclude crates/swc_ecma_minifier/tests/fixture/next/33458 --exclude crates/swc_ecma_minifier/tests/fixture/next/36127 --exclude crates/swc_ecma_minifier/tests/fixture/next/39538 --exclude crates/swc_ecma_minifier/tests/fixture/next/41527 --exclude crates/swc_ecma_minifier/tests/fixture/next/41992 --exclude crates/swc_ecma_minifier/tests/fixture/next/43052 --exclude crates/swc_ecma_minifier/tests/fixture/next/43208 --exclude crates/swc_ecma_minifier/tests/fixture/next/46887 --exclude crates/swc_ecma_minifier/tests/fixture/next/46887-2 --exclude crates/swc_ecma_minifier/tests/fixture/next/47005 --exclude crates/swc_ecma_minifier/tests/fixture/next/54192 --exclude crates/swc_ecma_minifier/tests/fixture/next/56408 --exclude crates/swc_ecma_minifier/tests/fixture/next/66237 --exclude crates/swc_ecma_minifier/tests/fixture/next/66378 --exclude crates/swc_ecma_minifier/tests/fixture/next/asmjs --exclude crates/swc_ecma_minifier/tests/fixture/next/brotli-decompress --exclude crates/swc_ecma_minifier/tests/fixture/next/chakra --exclude crates/swc_ecma_minifier/tests/fixture/next/cryptojs --exclude crates/swc_ecma_minifier/tests/fixture/next/exceljs --exclude crates/swc_ecma_minifier/tests/fixture/next/feeback-plotly --exclude crates/swc_ecma_minifier/tests/fixture/next/feedback-1 --exclude crates/swc_ecma_minifier/tests/fixture/next/feedback-2 --exclude crates/swc_ecma_minifier/tests/fixture/next/feedback-3 --exclude crates/swc_ecma_minifier/tests/fixture/next/feedback-regex --exclude crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify --exclude crates/swc_ecma_minifier/tests/fixture/next/joda --exclude crates/swc_ecma_minifier/tests/fixture/next/octokit --exclude crates/swc_ecma_minifier/tests/fixture/next/outstatic --exclude crates/swc_ecma_minifier/tests/fixture/next/react-ace --exclude crates/swc_ecma_minifier/tests/fixture/next/react-chartjs --exclude crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer --exclude crates/swc_ecma_minifier/tests/fixture/next/regression-1 --exclude crates/swc_ecma_minifier/tests/fixture/next/styled-components --exclude crates/swc_ecma_minifier/tests/fixture/next/swc-4559 --exclude crates/swc_ecma_minifier/tests/fixture/next/syncfusion --exclude crates/swc_ecma_minifier/tests/fixture/next/target-es2015 --exclude crates/swc_ecma_minifier/tests/fixture/next/tinymce --exclude crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts --exclude crates/swc_ecma_minifier/tests/fixture/no-side-effect --exclude crates/swc_ecma_minifier/tests/fixture/non-finite-number-literals --exclude crates/swc_ecma_minifier/tests/fixture/object-factory-inline-cost --exclude crates/swc_ecma_minifier/tests/fixture/pr/11381 --exclude crates/swc_ecma_minifier/tests/fixture/pr/11446 --exclude crates/swc_ecma_minifier/tests/fixture/pr/11814_class_effect_guards --exclude crates/swc_ecma_minifier/tests/fixture/pr/11814_class_effect_order --exclude crates/swc_ecma_minifier/tests/fixture/pr/11987 --exclude crates/swc_ecma_minifier/tests/fixture/pr/12558 --exclude crates/swc_ecma_minifier/tests/fixture/pr/6169 --exclude crates/swc_ecma_minifier/tests/fixture/pr/6272 --exclude crates/swc_ecma_minifier/tests/fixture/pr/7145 --exclude crates/swc_ecma_minifier/tests/fixture/pr/7690 --exclude crates/swc_ecma_minifier/tests/fixture/pr/7856 --exclude crates/swc_ecma_minifier/tests/fixture/projects --exclude crates/swc_ecma_minifier/tests/fixture/pure-annotations-not-member-pattern --exclude crates/swc_ecma_minifier/tests/fixture/reduced --exclude crates/swc_ecma_minifier/tests/fixture/simple --exclude crates/swc_ecma_minifier/tests/fixture/terser --exclude crates/swc_ecma_parser/tests/binding-pattern --exclude crates/swc_ecma_parser/tests/errors/explicit-resource-management/.invalid-for-await-using-binding-of-of --exclude crates/swc_ecma_parser/tests/errors/explicit-resource-management/.invalid-for-using-binding-of-of --exclude crates/swc_ecma_parser/tests/errors/explicit-resource-management/invalid-script-top-level-using-binding --exclude crates/swc_ecma_parser/tests/flow --exclude crates/swc_ecma_parser/tests/flow-hermes/corpus --exclude crates/swc_ecma_parser/tests/flow-module --exclude crates/swc_ecma_parser/tests/js/async-arrow-param-function-name --exclude crates/swc_ecma_parser/tests/js/await-identifier --exclude crates/swc_ecma_parser/tests/js/class --exclude crates/swc_ecma_parser/tests/js/class-initializer-context --exclude crates/swc_ecma_parser/tests/js/class-strict-context --exclude crates/swc_ecma_parser/tests/js/constructor-arguments-context --exclude crates/swc_ecma_parser/tests/js/constructor-await-context --exclude crates/swc_ecma_parser/tests/js/deferred-import-evaluation --exclude crates/swc_ecma_parser/tests/js/escaped-keyword-properties --exclude crates/swc_ecma_parser/tests/js/escaped-keyword-static-asi --exclude crates/swc_ecma_parser/tests/js/escaped-let --exclude crates/swc_ecma_parser/tests/js/explicit-resource-management --exclude crates/swc_ecma_parser/tests/js/for-of-await-module --exclude crates/swc_ecma_parser/tests/js/for-of-await-yield-identifiers --exclude crates/swc_ecma_parser/tests/js/grammar-context --exclude crates/swc_ecma_parser/tests/js/import-assertions --exclude crates/swc_ecma_parser/tests/js/import-assertions-with-keyword --exclude crates/swc_ecma_parser/tests/js/import-attributes --exclude crates/swc_ecma_parser/tests/js/import-attributes-deprecatedAssertKeyword --exclude crates/swc_ecma_parser/tests/js/issue-10372 --exclude crates/swc_ecma_parser/tests/js/issue-10558 --exclude crates/swc_ecma_parser/tests/js/issue-10597 --exclude crates/swc_ecma_parser/tests/js/issue-10724 --exclude crates/swc_ecma_parser/tests/js/issue-10863 --exclude crates/swc_ecma_parser/tests/js/issue-11214 --exclude crates/swc_ecma_parser/tests/js/issue-11649 --exclude crates/swc_ecma_parser/tests/js/issue-4176 --exclude crates/swc_ecma_parser/tests/js/issue-5276 --exclude crates/swc_ecma_parser/tests/js/issue-8482 --exclude crates/swc_ecma_parser/tests/js/jssue-7428 --exclude crates/swc_ecma_parser/tests/js/optional-chaining --exclude crates/swc_ecma_parser/tests/js/parse-unambiguous --exclude crates/swc_ecma_parser/tests/js/radix-rounding --exclude crates/swc_ecma_parser/tests/js/source-phase-imports --exclude crates/swc_ecma_parser/tests/js/stack-overflow --exclude crates/swc_ecma_parser/tests/js/static-block-await-context --exclude crates/swc_ecma_parser/tests/js/yield-private-in --exclude crates/swc_ecma_parser/tests/jsx/basic --exclude crates/swc_ecma_parser/tests/jsx/entities --exclude crates/swc_ecma_parser/tests/tsc --exclude crates/swc_ecma_parser/tests/typescript --exclude crates/swc_ecma_parser/tests/typescript-recovery --exclude crates/swc_ecma_preset_env/data --exclude crates/swc_ecma_transforms_base/src/helpers/generated --exclude crates/swc_ecma_transforms_compat/tests/classes/issue-1959 --exclude crates/swc_estree_compat/tests/fixtures --exclude crates/swc_estree_compat/tests/flavor --exclude crates/swc_html_codegen/tests/document_fragment --exclude crates/swc_html_codegen/tests/fixture --exclude crates/swc_html_codegen/tests/options --exclude crates/swc_html_minifier/tests/document_fragment --exclude crates/swc_html_minifier/tests/fixture --exclude crates/swc_html_minifier/tests/recovery --exclude packages/helpers/esm --exclude packages/helpers/scripts .137artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .50artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .4artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 3 file(s) — `crates/swc/benches/assets/table.tsx`, `crates/swc_ts_fast_strip/benches/assets/docusaurus.config.ts`, `packages/core/src/index.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1d8e5-e999-77ca-859c-90267f7f01c3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md