Public report of web-infra-dev/rspack, 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 reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 15:45 UTC · Survey ID cd_936b0bba5d0347b69fe6c10ffadb02b4
web-infra-dev/rspack
Measured 14 November 2026, 15:43 UTC, at code version c068544
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 341,075 lines of product code in 127 projects, tests not counted · Estimated rebuild effort: about 2.8 person-years · Weakest lens: Code Health, 44
Findings by how serious they are
67 critical2222 serious245 minor
20 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 15:43 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.
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 ▸
71of 71 dimensions measured by tools.
2471of 2534 findings point to an exact file and line, so you can open each one in the code. The other 63 concern the repository as a whole, such as missing documentation.
71dimensions across 8 lenses, read from 341,075 lines of product code in 127 projects.
web-infra-dev/rspack falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 54 out of 100 and is rated Adequate, and 47 of its 67 critical findings are security problems.
Code Health, at 44, is the weakest lens and counts most in the score. The best first step is turning on missing-value checks, worth about 5 points. Writing log messages as searchable templates comes next, worth about 4 points. Raising Code Health to 70 would lift the score to about 62.
Twenty-seven pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline. Eight known security holes in the packages the code depends on can be used by attackers, and four pipeline steps run downloads nobody checks. Passing outside input through environment variables, updating the vulnerable packages and checking each download against a checksum would close these risks. Setting a waiting period for automatic updates would fix the three automatic dependency updates that take new releases at once, and limiting each secret to its own step would deal with the two secrets exposed to more of the pipeline than needed. The 16 uses of packages that aren't listed need adding to the project's list of dependencies.
The product code is 341,075 lines, about €410,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 44 to 70, the lowest score rated Strong, the score would rise from 54 to about 62.
Code composition: what the lines of code are
Product code 81%Tests 19%
New since the last survey: 510 findings
These 510 critical or serious findings weren't in the previous survey, on 27 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FunctionTooLong: rspack_plugin_hmr::generate_hot_update crates/rspack_plugin_hmr/src/lib.rs
God Classes · MethodTooLong: ChunkManifest.new crates/rspack_plugin_sri/src/manifest.rs
God Classes · FileTooLong: node_binding/rspack.wasi-browser.js crates/node_binding/rspack.wasi-browser.js
God Classes · FunctionTooLong: rspack_plugin_limit_chunk_count::plan_merges crates/rspack_plugin_limit_chunk_count/src/lib.rs
God Classes · MethodTooLong: ESMExportImportedSpecifierDependency.get_star_reexports crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs
God Classes · FileTooLong: src/module_group.rs crates/rspack_plugin_split_chunks/src/module_group.rs
God Classes · MethodTooLong: ExternalsPlugin.#getRawExternalItem packages/rspack/src/builtin-plugin/ExternalsPlugin.ts
God Classes · FileTooLong: plugin/side_effects_flag_plugin.rs crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs
God Classes · FunctionTooLong: rspack_plugin_javascript::runtime::render_runtime_module_sources crates/rspack_plugin_javascript/src/runtime.rs
God Classes · TooManyFields: NormalModule crates/rspack_core/src/normal_module.rs
Code Duplication · Near-duplicate member pair (79 shared lines) crates/rspack_core/src/stats/mod.rs
Code Duplication · Near-duplicate member pair (73 shared lines) crates/rspack_binding_api/src/compilation/mod.rs
Code Duplication · Near-duplicate member pair (69 shared lines) crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs
Code Duplication · Near-duplicate member pair (63 shared lines) crates/css-module-lexer/src/dependencies.rs
Code Duplication · Near-duplicate member pair (44 shared lines) crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs
Code Duplication · Near-duplicate member pair (41 shared lines) crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) crates/rspack_plugin_library/src/amd_library_plugin.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rspack_binding_api/src/async_dependency_block.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rspack_plugin_esm_library/src/optimize_chunks.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rspack_plugin_library/src/amd_library_plugin.rs
Code Duplication · Edited copy of a member (55 corresponding lines) crates/rspack_plugin_library/src/assign_library_plugin.rs
Code Duplication · Edited copy of a member (63 corresponding lines) crates/css-module-lexer/src/dependencies.rs
Code Duplication · Edited copy of a member (56 corresponding lines) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs
Code Duplication · Edited copy of a member (70 corresponding lines) crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs
Code Duplication · Edited copy of a member (45 corresponding lines) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs
Code Duplication · Edited copy of a member (38 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs
Code Duplication · Edited copy of a member (47 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs
Code Duplication · Edited copy of a member (45 corresponding lines) crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/hash_helper.rs
Code Duplication · Edited copy of a member (51 corresponding lines) crates/rspack_core/src/chunk.rs
Code Duplication · Edited copy of a member (59 corresponding lines) crates/rspack_dojang/src/eval.rs
Code Duplication · Edited copy of a member (37 corresponding lines) crates/rspack_plugin_externals/src/http_externals_plugin.rs
Code Duplication · Edited copy of a member (61 corresponding lines) crates/rspack_plugin_runtime/src/import_scripts_chunk_loading.rs
Code Duplication · Edited copy of a member (63 corresponding lines) crates/rspack_core/src/context_module.rs
Code Duplication · Edited copy of a member (33 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs
Code Duplication · Edited copy of a member (34 corresponding lines) crates/rspack_plugin_rstest/src/parser_plugin.rs
Code Duplication · Edited copy of a member (40 corresponding lines) crates/rspack_plugin_esm_library/src/link.rs
Code Duplication · Edited copy of a member (34 corresponding lines) crates/rspack_hash/src/lib.rs
Code Duplication · Edited copy of a member (46 corresponding lines) crates/rspack_plugin_runtime/src/runtime_module/get_chunk_update_filename.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/rspack_allocative/src/impls/rspack.rs
Code Duplication · Edited copy of a member (60 corresponding lines) crates/rspack_binding_api/src/raw_options/raw_module/mod.rs
Code Duplication · Edited copy of a member (41 corresponding lines) crates/rspack_ids/src/id_helpers.rs
Code Duplication · Edited copy of a member (34 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs
Code Duplication · Edited copy of a member (33 corresponding lines) crates/css-module-lexer/src/dependencies.rs
Code Duplication · Edited copies of one member (7 members, 17+ corresponding lines) crates/rspack_dojang/src/context.rs
Code Duplication · Edited copy of a member (22 corresponding lines) crates/rspack_napi/src/threadsafe_function.rs
Code Duplication · Edited copy of a member (31 corresponding lines) crates/rspack_plugin_rsdoctor/src/plugin.rs
Code Duplication · Edited copy of a member (27 corresponding lines) crates/rspack_ids/src/id_helpers.rs
Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) crates/rspack_binding_api/src/module_graph.rs
Code Duplication · Edited copy of a member (22 corresponding lines) crates/rspack_core/src/options/module.rs
Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs
Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) crates/rspack_core/src/chunk.rs
Code Duplication · Edited copy of a member (20 corresponding lines) crates/rspack_plugin_split_chunks/src/plugin/bitmap.rs
Code Duplication · Edited copy of a member (14 corresponding lines) crates/rspack_core/src/resolver/resolver_impl.rs
Code Duplication · Edited copy of a member (16 corresponding lines) crates/rspack_plugin_mf/src/sharing/consume_shared_module.rs
Code Duplication · Edited copy of a member (27 corresponding lines) crates/rspack_fs/src/native_fs.rs
Code Duplication · Edited copy of a member (27 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs
Code Duplication · Edited copy of a member (36 corresponding lines) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs
Code Duplication · Edited copy of a member (14 corresponding lines) crates/rspack_core/src/runtime.rs
Code Duplication · Edited copy of a member (27 corresponding lines) crates/rspack_plugin_mf/src/container/container_entry_module.rs
Code Duplication · Edited copy of a member (38 corresponding lines) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs
Code Duplication · Edited copy of a member (28 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs
Code Duplication · Edited copy of a member (22 corresponding lines) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs
Code Duplication · Edited copy of a member (34 corresponding lines) crates/rspack_core/src/context_module.rs
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 401 findings
These 401 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one. The first 100 are listed here.
€140,000 to €690,000, for 2,279 to 7,230 hours of work, about 2.8 person-years for 1 to 6 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 54. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 341,075 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
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 `?`).
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 €410,000 to build again, about 2.8 person-years of work. Its weakest lens is Code Health, at 44 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 8% on every change. The history of the code shows how much it changes: about 408,937 lines over the last 90 days, which is about 1,658,467 lines a year. At that pace, the extra work comes to an estimated 140.6 to 843.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1360 modules, with 5065 dependencies between them. 24 loops run through 159 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1320 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.
rspack_core.compiler uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.compiler, while a change to rspack_core.compiler can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→27 rspack_core.dependency.module_dependency uses rspack_core.dependency.dependency_traitpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.dependency.module_dependency uses a type in rspack_core.dependency.dependency_trait.
rspack_core.dependency.module_dependency uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.dependency.module_dependency, while a change to rspack_core.dependency.module_dependency can't break rspack_core.dependency.dependency_trait.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→31 rspack_core.dependency.module_dependency uses rspack_core.dependencypart of a loop✕
Connections
1 pair of types, where a type in rspack_core.dependency.module_dependency uses a type in rspack_core.dependency.
rspack_core.dependency.module_dependency uses rspack_core.dependency, so a change to rspack_core.dependency can break rspack_core.dependency.module_dependency, while a change to rspack_core.dependency.module_dependency can't break rspack_core.dependency.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.runtime_globals uses rspack_hash, so a change to rspack_hash can break rspack_core.runtime_globals, while a change to rspack_core.runtime_globals can't break rspack_hash.
Position
Below the diagonal: rspack_core.runtime_globals uses a module listed above it, which is the healthy direction.
rspack_error.diagnostic uses rspack_collections.identifier, so a change to rspack_collections.identifier can break rspack_error.diagnostic, while a change to rspack_error.diagnostic can't break rspack_collections.identifier.
Position
Below the diagonal: rspack_error.diagnostic uses a module listed above it, which is the healthy direction.
rspack_core.dependency.context_dependency uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_core.dependency.context_dependency, while a change to rspack_core.dependency.context_dependency can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_core.dependency.context_dependency uses a module listed above it, which is the healthy direction.
16→27 rspack_core.dependency.context_dependency uses rspack_core.dependency.dependency_traitpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.dependency.context_dependency uses a type in rspack_core.dependency.dependency_trait.
rspack_core.dependency.context_dependency uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.dependency.context_dependency, while a change to rspack_core.dependency.context_dependency can't break rspack_core.dependency.dependency_trait.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.plugin.context uses rspack_core.compiler, so a change to rspack_core.compiler can break rspack_core.plugin.context, while a change to rspack_core.plugin.context can't break rspack_core.compiler.
Position
Below the diagonal: rspack_core.plugin.context uses a module listed above it, which is the healthy direction.
17→24 rspack_core.plugin.context uses rspack_core.options.modulepart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.plugin.context uses a type in rspack_core.options.module.
rspack_core.plugin.context uses rspack_core.options.module, so a change to rspack_core.options.module can break rspack_core.plugin.context, while a change to rspack_core.plugin.context can't break rspack_core.options.module.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→33 rspack_core.plugin.context uses rspack_core.compilationpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.plugin.context uses a type in rspack_core.compilation.
rspack_core.plugin.context uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.plugin.context, while a change to rspack_core.plugin.context can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→37 rspack_core.plugin.context uses rspack_corepart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.plugin.context uses a type in rspack_core.
rspack_core.plugin.context uses rspack_core, so a change to rspack_core can break rspack_core.plugin.context, while a change to rspack_core.plugin.context can't break rspack_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_error.displayer uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_error.displayer, while a change to rspack_error.displayer can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_error.displayer uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_category uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.dependency.dependency_category, while a change to rspack_core.dependency.dependency_category can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.dependency.dependency_category uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_type uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.dependency.dependency_type, while a change to rspack_core.dependency.dependency_type can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.dependency.dependency_type uses a module listed above it, which is the healthy direction.
rspack_core.options.output uses rspack_core.ukey, so a change to rspack_core.ukey can break rspack_core.options.output, while a change to rspack_core.options.output can't break rspack_core.ukey.
Position
Below the diagonal: rspack_core.options.output uses a module listed above it, which is the healthy direction.
rspack_core.options.output uses rspack_hash, so a change to rspack_hash can break rspack_core.options.output, while a change to rspack_core.options.output can't break rspack_hash.
Position
Below the diagonal: rspack_core.options.output uses a module listed above it, which is the healthy direction.
rspack_core.options.output uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.options.output, while a change to rspack_core.options.output can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.options.output uses a module listed above it, which is the healthy direction.
21→33 rspack_core.options.output uses rspack_core.compilationpart of a loop✕
Connections
3 pairs of types, where a type in rspack_core.options.output uses a type in rspack_core.compilation.
rspack_core.options.output uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.options.output, while a change to rspack_core.options.output can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→34 rspack_core.options.output uses rspack_core.chunkpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.options.output uses a type in rspack_core.chunk.
rspack_core.options.output uses rspack_core.chunk, so a change to rspack_core.chunk can break rspack_core.options.output, while a change to rspack_core.options.output can't break rspack_core.chunk.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→37 rspack_core.options.output uses rspack_corepart of a loop✕
Connections
1 pair of types, where a type in rspack_core.options.output uses a type in rspack_core.
rspack_core.options.output uses rspack_core, so a change to rspack_core can break rspack_core.options.output, while a change to rspack_core.options.output can't break rspack_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.runtime uses rspack_hash, so a change to rspack_hash can break rspack_core.runtime, while a change to rspack_core.runtime can't break rspack_hash.
Position
Below the diagonal: rspack_core.runtime uses a module listed above it, which is the healthy direction.
rspack_core.runtime uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.runtime, while a change to rspack_core.runtime can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.runtime uses a module listed above it, which is the healthy direction.
rspack_core.module_graph uses rspack_core.artifacts.exports_info_artifact, so a change to rspack_core.artifacts.exports_info_artifact can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.artifacts.exports_info_artifact.
Position
Below the diagonal: rspack_core.module_graph uses a module listed above it, which is the healthy direction.
rspack_core.module_graph uses rspack_core.artifacts.side_effects_state_artifact, so a change to rspack_core.artifacts.side_effects_state_artifact can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.artifacts.side_effects_state_artifact.
Position
Below the diagonal: rspack_core.module_graph uses a module listed above it, which is the healthy direction.
rspack_core.module_graph uses rspack_core.dependency.dependency_id, so a change to rspack_core.dependency.dependency_id can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.dependency.dependency_id.
Position
Below the diagonal: rspack_core.module_graph uses a module listed above it, which is the healthy direction.
rspack_core.module_graph uses rspack_intern.atom, so a change to rspack_intern.atom can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_intern.atom.
Position
Below the diagonal: rspack_core.module_graph uses a module listed above it, which is the healthy direction.
rspack_core.module_graph uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.module_graph uses a module listed above it, which is the healthy direction.
23→27 rspack_core.module_graph uses rspack_core.dependency.dependency_traitpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.module_graph uses a type in rspack_core.dependency.dependency_trait.
rspack_core.module_graph uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.dependency.dependency_trait.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→29 rspack_core.module_graph uses rspack_core.dependencies_blockpart of a loop✕
Connections
3 pairs of types, where a type in rspack_core.module_graph uses a type in rspack_core.dependencies_block.
rspack_core.module_graph uses rspack_core.dependencies_block, so a change to rspack_core.dependencies_block can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.dependencies_block.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→30 rspack_core.module_graph uses rspack_core.modulepart of a loop✕
Connections
1 pair of types, where a type in rspack_core.module_graph uses a type in rspack_core.module.
rspack_core.module_graph uses rspack_core.module, so a change to rspack_core.module can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.module.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→33 rspack_core.module_graph uses rspack_core.compilationpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.module_graph uses a type in rspack_core.compilation.
rspack_core.module_graph uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.module_graph, while a change to rspack_core.module_graph can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.options.module uses rspack_hash, so a change to rspack_hash can break rspack_core.options.module, while a change to rspack_core.options.module can't break rspack_hash.
Position
Below the diagonal: rspack_core.options.module uses a module listed above it, which is the healthy direction.
rspack_core.options.module uses rspack_core.plugin.context, so a change to rspack_core.plugin.context can break rspack_core.options.module, while a change to rspack_core.options.module can't break rspack_core.plugin.context.
Position
Below the diagonal: rspack_core.options.module uses a module listed above it, which is the healthy direction.
rspack_core.options.module uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.options.module, while a change to rspack_core.options.module can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.options.module uses a module listed above it, which is the healthy direction.
rspack_core.options.module uses rspack_core.options.output, so a change to rspack_core.options.output can break rspack_core.options.module, while a change to rspack_core.options.module can't break rspack_core.options.output.
Position
Below the diagonal: rspack_core.options.module uses a module listed above it, which is the healthy direction.
24→33 rspack_core.options.module uses rspack_core.compilationpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.options.module uses a type in rspack_core.compilation.
rspack_core.options.module uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.options.module, while a change to rspack_core.options.module can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→37 rspack_core.options.module uses rspack_corepart of a loop✕
Connections
1 pair of types, where a type in rspack_core.options.module uses a type in rspack_core.
rspack_core.options.module uses rspack_core, so a change to rspack_core can break rspack_core.options.module, while a change to rspack_core.options.module can't break rspack_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.runtime_template uses rspack_collections.identifier, so a change to rspack_collections.identifier can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_collections.identifier.
Position
Below the diagonal: rspack_core.runtime_template uses a module listed above it, which is the healthy direction.
rspack_core.runtime_template uses rspack_core.artifacts.exports_info_artifact, so a change to rspack_core.artifacts.exports_info_artifact can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.artifacts.exports_info_artifact.
Position
Below the diagonal: rspack_core.runtime_template uses a module listed above it, which is the healthy direction.
rspack_core.runtime_template uses rspack_core.dependency.dependency_id, so a change to rspack_core.dependency.dependency_id can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.dependency.dependency_id.
Position
Below the diagonal: rspack_core.runtime_template uses a module listed above it, which is the healthy direction.
rspack_core.runtime_template uses rspack_core.runtime_globals, so a change to rspack_core.runtime_globals can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.runtime_globals.
Position
Below the diagonal: rspack_core.runtime_template uses a module listed above it, which is the healthy direction.
rspack_core.runtime_template uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.runtime_template uses a module listed above it, which is the healthy direction.
rspack_core.runtime_template uses rspack_core.module_graph, so a change to rspack_core.module_graph can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.module_graph.
Position
Below the diagonal: rspack_core.runtime_template uses a module listed above it, which is the healthy direction.
25→29 rspack_core.runtime_template uses rspack_core.dependencies_blockpart of a loop✕
Connections
1 pair of types, where a type in rspack_core.runtime_template uses a type in rspack_core.dependencies_block.
rspack_core.runtime_template uses rspack_core.dependencies_block, so a change to rspack_core.dependencies_block can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.dependencies_block.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→30 rspack_core.runtime_template uses rspack_core.modulepart of a loop✕
Connections
6 pairs of types, where a type in rspack_core.runtime_template uses a type in rspack_core.module.
rspack_core.runtime_template uses rspack_core.module, so a change to rspack_core.module can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.module.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→31 rspack_core.runtime_template uses rspack_core.dependencypart of a loop✕
Connections
1 pair of types, where a type in rspack_core.runtime_template uses a type in rspack_core.dependency.
rspack_core.runtime_template uses rspack_core.dependency, so a change to rspack_core.dependency can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.dependency.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→33 rspack_core.runtime_template uses rspack_core.compilationpart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.runtime_template uses a type in rspack_core.compilation.
rspack_core.runtime_template uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.runtime_template, while a change to rspack_core.runtime_template can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.dependency.dependency_template uses rspack_hash, so a change to rspack_hash can break rspack_core.dependency.dependency_template, while a change to rspack_core.dependency.dependency_template can't break rspack_hash.
Position
Below the diagonal: rspack_core.dependency.dependency_template uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_template uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.dependency.dependency_template, while a change to rspack_core.dependency.dependency_template can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.dependency.dependency_template uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_template uses rspack_core.runtime_template, so a change to rspack_core.runtime_template can break rspack_core.dependency.dependency_template, while a change to rspack_core.dependency.dependency_template can't break rspack_core.runtime_template.
Position
Below the diagonal: rspack_core.dependency.dependency_template uses a module listed above it, which is the healthy direction.
26→33 rspack_core.dependency.dependency_template uses rspack_core.compilationpart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.dependency.dependency_template uses a type in rspack_core.compilation.
rspack_core.dependency.dependency_template uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.dependency.dependency_template, while a change to rspack_core.dependency.dependency_template can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.dependency.dependency_trait uses rspack_core.artifacts.exports_info_artifact, so a change to rspack_core.artifacts.exports_info_artifact can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.artifacts.exports_info_artifact.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.artifacts.side_effects_state_artifact, so a change to rspack_core.artifacts.side_effects_state_artifact can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.artifacts.side_effects_state_artifact.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.cache.codec, so a change to rspack_core.cache.codec can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.cache.codec.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.dependency_id, so a change to rspack_core.dependency.dependency_id can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.dependency_id.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.dependency_location, so a change to rspack_core.dependency.dependency_location can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.dependency_location.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.module_dependency, so a change to rspack_core.dependency.module_dependency can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.module_dependency.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.context_dependency, so a change to rspack_core.dependency.context_dependency can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.context_dependency.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.dependency_category, so a change to rspack_core.dependency.dependency_category can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.dependency_category.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.dependency_type, so a change to rspack_core.dependency.dependency_type can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.dependency_type.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.module_graph, so a change to rspack_core.module_graph can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.module_graph.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.options.module, so a change to rspack_core.options.module can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.options.module.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
rspack_core.dependency.dependency_trait uses rspack_core.dependency.dependency_template, so a change to rspack_core.dependency.dependency_template can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.dependency_template.
Position
Below the diagonal: rspack_core.dependency.dependency_trait uses a module listed above it, which is the healthy direction.
27→31 rspack_core.dependency.dependency_trait uses rspack_core.dependencypart of a loop✕
Connections
3 pairs of types, where a type in rspack_core.dependency.dependency_trait uses a type in rspack_core.dependency.
rspack_core.dependency.dependency_trait uses rspack_core.dependency, so a change to rspack_core.dependency can break rspack_core.dependency.dependency_trait, while a change to rspack_core.dependency.dependency_trait can't break rspack_core.dependency.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.artifacts.build_module_graph_artifact uses rspack_core.artifacts.side_effects_state_artifact, so a change to rspack_core.artifacts.side_effects_state_artifact can break rspack_core.artifacts.build_module_graph_artifact, while a change to rspack_core.artifacts.build_module_graph_artifact can't break rspack_core.artifacts.side_effects_state_artifact.
Position
Below the diagonal: rspack_core.artifacts.build_module_graph_artifact uses a module listed above it, which is the healthy direction.
rspack_core.artifacts.build_module_graph_artifact uses rspack_core.dependency.dependency_id, so a change to rspack_core.dependency.dependency_id can break rspack_core.artifacts.build_module_graph_artifact, while a change to rspack_core.artifacts.build_module_graph_artifact can't break rspack_core.dependency.dependency_id.
Position
Below the diagonal: rspack_core.artifacts.build_module_graph_artifact uses a module listed above it, which is the healthy direction.
rspack_core.artifacts.build_module_graph_artifact uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_core.artifacts.build_module_graph_artifact, while a change to rspack_core.artifacts.build_module_graph_artifact can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_core.artifacts.build_module_graph_artifact uses a module listed above it, which is the healthy direction.
rspack_core.artifacts.build_module_graph_artifact uses rspack_core.module_graph, so a change to rspack_core.module_graph can break rspack_core.artifacts.build_module_graph_artifact, while a change to rspack_core.artifacts.build_module_graph_artifact can't break rspack_core.module_graph.
Position
Below the diagonal: rspack_core.artifacts.build_module_graph_artifact uses a module listed above it, which is the healthy direction.
rspack_core.artifacts.build_module_graph_artifact uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.artifacts.build_module_graph_artifact, while a change to rspack_core.artifacts.build_module_graph_artifact can't break rspack_core.dependency.dependency_trait.
Position
Below the diagonal: rspack_core.artifacts.build_module_graph_artifact uses a module listed above it, which is the healthy direction.
rspack_core.dependencies_block uses rspack_collections.identifier, so a change to rspack_collections.identifier can break rspack_core.dependencies_block, while a change to rspack_core.dependencies_block can't break rspack_collections.identifier.
Position
Below the diagonal: rspack_core.dependencies_block uses a module listed above it, which is the healthy direction.
rspack_core.dependencies_block uses rspack_core.dependency.dependency_id, so a change to rspack_core.dependency.dependency_id can break rspack_core.dependencies_block, while a change to rspack_core.dependencies_block can't break rspack_core.dependency.dependency_id.
Position
Below the diagonal: rspack_core.dependencies_block uses a module listed above it, which is the healthy direction.
rspack_core.dependencies_block uses rspack_hash, so a change to rspack_hash can break rspack_core.dependencies_block, while a change to rspack_core.dependencies_block can't break rspack_hash.
Position
Below the diagonal: rspack_core.dependencies_block uses a module listed above it, which is the healthy direction.
rspack_core.dependencies_block uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.dependencies_block, while a change to rspack_core.dependencies_block can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.dependencies_block uses a module listed above it, which is the healthy direction.
rspack_core.dependencies_block uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.dependencies_block, while a change to rspack_core.dependencies_block can't break rspack_core.dependency.dependency_trait.
Position
Below the diagonal: rspack_core.dependencies_block uses a module listed above it, which is the healthy direction.
29→33 rspack_core.dependencies_block uses rspack_core.compilationpart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.dependencies_block uses a type in rspack_core.compilation.
rspack_core.dependencies_block uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.dependencies_block, while a change to rspack_core.dependencies_block can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.module uses rspack_collections.identifier, so a change to rspack_collections.identifier can break rspack_core.module, while a change to rspack_core.module can't break rspack_collections.identifier.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.artifacts.exports_info_artifact, so a change to rspack_core.artifacts.exports_info_artifact can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.artifacts.exports_info_artifact.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.artifacts.side_effects_state_artifact, so a change to rspack_core.artifacts.side_effects_state_artifact can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.artifacts.side_effects_state_artifact.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.cache.codec, so a change to rspack_core.cache.codec can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.cache.codec.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.dependency.dependency_id, so a change to rspack_core.dependency.dependency_id can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.dependency.dependency_id.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.ukey, so a change to rspack_core.ukey can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.ukey.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_hash, so a change to rspack_hash can break rspack_core.module, while a change to rspack_core.module can't break rspack_hash.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_intern.atom, so a change to rspack_intern.atom can break rspack_core.module, while a change to rspack_core.module can't break rspack_intern.atom.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.compiler, so a change to rspack_core.compiler can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.compiler.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.module, while a change to rspack_core.module can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.module_graph, so a change to rspack_core.module_graph can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.module_graph.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.options.module, so a change to rspack_core.options.module can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.options.module.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.runtime_template, so a change to rspack_core.runtime_template can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.runtime_template.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.dependency.dependency_trait.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
rspack_core.module uses rspack_core.dependencies_block, so a change to rspack_core.dependencies_block can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.dependencies_block.
Position
Below the diagonal: rspack_core.module uses a module listed above it, which is the healthy direction.
30→31 rspack_core.module uses rspack_core.dependencypart of a loop✕
Connections
1 pair of types, where a type in rspack_core.module uses a type in rspack_core.dependency.
rspack_core.module uses rspack_core.dependency, so a change to rspack_core.dependency can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.dependency.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
30→33 rspack_core.module uses rspack_core.compilationpart of a loop✕
Connections
5 pairs of types, where a type in rspack_core.module uses a type in rspack_core.compilation.
rspack_core.module uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.compilation.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
30→37 rspack_core.module uses rspack_corepart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.module uses a type in rspack_core.
rspack_core.module uses rspack_core, so a change to rspack_core can break rspack_core.module, while a change to rspack_core.module can't break rspack_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.dependency uses rspack_core.artifacts.exports_info_artifact, so a change to rspack_core.artifacts.exports_info_artifact can break rspack_core.dependency, while a change to rspack_core.dependency can't break rspack_core.artifacts.exports_info_artifact.
Position
Below the diagonal: rspack_core.dependency uses a module listed above it, which is the healthy direction.
rspack_core.dependency uses rspack_core.artifacts.side_effects_state_artifact, so a change to rspack_core.artifacts.side_effects_state_artifact can break rspack_core.dependency, while a change to rspack_core.dependency can't break rspack_core.artifacts.side_effects_state_artifact.
Position
Below the diagonal: rspack_core.dependency uses a module listed above it, which is the healthy direction.
rspack_core.dependency uses rspack_intern.atom, so a change to rspack_intern.atom can break rspack_core.dependency, while a change to rspack_core.dependency can't break rspack_intern.atom.
Position
Below the diagonal: rspack_core.dependency uses a module listed above it, which is the healthy direction.
rspack_core.dependency uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.dependency, while a change to rspack_core.dependency can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.dependency uses a module listed above it, which is the healthy direction.
rspack_core.dependency uses rspack_core.module_graph, so a change to rspack_core.module_graph can break rspack_core.dependency, while a change to rspack_core.dependency can't break rspack_core.module_graph.
Position
Below the diagonal: rspack_core.dependency uses a module listed above it, which is the healthy direction.
rspack_core.dependency uses rspack_core.module, so a change to rspack_core.module can break rspack_core.dependency, while a change to rspack_core.dependency can't break rspack_core.module.
Position
Below the diagonal: rspack_core.dependency uses a module listed above it, which is the healthy direction.
rspack_core.module_factory uses rspack_core.cache.codec, so a change to rspack_core.cache.codec can break rspack_core.module_factory, while a change to rspack_core.module_factory can't break rspack_core.cache.codec.
Position
Below the diagonal: rspack_core.module_factory uses a module listed above it, which is the healthy direction.
rspack_core.module_factory uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_core.module_factory, while a change to rspack_core.module_factory can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_core.module_factory uses a module listed above it, which is the healthy direction.
rspack_core.module_factory uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.module_factory, while a change to rspack_core.module_factory can't break rspack_core.dependency.dependency_trait.
Position
Below the diagonal: rspack_core.module_factory uses a module listed above it, which is the healthy direction.
rspack_core.module_factory uses rspack_core.module, so a change to rspack_core.module can break rspack_core.module_factory, while a change to rspack_core.module_factory can't break rspack_core.module.
Position
Below the diagonal: rspack_core.module_factory uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.ukey, so a change to rspack_core.ukey can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.ukey.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_hash, so a change to rspack_hash can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_hash.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.compiler, so a change to rspack_core.compiler can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.compiler.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.dependency.dependency_type, so a change to rspack_core.dependency.dependency_type can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.dependency.dependency_type.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.options.output, so a change to rspack_core.options.output can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.options.output.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.module_graph, so a change to rspack_core.module_graph can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.module_graph.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.runtime_template, so a change to rspack_core.runtime_template can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.runtime_template.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.dependency.dependency_template, so a change to rspack_core.dependency.dependency_template can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.dependency.dependency_template.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.dependency.dependency_trait, so a change to rspack_core.dependency.dependency_trait can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.dependency.dependency_trait.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.module, so a change to rspack_core.module can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.module.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
rspack_core.compilation uses rspack_core.dependency, so a change to rspack_core.dependency can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.dependency.
Position
Below the diagonal: rspack_core.compilation uses a module listed above it, which is the healthy direction.
33→37 rspack_core.compilation uses rspack_corepart of a loop✕
Connections
1 pair of types, where a type in rspack_core.compilation uses a type in rspack_core.
rspack_core.compilation uses rspack_core, so a change to rspack_core can break rspack_core.compilation, while a change to rspack_core.compilation can't break rspack_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.chunk uses rspack_core.ukey, so a change to rspack_core.ukey can break rspack_core.chunk, while a change to rspack_core.chunk can't break rspack_core.ukey.
Position
Below the diagonal: rspack_core.chunk uses a module listed above it, which is the healthy direction.
rspack_core.chunk uses rspack_hash, so a change to rspack_hash can break rspack_core.chunk, while a change to rspack_core.chunk can't break rspack_hash.
Position
Below the diagonal: rspack_core.chunk uses a module listed above it, which is the healthy direction.
rspack_core.chunk uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_core.chunk, while a change to rspack_core.chunk can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_core.chunk uses a module listed above it, which is the healthy direction.
rspack_core.chunk uses rspack_core.runtime, so a change to rspack_core.runtime can break rspack_core.chunk, while a change to rspack_core.chunk can't break rspack_core.runtime.
Position
Below the diagonal: rspack_core.chunk uses a module listed above it, which is the healthy direction.
rspack_core.chunk uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.chunk, while a change to rspack_core.chunk can't break rspack_core.compilation.
Position
Below the diagonal: rspack_core.chunk uses a module listed above it, which is the healthy direction.
34→37 rspack_core.chunk uses rspack_corepart of a loop✕
Connections
2 pairs of types, where a type in rspack_core.chunk uses a type in rspack_core.
rspack_core.chunk uses rspack_core, so a change to rspack_core can break rspack_core.chunk, while a change to rspack_core.chunk can't break rspack_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_core.plugin uses rspack_core.plugin.context, so a change to rspack_core.plugin.context can break rspack_core.plugin, while a change to rspack_core.plugin can't break rspack_core.plugin.context.
Position
Below the diagonal: rspack_core.plugin uses a module listed above it, which is the healthy direction.
rspack_core.plugin uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.plugin, while a change to rspack_core.plugin can't break rspack_core.compilation.
Position
Below the diagonal: rspack_core.plugin uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_collections.identifier, so a change to rspack_collections.identifier can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_collections.identifier.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_core.ukey, so a change to rspack_core.ukey can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_core.ukey.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_hash, so a change to rspack_hash can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_hash.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_core.runtime_globals, so a change to rspack_core.runtime_globals can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_core.runtime_globals.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_core.runtime_template, so a change to rspack_core.runtime_template can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_core.runtime_template.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_core.module, so a change to rspack_core.module can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_core.module.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core.runtime_module uses rspack_core.compilation, so a change to rspack_core.compilation can break rspack_core.runtime_module, while a change to rspack_core.runtime_module can't break rspack_core.compilation.
Position
Below the diagonal: rspack_core.runtime_module uses a module listed above it, which is the healthy direction.
rspack_core uses rspack_error.displayer, so a change to rspack_error.displayer can break rspack_core, while a change to rspack_core can't break rspack_error.displayer.
Position
Below the diagonal: rspack_core uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in rspack_core uses a type in rspack_core.chunk.
The types involved
rspack_core.ChunkByUkey → rspack_core.chunk.Chunk
Direction
rspack_core uses rspack_core.chunk, so a change to rspack_core.chunk can break rspack_core, while a change to rspack_core can't break rspack_core.chunk.
Position
Below the diagonal: rspack_core uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_core.dependency.dependency_location, so a change to rspack_core.dependency.dependency_location can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_core.dependency.dependency_location.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_dojang.eval, so a change to rspack_dojang.eval can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_dojang.eval.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_intern.atom, so a change to rspack_intern.atom can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_intern.atom.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_error.diagnostic, so a change to rspack_error.diagnostic can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_error.diagnostic.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_core.plugin.context, so a change to rspack_core.plugin.context can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_core.plugin.context.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_core.options.module, so a change to rspack_core.options.module can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_core.options.module.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_core.dependencies_block, so a change to rspack_core.dependencies_block can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_core.dependencies_block.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_core.module, so a change to rspack_core.module can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_core.module.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_core, so a change to rspack_core can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_core.
Position
Below the diagonal: rspack_plugin_javascript.visitors.dependency.parser uses a module listed above it, which is the healthy direction.
38→39 rspack_plugin_javascript.visitors.dependency.parser uses rspack_plugin_javascript.utils.evalpart of a loop✕
Connections
1 pair of types, where a type in rspack_plugin_javascript.visitors.dependency.parser uses a type in rspack_plugin_javascript.utils.eval.
rspack_plugin_javascript.visitors.dependency.parser uses rspack_plugin_javascript.utils.eval, so a change to rspack_plugin_javascript.utils.eval can break rspack_plugin_javascript.visitors.dependency.parser, while a change to rspack_plugin_javascript.visitors.dependency.parser can't break rspack_plugin_javascript.utils.eval.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rspack_plugin_javascript.utils.eval uses rspack_core.dependency.dependency_location, so a change to rspack_core.dependency.dependency_location can break rspack_plugin_javascript.utils.eval, while a change to rspack_plugin_javascript.utils.eval can't break rspack_core.dependency.dependency_location.
Position
Below the diagonal: rspack_plugin_javascript.utils.eval uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.utils.eval uses rspack_dojang.eval, so a change to rspack_dojang.eval can break rspack_plugin_javascript.utils.eval, while a change to rspack_plugin_javascript.utils.eval can't break rspack_dojang.eval.
Position
Below the diagonal: rspack_plugin_javascript.utils.eval uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.utils.eval uses rspack_intern.atom, so a change to rspack_intern.atom can break rspack_plugin_javascript.utils.eval, while a change to rspack_plugin_javascript.utils.eval can't break rspack_intern.atom.
Position
Below the diagonal: rspack_plugin_javascript.utils.eval uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.utils.eval uses rspack_plugin_javascript.visitors.dependency.parser, so a change to rspack_plugin_javascript.visitors.dependency.parser can break rspack_plugin_javascript.utils.eval, while a change to rspack_plugin_javascript.utils.eval can't break rspack_plugin_javascript.visitors.dependency.parser.
Position
Below the diagonal: rspack_plugin_javascript.utils.eval uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.parser_plugin.trait uses rspack_dojang.eval, so a change to rspack_dojang.eval can break rspack_plugin_javascript.parser_plugin.trait, while a change to rspack_plugin_javascript.parser_plugin.trait can't break rspack_dojang.eval.
Position
Below the diagonal: rspack_plugin_javascript.parser_plugin.trait uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.parser_plugin.trait uses rspack_intern.atom, so a change to rspack_intern.atom can break rspack_plugin_javascript.parser_plugin.trait, while a change to rspack_plugin_javascript.parser_plugin.trait can't break rspack_intern.atom.
Position
Below the diagonal: rspack_plugin_javascript.parser_plugin.trait uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.parser_plugin.trait uses rspack_plugin_javascript.visitors.dependency.parser, so a change to rspack_plugin_javascript.visitors.dependency.parser can break rspack_plugin_javascript.parser_plugin.trait, while a change to rspack_plugin_javascript.parser_plugin.trait can't break rspack_plugin_javascript.visitors.dependency.parser.
Position
Below the diagonal: rspack_plugin_javascript.parser_plugin.trait uses a module listed above it, which is the healthy direction.
rspack_plugin_javascript.parser_plugin.trait uses rspack_plugin_javascript.utils.eval, so a change to rspack_plugin_javascript.utils.eval can break rspack_plugin_javascript.parser_plugin.trait, while a change to rspack_plugin_javascript.parser_plugin.trait can't break rspack_plugin_javascript.utils.eval.
Position
Below the diagonal: rspack_plugin_javascript.parser_plugin.trait uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 44% · Weak · gated by D2, X4, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
42
High / Critical
A03:2025 — Software Supply Chain Failures
39
High / Critical
A02:2025 — Security Misconfiguration
2
High / Critical
Roadmap
Top priorities: 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 `?`); Interpolated log message defeats structured logging; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
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 `?`).
Bring the 16 bodies over 120 down to 120 or less in Cognitive Complexity — start with rspack_plugin_hmr::generate_hot_update (cognitive 273), rspack_core::options::resolve::clever_merge::_merge_resolve (cognitive 264), rspack_core::options::resolve::clever_merge::parse_resolve (cognitive 261).
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 — 67
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 — 2222
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 — 245
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 20
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 71 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 — 71 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2471 of 2534 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
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: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
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 196 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 174 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 source is present (.rs, .ts, .mjs, .js, .cts, .tsx, .jsx) and this repository declares a Cargo test suite (repository root, 252 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
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.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — 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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
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/node_binding/napi-binding.d.ts`, `crates/rspack_plugin_esm_library/src/link.rs`, `packages/create-rspack/template-react-ts/rspack.config.ts`, `packages/create-rspack/template-vanilla-ts/rspack.config.ts`, `packages/create-rspack/template-vue-ts/rspack.config.ts`, … (+21 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AC6 Visual & motion safety — 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. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in packages/rspack/src/runtime/moduleFederationDefaultRuntime.js, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. A program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. (rule: missing-tool). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> monorepo@2.3.2 dev / > pnpm --filter @rspack/cli run dev / sh: 1: pnpm: not found" No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> monorepo@2.3.2 dev / > pnpm --filter @rspack/cli run dev / sh: 1: pnpm: not found" No runtime evidence was gathered.
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 Rust, Vue components 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 Rust, Vue components 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. A badge or prose version claim scored 9/17 in its adjudication (docs/plans/deterministic-engine/adjudication/M4-v3.md: badges 9/9, prose 0/8, where prose versions are minimums or history), short of the 95 % precision gate, so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them. The .NET and Node.js version checks are a different kind and still publish.
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.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 45 further occurrence(s) are not listed individually; the score already reflects all 85.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 157 further occurrence(s) are not listed individually; the score already reflects all 197.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 51 further occurrence(s) are not listed individually; the score already reflects all 91.
SC1 Supply-chain hygiene — 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. 8 further occurrence(s) are not listed individually; the score already reflects all 48.
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. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
X12 Unreachable branch — 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.
X13 Undrained process stream — 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.
X16 Unfloored truncation loop — 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.
X17 Uncapped recursion over a caller-supplied document — 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.
X19 Unrestored process-global state — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 550 further occurrence(s) are not listed individually; the score already reflects all 590.
X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
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. 85 further occurrence(s) are not listed individually; the score already reflects all 125.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
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.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned 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.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
244 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was rspack::builder::target::merge_target_properties at 187. A further 22 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being BuiltinPlugin::append_to at 106 — they are counted neither in the figure above nor in this dimension's score. 12 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs (BuiltinPlugin::append_to at 106), packages/rspack/src/RuntimeGlobals.ts (RuntimeGlobals.renderRuntimeGlobals at 83), crates/rspack_core/src/runtime_globals.rs (rspack_core::runtime_globals::runtime_globals_property_name at 81), crates/rspack_core/src/dependency/dependency_type.rs (DependencyType::as_str at 79), crates/rspack/src/builder/builder_context.rs (BuilderContext::take_plugins at 50), and 7 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 122 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with rspack::builder::target::merge_target_properties (cyclomatic 187), rspack_core::options::resolve::clever_merge::_merge_resolve (cyclomatic 131), rspack_core::options::resolve::clever_merge::parse_resolve (cyclomatic 122). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 209 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 16 bodies over 120 down to 120 or less in Cognitive Complexity — start with rspack_plugin_hmr::generate_hot_update (cognitive 273), rspack_core::options::resolve::clever_merge::_merge_resolve (cognitive 264), rspack_core::options::resolve::clever_merge::parse_resolve (cognitive 261). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 16 together lifts Cognitive Complexity from 3.3 to about 4.6/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.6 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 93 MethodTooLong finding(s) in God Classes — start with mod.rs (14), lib.rs (7), link.rs (6). — One of this dimension's main actionable groups (93 warning-level).
Resolve the 88 FileTooLong finding(s) in God Classes — start with mod.rs (13), lib.rs (6), plugin.rs (5). — One of this dimension's main actionable groups (88 warning-level).
Resolve the 56 FunctionTooLong finding(s) in God Classes — start with lib.rs (7), mod.rs (7), runtime.rs (2). — One of this dimension's main actionable groups (56 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
370 duplicated block group(s) detected. 4.7 % of the production lines (15,923 of 341,075) are in a reported copy. A further 245 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 165 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with mod.rs (3), lib.rs (3), dependencies.rs. — One of this dimension's main actionable groups (30 warning-level).
Resolve the 27 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (5), runtime.rs (2), utils.rs (2). — One of this dimension's main actionable groups (27 warning-level).
Resolve the 26 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (3), source_map_dev_tool_plugin.rs (2), lib.rs (2). — One of this dimension's main actionable groups (26 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.7 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
127 production modules (Cargo+npm), 0 dependency cycle(s), 24 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 93 of the 127 (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: rspack_browserslist · ×7
Unstable project @rspack/binding
Unstable project rspack_binding_api
Unstable project rspack_loader_swc
Unstable project rspack_loader_testing
+ 20 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project @rspack/binding finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project rspack_binding_api finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 11 Low cohesion finding(s) in Cohesion (LCOM4) — start with mod.rs (3), native_fs.rs, api_plugin.rs. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality9.4 / 10Stronggated by 8 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
1 skipped, 7 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 196 tests. Measured on the JavaScript/TypeScript suite only — at least 174 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: test a-1 · ×7tests/rspack-test/configCases/source-map/nosources/list.test.ts:4
Skipped test: should have `process.env.WEBPACK_SERVE` set on serve modepackages/rspack-cli/tests/build/issue-6359/index.test.ts:15
What to do
Resolve the 7 No assertions finding(s) in Test Quality — start with index.test.ts (4), list.test.ts (3). — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Skipped test finding(s) in Test Quality — start with index.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
10 outdated, 0 yanked direct Cargo dependencies. 126 of 131 direct crates were graded against crates.io (0 not published there, 5 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: inventory · ×10
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 686 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: packages/rspack/src/loader-runner/index.ts (18×138=2484); packages/rspack/src/config/defaults.ts (20×119=2380); crates/rspack_core/src/concatenated_module.rs (25×77=1925) Repeated repair below the complexity floor: tests/rspack-test/cacheTestOptions.mjs (15 of 18 changes were fixes); packages/rspack/src/Compiler.ts (8 of 15 changes were fixes); crates/rspack_binding_api/src/plugins/js_loader/scheduler.rs (5 of 9 changes were fixes)
Resolve the 82 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (8), lib.rs (5), plugin.rs (4). — One of this dimension's main actionable groups (82 warning-level).
Resolve the 19 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), cacheTestOptions.mjs, Compiler.ts. — One of this dimension's main actionable groups (19 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.5 / 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.
44 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/rspack_plugin_javascript/src/runtime_context.rs. Counted over 863 of the 1556 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×5
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.
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.
157 deducted task-comment markers across 341075 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 138 TodoComment finding(s) in Explicit Debt — start with mod.rs (24), lib.rs (9), scope.rs (7). — One of this dimension's main actionable groups (138 warning-level).
Resolve the 18 FixmeComment finding(s) in Explicit Debt — start with mod.rs (5), require_context_dependency_parser_plugin.rs (3), lib.rs (2). — One of this dimension's main actionable groups (18 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with module_concatenation_plugin.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 2 documentation facets pass in full; short on: F2 example. 420 document(s) read across 38 unit(s).
Documentation: no build, run or usage example · ×5README.md:1
What to do
Resolve the 5 Documentation finding(s) in Documentation Quality — start with README.md (5). — One of this dimension's main actionable groups (5 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ 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.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json. — 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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
2 naming inconsistencies among 39 declarations measured against a convention their peers follow.
`expectExternalMappingURL` spells `URL` where 20 names in the project spell it `Url`tests/rspack-test/configCases/css/source-map-export-types/index.js:194
`moduleURL` spells `URL` where 17 names in the project spell it `Url`packages/rspack-test-tools/src/helper/node-case.ts:26
What to do
Resolve the 1 `expectExternalMappingURL` spells `URL` where 20 names in the project… finding(s) in Naming Consistency — start with index.js. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `moduleURL` spells `URL` where 17 names in the project spell it `Url` finding(s) in Naming Consistency — start with node-case.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the names · ×5packages/rspack-cli/src/utils/options.ts:120
What to do
Resolve the 14 redundant comment finding(s) in Comment Value — start with index.test.ts (2), example.js (2), preview.ts. — One of this dimension's main actionable groups (14 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
42 finding(s): 0 critical, 38 high, 4 medium, 0 low. semgrep hit a parse error in 38 file(s) — `crates/node_binding/napi-binding.d.ts` (line 69), `crates/rspack_core/src/new_cache/db/turbo.rs` (line 62, line 81, line 100), `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs` (line 2212, line 2346, line 2379, …), `crates/rspack_plugin_esm_library/src/link.rs` (line 1355), `crates/rspack_plugin_split_chunks/src/plugin/module_group.rs` (line 1092), … (+33 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 13 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
Resolve the 25 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (15), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (25 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
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.
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 8 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 warning-level).
Resolve the 7 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7). — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
53 of 863 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/rspack/src/builder/devtool.rs. Counted over 863 of the 1556 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 29 Change coupling finding(s) in Change Coupling — start with mod.rs (6), common_js_require_context_dependency.rs (2), raw_optimization.rs (2). — One of this dimension's main actionable groups (29 warning-level).
Resolve the 3 Change coupling clique finding(s) in Change Coupling — start with context_module.rs, add.rs, IgnorePlugin.ts. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with binding.d.ts, esm_export_imported_specifier_dependency.rs, wasm_plugin.rs. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 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.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives5.5 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. — crates/rspack_plugin_runtime/src/runtime_module/runtime/auto_public_path.ejs:10
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it. (×4) — packages/create-rspack/template-react-js/index.html:2, packages/create-rspack/template-react-ts/index.html:2, packages/create-rspack/template-vanilla-js/index.html:2, …
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="app">, so there is no content here to wrap — render the <main> from the component mounted into it. (×2) — packages/create-rspack/template-vue-js/index.html:2, packages/create-rspack/template-vue-ts/index.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
`rspack_core` is a Domain project but references `rspack_napi`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the 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.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability6.8 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 43/46 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/rspack_allocative_driver`, `packages/create-rspack`, `xtask`.
`packages/rspack/src/NativeWatchFileSystem.ts` reports through `console.*` at line 325 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/NativeWatchFileSystem.ts:325
`packages/rspack/src/checkNodeVersion.ts` reports through `console.*` at line 15 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/checkNodeVersion.ts:15
`packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 66 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/util/asyncLib.ts:66
`packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 67 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/util/asyncLib.ts:67
`packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 82 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/util/asyncLib.ts:82
`packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/util/asyncLib.ts:83
`packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 73 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/sharing/IndependentSharedPlugin.ts:73
`packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 106 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/sharing/IndependentSharedPlugin.ts:106
`packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 322 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/sharing/IndependentSharedPlugin.ts:322
`packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 349 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/sharing/IndependentSharedPlugin.ts:349
`packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 478 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/sharing/IndependentSharedPlugin.ts:478
`packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 490 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/sharing/IndependentSharedPlugin.ts:490
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 101 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:101
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:103
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 109 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:109
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:113
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:117
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 121 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:121
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 133 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:133
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 144 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:144
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 161 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:161
`packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 192 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/logging/createConsoleLogger.ts:192
`packages/rspack/src/loader-runner/utils.ts` reports through `console.*` at line 116 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/loader-runner/utils.ts:116
`packages/rspack/src/loader-runner/utils.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/src/loader-runner/utils.ts:117
`packages/rspack/hot/lazy-compilation-node.js` reports through `console.*` at line 99 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/hot/lazy-compilation-node.js:99
`packages/rspack/hot/lazy-compilation-web.js` reports through `console.*` at line 87 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack/hot/lazy-compilation-web.js:87
`packages/rspack-test-tools/src/helper/util/checkSourceMap.js` reports through `console.*` at line 16 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack-test-tools/src/helper/util/checkSourceMap.js:16
`packages/rspack-test-tools/src/case/example.ts` reports through `console.*` at line 46 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/rspack-test-tools/src/case/example.ts:46
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
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.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.existsSync` in `loadExtendedConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/rspack-cli/src/utils/loadConfig.ts:216
`fs.existsSync` in `loadRspackConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/rspack-cli/src/utils/loadConfig.ts:261
`fs.existsSync` in `templateFn` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/rspack/src/builtin-plugin/html-plugin/plugin.ts:134
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
5 duplicated blocks under packages/rspack/src/ have copies in at least two of the sibling directories browser, builtin-plugin, config, loader-runner, logging, stats (+3 more sibling(s) not listed) — 3 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/rspack/src/browser/service.ts:1
packages/rspack/src/stats/StatsFactory.ts:209 · packages/rspack/src/stats/StatsPrinter.ts:152 — the two spans are one implementation copied and then locally edited — 361 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/rspack/src/stats/StatsFactory.ts:209
packages/rspack/src/Compilation.ts:947 · packages/rspack/src/Compiler.ts:476 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/Compilation.ts:947
packages/rspack/src/loader-runner/index.ts:458 · packages/rspack/src/loader-runner/worker.ts:400 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/loader-runner/index.ts:458
packages/rspack/src/util/fs.ts:383 · packages/rspack/src/util/fs.ts:424 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/rspack/src/util/fs.ts:383
packages/rspack/hot/lazy-compilation-node.js:35 · packages/rspack/hot/lazy-compilation-web.js:32 — the two spans are one implementation copied and then locally edited — 166 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/rspack/hot/lazy-compilation-node.js:35
packages/rspack/src/Module.ts:51 · packages/rspack/src/Module.ts:120 — 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/rspack/src/Module.ts:51
packages/rspack/src/Compiler.ts:1115 · packages/rspack/src/Compiler.ts:1154 — 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/rspack/src/Compiler.ts:1115
packages/rspack/src/FileSystemDependencies.ts:126 · packages/rspack/src/Modules.ts:45 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/FileSystemDependencies.ts:126
packages/rspack-cli/src/commands/preview.ts:47 · packages/rspack-cli/src/commands/serve.ts:61 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/rspack-cli/src/commands/preview.ts:47
packages/rspack/src/Stats.ts:87 · packages/rspack/src/Stats.ts:134 — 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/rspack/src/Stats.ts:87
packages/rspack/src/FileSystem.ts:75 · packages/rspack/src/FileSystem.ts:176 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/rspack/src/FileSystem.ts:75
packages/rspack/src/browser/service.ts:1 · packages/rspack/src/loader-runner/service.ts:125 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/rspack/src/browser/service.ts:1
packages/create-rspack/template-react-js/src/App.jsx:5 · packages/create-rspack/template-react-ts/src/App.tsx:5 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/create-rspack/template-react-js/src/App.jsx:5
packages/rspack/src/config/defaults.ts:948 · packages/rspack/src/config/defaults.ts:975 — 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/rspack/src/config/defaults.ts:948
packages/rspack/src/rspackOptionsApply.ts:360 · packages/rspack/src/rspackOptionsApply.ts:388 — 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/rspack/src/rspackOptionsApply.ts:360
packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:240 · packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:264 — 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/rspack/src/stats/DefaultStatsPrinterPlugin.ts:240
packages/rspack/src/taps/compilation.ts:459 · packages/rspack/src/taps/javascriptModules.ts:16 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/taps/compilation.ts:459
packages/rspack/src/loader-runner/index.ts:695 · packages/rspack/src/loader-runner/worker.ts:452 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/rspack/src/loader-runner/index.ts:695
packages/rspack/src/util/fs.ts:287 · packages/rspack/src/util/fs.ts:465 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/rspack/src/util/fs.ts:287
packages/rspack/src/logging/createConsoleLogger.ts:41 · packages/rspack/src/stats/DefaultStatsPresetPlugin.ts:260 — the two spans are one implementation copied and then locally edited — 95 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/rspack/src/logging/createConsoleLogger.ts:41
packages/rspack/src/Compiler.ts:586 · packages/rspack/src/Watching.ts:341 — the two spans are one implementation copied and then locally edited — 117 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/rspack/src/Compiler.ts:586
packages/rspack/src/taps/normalModuleFactory.ts:13 · packages/rspack/src/taps/normalModuleFactory.ts: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. — packages/rspack/src/taps/normalModuleFactory.ts:13
packages/create-rspack/template-vue-js/rspack.config.js:35 · packages/create-rspack/template-vue-ts/rspack.config.ts:37 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/create-rspack/template-vue-js/rspack.config.js:35
packages/rspack/src/Compilation.ts:495 · packages/rspack/src/Compiler.ts:272 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/Compilation.ts:495
packages/rspack/src/NativeWatchFileSystem.ts:440 · packages/rspack/src/NativeWatchFileSystem.ts:460 · packages/rspack/src/node/NodeWatchFileSystem.ts:269 · packages/rspack/src/node/NodeWatchFileSystem.ts:289 — the 4 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/NativeWatchFileSystem.ts:440
packages/rspack/src/builtin-plugin/html-plugin/taps.ts:23 · packages/rspack/src/builtin-plugin/html-plugin/taps.ts:45 · packages/rspack/src/builtin-plugin/html-plugin/taps.ts:67 · packages/rspack/src/builtin-plugin/html-plugin/taps.ts:110 — 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/rspack/src/builtin-plugin/html-plugin/taps.ts:23
packages/rspack/src/stats/StatsFactory.ts:113 · packages/rspack/src/stats/StatsFactory.ts:134 — 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/rspack/src/stats/StatsFactory.ts:113
packages/rspack/src/loader-runner/index.ts:992 · packages/rspack/src/loader-runner/index.ts:1011 — 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/rspack/src/loader-runner/index.ts:992
packages/rspack/src/config/target.ts:260 · packages/rspack/src/config/target.ts:337 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/rspack/src/config/target.ts:260
packages/rspack/src/sharing/IndependentSharedPlugin.ts:170 · packages/rspack/src/sharing/SharePlugin.ts:73 — the two spans are one implementation copied and then locally edited — 66 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/rspack/src/sharing/IndependentSharedPlugin.ts:170
packages/rspack/src/NativeWatchFileSystem.ts:479 · packages/rspack/src/node/NodeWatchFileSystem.ts:308 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/NativeWatchFileSystem.ts:479
packages/rspack/src/container/ModuleFederationPlugin.ts:101 · packages/rspack/src/container/ModuleFederationPlugin.ts:118 — 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/rspack/src/container/ModuleFederationPlugin.ts:101
packages/rspack/src/loader-runner/index.ts:670 · packages/rspack/src/loader-runner/worker.ts:264 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/rspack/src/loader-runner/index.ts:670
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:173 · packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:173
packages/rspack/src/ChunkGraph.ts:7 · packages/rspack/src/ChunkGraph.ts:27 — 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/rspack/src/ChunkGraph.ts:7
packages/rspack/src/loader-runner/index.ts:545 · packages/rspack/src/loader-runner/worker.ts:131 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/rspack/src/loader-runner/index.ts:545
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:118 · packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:287 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:118
packages/rspack/src/taps/compilation.ts:370 · packages/rspack/src/taps/compilation.ts: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. — packages/rspack/src/taps/compilation.ts:370
packages/rspack/src/trace/traceHookPlugin.ts:49 · packages/rspack/src/trace/traceHookPlugin.ts:82 — 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/rspack/src/trace/traceHookPlugin.ts:49
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
crates/node_binding/scripts/build.mjs:5 reaches into another package with a relative path (../../../scripts/allocative-driver.mjs) — import the package by name instead. — crates/node_binding/scripts/build.mjs:5
packages/rspack/src/node/NodeEnvironmentPlugin.ts:12 imports enhanced-resolve/lib/CachedInputFileSystem, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/rspack/src/node/NodeEnvironmentPlugin.ts:12
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.
getGraphemeBreakProperty has cyclomatic complexity 2120 and cognitive complexity 1507; 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. — tests/rspack-test/normalCases/parsing/evaluate-binary/deep.js:267
process has cyclomatic complexity 90 and cognitive complexity 101; 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/rspack/src/rspackOptionsApply.ts:88
_createToolbarTable has cyclomatic complexity 82 and cognitive complexity 142; 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. — tests/rspack-test/configCases/inner-graph/issue-11678/module.js:436
resolveToUnqualified has cyclomatic complexity 54 and cognitive complexity 161; 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. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:10134, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:10134
(anonymous) has cyclomatic complexity 51 and cognitive complexity 69; 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/rspack/src/logging/createConsoleLogger.ts:85
_ has cyclomatic complexity 45 and cognitive complexity 104; 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/rspack/src/stats/DefaultStatsFactoryPlugin.ts:673
build has cyclomatic complexity 43 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/rspack-test/compilerCases/hmr-in-flight-chunks/test.config.mjs:93
shouldBreak has cyclomatic complexity 43 and cognitive complexity 42; 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. — tests/rspack-test/normalCases/parsing/evaluate-binary/deep.js:80
arg has cyclomatic complexity 40 and cognitive complexity 81; 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. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:9545, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:9545
runLoaders has cyclomatic complexity 39 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack/src/loader-runner/index.ts:248
(anonymous) has cyclomatic complexity 39 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/node_binding/scripts/build.mjs:39
_showFormButtons has cyclomatic complexity 39 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/rspack-test/configCases/inner-graph/issue-11678/module.js:2703
build has cyclomatic complexity 37 and cognitive complexity 98; 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. — tests/rspack-test/compilerCases/hmr-removed-runtime-cache/test.config.mjs:45
(anonymous) has cyclomatic complexity 37 and cognitive complexity 42; 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/rspack-cli/src/commands/serve.ts:58
(anonymous) has cyclomatic complexity 36 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/rspack-test/configCases/chunks/available-modules/rspack.config.ts:25
(anonymous) has cyclomatic complexity 34 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack/src/util/smartGrouping.ts:73
compilation.summary! has cyclomatic complexity 34 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:80
_resolveFilename has cyclomatic complexity 30 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:8772, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:8772
(anonymous) has cyclomatic complexity 30 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack/src/config/adapter.ts:357
checkSourceMap has cyclomatic complexity 28 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack-test-tools/src/helper/util/checkSourceMap.js:6
toMatchFileSnapshotSync has cyclomatic complexity 28 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack-test-tools/src/helper/expect/to-match-file-snapshot.ts:80
open has cyclomatic complexity 26 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:6865, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:6865
areStatsEqual has cyclomatic complexity 26 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 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. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:233, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:233
build has cyclomatic complexity 25 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — tests/rspack-test/compilerCases/hmr-stale-module-cache/test.config.mjs:47
(anonymous) has cyclomatic complexity 24 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack/src/config/target.ts:515
checkArrayExpectation has cyclomatic complexity 23 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack-test-tools/src/helper/legacy/checkArrayExpectation.js:78
(anonymous) has cyclomatic complexity 23 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — tests/rspack-test/configCases/hooks/original-source/rspack.config.ts:46
(anonymous) has cyclomatic complexity 23 and cognitive complexity 38; 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/rspack/src/builtin-plugin/html-plugin/plugin.ts:37
internalBuildConfig has cyclomatic complexity 23 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack-cli/src/cli.ts:212
(anonymous) has cyclomatic complexity 23 and cognitive complexity 26; 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. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:4317, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:4317
___sys_ioctl has cyclomatic complexity 23 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 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. (×2) — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:7934, tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:7934
(anonymous) has cyclomatic complexity 22 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/rspack/src/stats/statsFactoryUtils.ts:470
rename has cyclomatic complexity 22 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:6590
Do you agree with this assessment?
R3 · Large Files6.9 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
packages/rspack/src/config/types.ts has 3093 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/rspack/src/config/types.ts:1
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts has 1539 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/rspack/src/stats/DefaultStatsFactoryPlugin.ts:1
crates/node_binding/rspack.wasi-browser.js has 1494 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/node_binding/rspack.wasi-browser.js:1
packages/rspack/src/config/defaults.ts has 1346 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/rspack/src/config/defaults.ts:1
packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts has 1319 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/rspack/src/stats/DefaultStatsPrinterPlugin.ts:1
packages/rspack/src/Compilation.ts has 1267 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/rspack/src/Compilation.ts:1
packages/rspack/src/loader-runner/index.ts has 1180 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/rspack/src/loader-runner/index.ts:1
packages/rspack/src/Compiler.ts has 1114 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/rspack/src/Compiler.ts:1
packages/rspack/src/config/adapter.ts has 922 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/rspack/src/config/adapter.ts:1
packages/rspack/src/util/fs.ts has 721 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/rspack/src/util/fs.ts:1
packages/rspack/src/loader-runner/worker.ts has 711 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/rspack/src/loader-runner/worker.ts:1
packages/rspack/src/config/normalization.ts has 700 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/rspack/src/config/normalization.ts:1
packages/rspack/src/stats/statsFactoryUtils.ts has 675 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/rspack/src/stats/statsFactoryUtils.ts:1
packages/rspack/src/RuntimeGlobals.ts has 649 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/rspack/src/RuntimeGlobals.ts:1
packages/rspack/src/config/adapterRuleUse.ts has 622 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/rspack/src/config/adapterRuleUse.ts:1
packages/rspack-test-tools/src/runner/node/index.ts has 570 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/rspack-test-tools/src/runner/node/index.ts:1
packages/rspack/src/MultiCompiler.ts has 569 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/rspack/src/MultiCompiler.ts:1
packages/rspack/src/config/target.ts has 547 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/rspack/src/config/target.ts:1
packages/rspack/src/taps/compilation.ts has 499 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/rspack/src/taps/compilation.ts:1
packages/rspack/src/NativeWatchFileSystem.ts has 498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/rspack/src/NativeWatchFileSystem.ts:1
packages/rspack/src/Watching.ts has 495 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/rspack/src/Watching.ts:1
packages/rspack-test-tools/src/case/watch.ts has 485 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/rspack-test-tools/src/case/watch.ts:1
packages/rspack/src/util/cleverMerge.ts has 480 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/rspack/src/util/cleverMerge.ts:1
packages/rspack-test-tools/src/case/cache.ts has 472 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/rspack-test-tools/src/case/cache.ts:1
packages/rspack/src/exports.ts has 453 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/rspack/src/exports.ts:1
packages/rspack/src/sharing/IndependentSharedPlugin.ts has 452 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/rspack/src/sharing/IndependentSharedPlugin.ts:1
packages/rspack/src/rspackOptionsApply.ts has 450 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/rspack/src/rspackOptionsApply.ts:1
packages/rspack-test-tools/src/runner/web/index.ts has 436 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/rspack-test-tools/src/runner/web/index.ts:1
packages/rspack/src/loader-runner/service.ts has 420 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/rspack/src/loader-runner/service.ts:1
packages/rspack-test-tools/src/case/hot-step.ts has 418 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/rspack-test-tools/src/case/hot-step.ts:1
packages/rspack/src/container/ModuleFederationPlugin.ts has 417 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/rspack/src/container/ModuleFederationPlugin.ts:1
packages/rspack/src/stats/StatsFactory.ts has 401 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/rspack/src/stats/StatsFactory.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.2 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×26) — packages/rspack/src/config/types.ts:1, crates/node_binding/rspack.wasi-browser.js:1, packages/rspack/src/loader-runner/worker.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.0 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
304 file(s) (~5936 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: tests/e2e/cases/file/missing-files/src/index.js imports './missing-file-1.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — tests/e2e
15452 file(s) (~258301 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: tests/rspack-test/configCases/asset-modules/file-url/index.js imports './temp/index.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — tests/rspack-test
1 file(s) (~6 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. (×2) — tests/rspack-test/configCases/module/node-globals/cjs, tests/rspack-test/configCases/output-module/node-globals/cjs
1 file(s) (~3 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. — tests/rspack-test/configCases/optimization/minimizer-esm-asset/pkg
1 file(s) (~1 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. — tests/rspack-test/configCases/resolve/rspack-issue-4432/package
59 file(s) (~809 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: tests/rspack-test/configCases/rstest/mock/mainFilesManualMock.js imports './src/main-file', 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. — tests/rspack-test/configCases/rstest/mock
1 file(s) (~16 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. — tests/rspack-test/configCases/sharing/share-plugin-dual-mode
1 file(s) (~18 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. — tests/rspack-test/configCases/sharing/share-plugin-monorepo
3 file(s) (~3 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. (×2) — tests/rspack-test/esmOutputCases/namespace/side-effect-free-modules-default-property/foo, tests/rspack-test/esmOutputCases/namespace/side-effect-free-modules-missing-property/foo
2 file(s) (~2 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. (×3) — tests/rspack-test/normalCases/inner-graph/static-of-class/other, tests/rspack-test/normalCases/parsing/esm-export-import-specifier/side-effect-free, tests/rspack-test/normalCases/parsing/harmony-export-import-specifier/side-effect-free
1 file(s) (~1 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. — tests/rspack-test/watchCases/side-effects/metadata-rebuild/0/pkg
This script imports the product ('../../../i18n'), so it is an authored benchmark, not measurement input — but nothing invokes it: no package.json script, no CI workflow or build recipe, no REDACTED, no other file under website/theme/components/Landingpage/Benchmark/, and no in-repo reference to its name at all. It runs only if someone remembers to type `node website/theme/components/Landingpage/Benchmark/index.tsx`, and it silently rots against the API it measures. Wire it into a script or workflow the way its wired siblings are, or delete it. — website/theme/components/Landingpage/Benchmark/index.tsx
Nothing ultimately consumes this binding: its only referrer is the re-export in packages/rspack/src/browser/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/rspack/src/browser/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:45, packages/rspack/src/browser/BrowserRequirePlugin.ts:42
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. (×22) — tests/rspack-test/builtinCases/samples/concatenate-modules/index.js:8, tests/rspack-test/configCases/builtin-swc-loader/preact-refresh/index.jsx:1, tests/rspack-test/configCases/builtin-swc-loader/react-compiler-panic-threshold/index.jsx:3, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×16) — packages/rspack/src/container/ModuleFederationPlugin.ts:311, packages/rspack/src/container/ModuleFederationPlugin.ts:307, tests/rspack-test/serialCases/container-1-5/0-container-full/App.js:1, …
Declared in tests/rspack-test/configCases/css/css-order-concatenate-modules/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 tests/rspack-test/configCases/css/css-order-reexport/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 tests/rspack-test/configCases/css/css-order2/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 tests/rspack-test/configCases/css/css-order3/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.
Do you agree with this assessment?
R9 · Circular Imports4.4 / 10Weak✓ 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.
packages/rspack/src/builtin-plugin/index.ts → packages/rspack/src/builtin-plugin/DynamicEntryPlugin.ts → packages/rspack/src/lib/EntryOptionPlugin.ts → packages/rspack/src/builtin-plugin/index.ts (one verified cycle inside a mutually-dependent group of 21 files) — packages/rspack/src/builtin-plugin/index.ts:28
packages/rspack/src/container/ModuleFederationManifestPlugin.ts → packages/rspack/src/container/ModuleFederationPlugin.ts → packages/rspack/src/container/ModuleFederationManifestPlugin.ts (one verified cycle inside a mutually-dependent group of 5 files) — packages/rspack/src/container/ModuleFederationManifestPlugin.ts:18
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
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 commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are read from a Rust server this repository starts itself, and its production Rust starts none. What serves its HTTP is outside the Rust source, and only what this card names about it was assessed.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
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. — crates/rspack_hash/src/lib.rs:215
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `_headers` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — website/docs/public/_headers:1
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.
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`defaultHttpClientForBrowser` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/rspack/src/builtin-plugin/HttpUriPlugin.ts:142
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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.
`error!` at line 40 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: `error!(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/rspack_watcher/src/disk_watcher.rs:40
`warn!` at line 83 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: `warn!(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/rspack_watcher/src/disk_watcher.rs:83
`error!` at line 181 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: `error!(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/rspack_watcher/src/ignored.rs:181
`debug!` at line 1087 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/rspack_resolver/src/lib.rs:1087
`debug!` at line 1122 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/rspack_resolver/src/lib.rs:1122
`trace!` at line 294 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:294
`trace!` at line 523 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:523
`debug!` at line 535 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:535
`debug!` at line 561 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:561
`warn!` at line 573 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: `warn!(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/rspack_plugin_split_chunks/src/plugin/max_size.rs:573
`debug!` at line 631 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:631
`trace!` at line 74 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/rspack_plugin_split_chunks/src/plugin/min_size.rs:74
`debug!` at line 247 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/rspack_plugin_split_chunks/src/plugin/min_size.rs:247
`debug!` at line 289 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/rspack_plugin_split_chunks/src/plugin/min_size.rs:289
`debug!` at line 59 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/rspack_plugin_split_chunks/src/plugin/mod.rs:59
`debug!` at line 83 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/rspack_plugin_split_chunks/src/plugin/mod.rs:83
`trace!` at line 304 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/rspack_plugin_split_chunks/src/plugin/mod.rs:304
`trace!` at line 314 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/rspack_plugin_split_chunks/src/plugin/mod.rs:314
`trace!` at line 330 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/rspack_plugin_split_chunks/src/plugin/mod.rs:330
`trace!` at line 450 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/rspack_plugin_split_chunks/src/plugin/mod.rs:450
`trace!` at line 494 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/rspack_plugin_split_chunks/src/plugin/mod.rs:494
`trace!` at line 518 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/rspack_plugin_split_chunks/src/plugin/mod.rs:518
`trace!` at line 1456 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1456
`trace!` at line 1462 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1462
`trace!` at line 1463 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1463
`trace!` at line 1470 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1470
`trace!` at line 1481 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1481
`trace!` at line 1503 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1503
`error!` at line 30 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: `error!(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/rspack_plugin_schemes/src/file_uri.rs:30
`error!` at line 64 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: `error!(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/rspack_plugin_schemes/src/file_uri.rs:64
`error!` at line 74 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: `error!(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/rspack_plugin_schemes/src/file_uri.rs:74
`error!` at line 117 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:117
`error!` at line 131 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:131
`error!` at line 147 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:147
`error!` at line 185 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:185
`error!` at line 190 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:190
`error!` at line 196 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:196
`error!` at line 206 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:206
`error!` at line 211 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:211
`error!` at line 317 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: `error!(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/rspack_plugin_schemes/src/http_uri/http_cache.rs:317
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.
3/77 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~6.7 `!` null assertions per 1k TypeScript source lines — 326 assertion(s) across the 48644 source line(s) of the 319 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/rspack/src/FileSystem.ts (38), packages/rspack/src/loader-runner/index.ts (37), packages/rspack/src/taps/compilation.ts (32). 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 `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 11 of 55 WCAG 2.2 Level A/AA success criteria (20%; ≈22% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 44 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
SC1 Supply-chain hygiene — 40 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 — 3 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 — 55 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.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — 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. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — AX6 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> monorepo@2.3.2 dev / > pnpm --filter @rspack/cli run dev / sh: 1: pnpm: not found" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — 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.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
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.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, TypeScript surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ 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 — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 26 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.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Rust suite
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 211 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — 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, 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 not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R5 Dependency Freshness — uses a yarn lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
X12 Unreachable branch — X12 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — X13 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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
X16 Unfloored truncation loop — X16 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — X17 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 — X19 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 — X24 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — X25 reached only 13% of this repository's production lines — rust (279,813 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. Rust's compiler refuses the unsynchronised version: a collection shared between a callback's thread and the waiting body must be `Sync`, which a `Vec`, `VecDeque` or `HashMap` is only behind a `Mutex`/`RwLock`, so the race this check looks for cannot be written in safe Rust. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X3 Exception handling — X3 reached only 13% of this repository's production lines — rust (279,813 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.
X9 Subsumed condition operand — 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.
AC1 · Text alternatives· <img> without a text alternative · ×1
<img> without a text alternative crates/rspack_plugin_runtime/src/runtime_module/runtime/auto_public_path.ejs:10— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
Dependency-rule violation: rspack_core (Domain) → rspack_napi (Web) — `rspack_core` is a Domain project but references `rspack_napi`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.
Unlisted import '@module-federation/runtime' packages/rspack/src/container/ModuleFederationPlugin.ts:311— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@module-federation/webpack-bundler-runtime' packages/rspack/src/container/ModuleFederationPlugin.ts:307— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@rspack/mocked-react' tests/rspack-test/serialCases/container-1-5/0-container-full/App.js:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@rstest/core' tests/rspack-test/configCases/rstest/mock-dynamic-import-external/src/fixture.js:9— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'common' tests/rspack-test/hotCases/sharing/share-plugin/module.js:5— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'd' tests/rspack-test/configCases/split-chunks-common/rspack-issue-4376/index.js:8— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'dep' tests/rspack-test/configCases/concatenate-modules/side-effects/index.js:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'lib3' tests/rspack-test/configCases/builtin-swc-loader/swc-loader-incompatible-wasm-plugin/src/index.jsx:4— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'm' tests/rspack-test/normalCases/optimize/side-effects-reexport-start-unknown/index.js:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'my-module' tests/rspack-test/normalCases/parsing/local-modules/index.js:12— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'my-module3' tests/rspack-test/normalCases/parsing/local-modules/index.js:44— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'my-module4' tests/rspack-test/normalCases/parsing/local-modules/index.js:45— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'package' tests/rspack-test/configCases/asset-modules/unsafe-cache-13827/index.js:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'react-router-dom' tests/rspack-test/configCases/tree-shaking/export-star-of-external-module/lib.js:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'shared' tests/rspack-test/configCases/container-1-5/async-startup-static-import/index.js:2— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'vue' tests/rspack-test/configCases/library/modern-module-dynamic-import-runtime/main.js:11— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
TodoComment packages/rspack-test-tools/src/test/creator.ts:123— // TODO: more flexible filter — 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/rspack-test-tools/src/case/config.ts:93— // TODO: modify runner module scope based on stats here — 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/rspack-test-tools/src/case/esm-output.ts:32— // TODO: modify runner module scope based on stats here — 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/rspack-test-tools/src/case/serial.ts:12— // TODO: modify runner module scope based on stats here — 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/rspack-test-tools/src/case/diagnostic.ts:50— // TODO: change to stats.errorStack — 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/rspack-test-tools/src/case/diagnostic.ts:51— // TODO: add `errorStack: false` — 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/rspack-test-tools/src/case/hot-step.ts:111— // TODO: find a better way — 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/rspack-test-tools/src/case/watch.ts:306— // TODO: This is a workaround, we can remove it when notify support windows better. — 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/rspack/src/FileSystem.ts:102— // TODO: is `memoizeFn` necessary? — 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/rspack/src/NormalModuleFactory.ts:16— // TODO(v3): Remove resolveData.fileDependencies, resolveData.contextDependencies, — 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/rspack/src/NormalModuleFactory.ts:29— // TODO: second param resolveData — 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/rspack/src/Stats.ts:105— // TODO: Find a better way to handle accessing stats from stale compilations — 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/rspack/src/Stats.ts:152— // TODO: Find a better way to handle accessing stats from stale compilations — 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/rspack/src/Watching.ts:188— // TODO: compilation parameter support — 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/rspack/src/rspackOptionsApply.ts:354— // TODO: inconsistent: the plugin need to be placed after SplitChunksPlugin — 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/rspack/src/loader-runner/index.ts:563— // TODO: (type) our native resolver return value is "string | false" but webpack type is "string" — 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/rspack_util/src/swc/runtime.rs:91— // 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/rspack_tools/src/compare/mod.rs:204— // TODO compare snapshot — 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/rspack_tools/src/compare/snapshot.rs:20— // TODO check SnapshotScope::Context && SnapshotScope::Missing — 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/rspack_resolver/src/lib.rs:697— // TODO: Only package.json is supported, so warn about having other values — 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/rspack_resolver/src/lib.rs:2034— // TODO: fill in test case for this case — 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/rspack_resolver/src/lib.rs:2132— // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. — 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/rspack_resolver/src/lib.rs:2179— // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. — 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/rspack_resolver/src/tests/exports_field.rs:356— // TODO: The error is PackagePathNotExported in enhanced-resolve — 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.
MethodTooLong: ConcatenatedModule.code_generation crates/rspack_core/src/concatenated_module.rs:887— MethodTooLong — code_generation runs 570 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 470 over it, 5.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModuleConcatenationPlugin.optimize_chunk_modules_impl crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1048— MethodTooLong — optimize_chunk_modules_impl runs 515 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 415 over it, 5.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BuiltinPlugin.append_to crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:309— MethodTooLong — append_to runs 514 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 414 over it, 5.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EsmLibraryPlugin.link_imports_and_exports crates/rspack_plugin_esm_library/src/link.rs:2111— MethodTooLong — link_imports_and_exports runs 502 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 402 over it, 5.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EsmLibraryPlugin.render_chunk crates/rspack_plugin_esm_library/src/render.rs:131— MethodTooLong — render_chunk runs 445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 345 over it, 4.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SplitChunksPlugin.inner_impl crates/rspack_plugin_split_chunks/src/plugin/mod.rs:93— MethodTooLong — inner_impl runs 399 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 299 over it, 3.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OutputOptionsBuilder.build crates/rspack/src/builder/mod.rs:2698— MethodTooLong — build runs 395 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 295 over it, 3.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NormalModuleFactory.resolve_normal_module crates/rspack_core/src/normal_module_factory.rs:649— MethodTooLong — resolve_normal_module runs 388 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 288 over it, 3.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ServerActions.visit_mut_module_items crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1294— MethodTooLong — visit_mut_module_items runs 354 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 254 over it, 3.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExternalModule.get_source crates/rspack_core/src/external_module.rs:716— MethodTooLong — get_source runs 340 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 240 over it, 3.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Stats.get_module crates/rspack_core/src/stats/mod.rs:1158— MethodTooLong — get_module runs 329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CompilerOptionsBuilder.build crates/rspack/src/builder/mod.rs:936— MethodTooLong — build runs 308 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 208 over it, 3.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EsmLibraryPlugin.link crates/rspack_plugin_esm_library/src/link.rs:514— MethodTooLong — link runs 296 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SplitChunksPlugin.prepare_module_group_map crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:1034— MethodTooLong — prepare_module_group_map runs 293 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 193 over it, 2.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecuteTask.main_run crates/rspack_core/src/compilation/build_module_graph/module_executor/execute.rs:185— MethodTooLong — main_run runs 268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CodeSplitter.make_chunk_group crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1919— MethodTooLong — make_chunk_group runs 264 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LexDependencies.lex_streaming_inner crates/css-module-lexer/src/dependencies.rs:1576— MethodTooLong — lex_streaming_inner runs 261 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ESMExportImportedSpecifierDependency.add_export_fragments crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:545— MethodTooLong — add_export_fragments runs 260 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RspackOptionsApply.process packages/rspack/src/rspackOptionsApply.ts:88— MethodTooLong — process runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ConcatenatedModule.get_final_binding crates/rspack_core/src/concatenated_module.rs:2499— MethodTooLong — get_final_binding runs 242 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ImportParserPlugin.import_call crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:506— MethodTooLong — import_call runs 239 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EsmLibraryPlugin.link_entry_module_exports crates/rspack_plugin_esm_library/src/link.rs:1789— MethodTooLong — link_entry_module_exports runs 232 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EsmLibraryPlugin.deconflict_symbols crates/rspack_plugin_esm_library/src/link.rs:1005— MethodTooLong — deconflict_symbols runs 219 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 119 over it, 2.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AssetParserAndGenerator.generate crates/rspack_plugin_asset/src/lib.rs:527— MethodTooLong — generate runs 213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ChunkManifest.new crates/rspack_plugin_sri/src/manifest.rs:169— MethodTooLong — new runs 205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: src/dependencies.rs crates/css-module-lexer/src/dependencies.rs— FileTooLong — 3351 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 72% of them inside a single declaration: LexDependencies (3 blocks, 1439-4712). The bar is 500 significant lines; this is 2851 over it, 6.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: builder/mod.rs crates/rspack/src/builder/mod.rs— FileTooLong — 2316 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1816 over it, 4.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: build_chunk_graph/code_splitter.rs crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs— FileTooLong — 2195 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: CodeSplitter (2 blocks, 377-2936). The bar is 500 significant lines; this is 1695 over it, 4.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/link.rs crates/rspack_plugin_esm_library/src/link.rs— FileTooLong — 2179 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: EsmLibraryPlugin (78-3154). The bar is 500 significant lines; this is 1679 over it, 4.36× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: parser_plugin/common_js_imports_parse_plugin.rs crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs— FileTooLong — 2151 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 1651 over it, 4.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/concatenated_module.rs crates/rspack_core/src/concatenated_module.rs— FileTooLong — 2075 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: ConcatenatedModule (7 blocks, 509-2811). The bar is 500 significant lines; this is 1575 over it, 4.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: rsc_transforms/server_actions.rs crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs— FileTooLong — 1654 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: ServerActions (3 blocks, 147-1962). The bar is 500 significant lines; this is 1154 over it, 3.31× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: parser/walk.rs crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs— FileTooLong — 1628 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: JavascriptParser (37-2383). The bar is 500 significant lines; this is 1128 over it, 3.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: plugin/module_concatenation_plugin.rs crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs— FileTooLong — 1595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1095 over it, 3.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: plugins/interceptor.rs crates/rspack_binding_api/src/plugins/interceptor.rs— FileTooLong — 1591 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1091 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs crates/rspack_resolver/src/lib.rs— FileTooLong — 1457 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: ResolverGeneric (5 blocks, 135-2403). The bar is 500 significant lines; this is 957 over it, 2.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/runtime_template.rs crates/rspack_core/src/runtime_template.rs— FileTooLong — 1407 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 907 over it, 2.81× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: esm/esm_export_imported_specifier_dependency.rs crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs— FileTooLong — 1404 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 86% of them inside a single declaration: ESMExportImportedSpecifierDependency (6 blocks, 52-1694). The bar is 500 significant lines; this is 904 over it, 2.81× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: stats/mod.rs crates/rspack_core/src/stats/mod.rs— FileTooLong — 1399 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: Stats (4 blocks, 125-1779). The bar is 500 significant lines; this is 899 over it, 2.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: parser/mod.rs crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs— FileTooLong — 1356 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: JavascriptParser (3 blocks, 472-1914). The bar is 500 significant lines; this is 856 over it, 2.71× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/context_module.rs crates/rspack_core/src/context_module.rs— FileTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 793 over it, 2.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: options/module.rs crates/rspack_core/src/options/module.rs— FileTooLong — 1260 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 760 over it, 2.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: compilation/mod.rs crates/rspack_core/src/compilation/mod.rs— FileTooLong — 1180 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: Compilation (2 blocks, 213-1355). The bar is 500 significant lines; this is 680 over it, 2.36× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: plugin/mod.rs crates/rspack_plugin_javascript/src/plugin/mod.rs— FileTooLong — 1162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 662 over it, 2.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: plugin/module_group.rs crates/rspack_plugin_split_chunks/src/plugin/module_group.rs— FileTooLong — 1132 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 632 over it, 2.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: parser_plugin/side_effects_parser_plugin.rs crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs— FileTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 577 over it, 2.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/external_module.rs crates/rspack_core/src/external_module.rs— FileTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: ExternalModule (5 blocks, 537-1438). The bar is 500 significant lines; this is 572 over it, 2.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/parser_plugin.rs crates/rspack_plugin_rstest/src/parser_plugin.rs— FileTooLong — 995 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: RstestParserPlugin (3 blocks, 144-1438). The bar is 500 significant lines; this is 495 over it, 1.99× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: parser_and_generator/generator.rs crates/rspack_plugin_css/src/parser_and_generator/generator.rs— FileTooLong — 967 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: CssModuleGenerator (3 blocks, 81-1145). The bar is 500 significant lines; this is 467 over it, 1.93× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/source_map_dev_tool_plugin.rs crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs— FileTooLong — 955 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: SourceMapDevToolPlugin (3 blocks, 298-1349). The bar is 500 significant lines; this is 455 over it, 1.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
Hotspot: packages/rspack/src/loader-runner/index.ts packages/rspack/src/loader-runner/index.ts:248— packages/rspack/src/loader-runner/index.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in index.runLoaders at line 248. 7 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/loader-runner/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/rspack/src/config/defaults.ts packages/rspack/src/config/defaults.ts:686— packages/rspack/src/config/defaults.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in defaults.applyOutputDefaults at line 686. 5 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/config/defaults.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/rspack_core/src/concatenated_module.rs crates/rspack_core/src/concatenated_module.rs:887— crates/rspack_core/src/concatenated_module.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in ConcatenatedModule::code_generation at line 887. 6 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_core/src/concatenated_module.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/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1048— crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in ModuleConcatenationPlugin::optimize_chunk_modules_impl at line 1048. 8 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.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/rspack_plugin_javascript/src/plugin/mod.rs crates/rspack_plugin_javascript/src/plugin/mod.rs:261— crates/rspack_plugin_javascript/src/plugin/mod.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in JsPlugin::render_webpack_bootstrap at line 261. 7 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/plugin/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/rspack_plugin_esm_library/src/link.rs crates/rspack_plugin_esm_library/src/link.rs:2111— crates/rspack_plugin_esm_library/src/link.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in EsmLibraryPlugin::link_imports_and_exports at line 2111. 3 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_esm_library/src/link.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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1796— crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in JavascriptParser::evaluating at line 1796. 7 of those changes were fix/bug commits, and the other 26 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/visitors/dependency/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.
Hotspot: crates/rspack_core/src/normal_module_factory.rs crates/rspack_core/src/normal_module_factory.rs:649— crates/rspack_core/src/normal_module_factory.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in NormalModuleFactory::resolve_normal_module at line 649. 6 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_core/src/normal_module_factory.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/rspack_plugin_hmr/src/lib.rs crates/rspack_plugin_hmr/src/lib.rs:238— crates/rspack_plugin_hmr/src/lib.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 113 in rspack_plugin_hmr::generate_hot_update at line 238. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_hmr/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/rspack_core/src/external_module.rs crates/rspack_core/src/external_module.rs:716— crates/rspack_core/src/external_module.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in ExternalModule::get_source at line 716. 5 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_core/src/external_module.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/rspack_plugin_javascript/src/plugin/runtime_context.rs crates/rspack_plugin_javascript/src/plugin/runtime_context.rs:138— crates/rspack_plugin_javascript/src/plugin/runtime_context.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in JsPlugin::render_rspack_bootstrap at line 138. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/plugin/runtime_context.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/rspack_plugin_esm_library/src/render.rs crates/rspack_plugin_esm_library/src/render.rs:131— crates/rspack_plugin_esm_library/src/render.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in EsmLibraryPlugin::render_chunk at line 131. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_esm_library/src/render.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/rspack/src/rspackOptionsApply.ts packages/rspack/src/rspackOptionsApply.ts:88— packages/rspack/src/rspackOptionsApply.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in RspackOptionsApply.process at line 88. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/rspackOptionsApply.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/css-module-lexer/src/dependencies.rs crates/css-module-lexer/src/dependencies.rs:1576— crates/css-module-lexer/src/dependencies.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in LexDependencies::lex_streaming_inner at line 1576. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/css-module-lexer/src/dependencies.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/rspack_sources/src/replace_source.rs crates/rspack_sources/src/replace_source.rs:607— crates/rspack_sources/src/replace_source.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in ReplaceSourceChunks::stream at line 607. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_sources/src/replace_source.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/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:506— crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in ImportParserPlugin::import_call at line 506. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.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/rspack_plugin_split_chunks/src/plugin/mod.rs crates/rspack_plugin_split_chunks/src/plugin/mod.rs:93— crates/rspack_plugin_split_chunks/src/plugin/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in SplitChunksPlugin::inner_impl at line 93. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_split_chunks/src/plugin/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/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:109— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in InnerGraphParserPlugin::infer_dependency_usage at line 109. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.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/rspack_plugin_split_chunks/src/plugin/module_group.rs crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:1034— crates/rspack_plugin_split_chunks/src/plugin/module_group.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in SplitChunksPlugin::prepare_module_group_map at line 1034. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_split_chunks/src/plugin/module_group.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/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1642— crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in JavascriptParser::walk_call_expression at line 1642. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/rspack/src/config/adapter.ts packages/rspack/src/config/adapter.ts:352— packages/rspack/src/config/adapter.ts changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in adapter.getRawModuleRule at line 352. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/config/adapter.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/rspack_plugin_mf/src/manifest/mod.rs crates/rspack_plugin_mf/src/manifest/mod.rs:164— crates/rspack_plugin_mf/src/manifest/mod.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in rspack_plugin_mf::manifest::process_assets at line 164. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_mf/src/manifest/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: packages/rspack/src/loader-runner/worker.ts packages/rspack/src/loader-runner/worker.ts:70— packages/rspack/src/loader-runner/worker.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in worker.loaderImpl at line 70. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/loader-runner/worker.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/rspack/src/builder/mod.rs crates/rspack/src/builder/mod.rs:3494— crates/rspack/src/builder/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in OptimizationOptionsBuilder::build at line 3494. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack/src/builder/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/rspack_watcher/src/trigger.rs crates/rspack_watcher/src/trigger.rs:228— crates/rspack_watcher/src/trigger.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in EventProcessor::process at line 228. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_watcher/src/trigger.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FunctionTooLong: index.runLoaders packages/rspack/src/loader-runner/index.ts:248— FunctionTooLong — runLoaders runs 720 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 620 over it, 7.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_hmr::generate_hot_update crates/rspack_plugin_hmr/src/lib.rs:238— FunctionTooLong — rspack_plugin_hmr::generate_hot_update runs 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 462 over it, 5.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_mf::manifest::process_assets crates/rspack_plugin_mf/src/manifest/mod.rs:164— FunctionTooLong — rspack_plugin_mf::manifest::process_assets runs 487 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 387 over it, 4.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_core::compilation::create_hash::create_hash crates/rspack_core/src/compilation/create_hash/mod.rs:34— FunctionTooLong — rspack_core::compilation::create_hash::create_hash runs 334 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_core::compilation::runtime_requirements::process_chunks_runtime_requirements crates/rspack_core/src/compilation/runtime_requirements/mod.rs:297— FunctionTooLong — rspack_core::compilation::runtime_requirements::process_chunks_runtime_requirements runs 281 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_runtime::runtime_plugin::runtime_requirements_in_tree crates/rspack_plugin_runtime/src/runtime_plugin.rs:157— FunctionTooLong — rspack_plugin_runtime::runtime_plugin::runtime_requirements_in_tree runs 281 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_javascript::plugin::impl_plugin_for_js_plugin::compilation crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs:54— FunctionTooLong — rspack_plugin_javascript::plugin::impl_plugin_for_js_plugin::compilation runs 278 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack::builder::browserslist_target::resolve crates/rspack/src/builder/browserslist_target.rs:70— FunctionTooLong — rspack::builder::browserslist_target::resolve runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_swc_js_minimizer::process_assets crates/rspack_plugin_swc_js_minimizer/src/lib.rs:223— FunctionTooLong — rspack_plugin_swc_js_minimizer::process_assets runs 251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_css_chunking::optimize_chunks crates/rspack_plugin_css_chunking/src/lib.rs:73— FunctionTooLong — rspack_plugin_css_chunking::optimize_chunks runs 235 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_core::options::resolve::clever_merge::_merge_resolve crates/rspack_core/src/options/resolve/clever_merge.rs:194— FunctionTooLong — rspack_core::options::resolve::clever_merge::_merge_resolve runs 216 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: CommunityCompatibleTable.CommunityPluginCompatibleTable website/components/CommunityCompatibleTable.tsx:68— FunctionTooLong — CommunityPluginCompatibleTable runs 216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack::builder::target::get_target_properties crates/rspack/src/builder/target.rs:250— FunctionTooLong — rspack::builder::target::get_target_properties runs 196 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_javascript::runtime::render_module crates/rspack_plugin_javascript/src/runtime.rs:174— FunctionTooLong — rspack_plugin_javascript::runtime::render_module runs 183 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_runtime::module_chunk_format::render_chunk crates/rspack_plugin_runtime/src/module_chunk_format.rs:137— FunctionTooLong — rspack_plugin_runtime::module_chunk_format::render_chunk runs 180 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_real_content_hash::inner_impl crates/rspack_plugin_real_content_hash/src/lib.rs:82— FunctionTooLong — rspack_plugin_real_content_hash::inner_impl runs 179 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_javascript::runtime_context::render_runtime_chunk_runtime_modules_sync crates/rspack_plugin_javascript/src/runtime_context.rs:198— FunctionTooLong — rspack_plugin_javascript::runtime_context::render_runtime_chunk_runtime_modules_sync runs 175 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RuntimeGlobals.renderRuntimeGlobals packages/rspack/src/RuntimeGlobals.ts:525— FunctionTooLong — renderRuntimeGlobals runs 175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_get_linking_error crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:279— FunctionTooLong — rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_get_linking_error runs 171 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack::builder::default_rules crates/rspack/src/builder/mod.rs:1919— FunctionTooLong — rspack::builder::default_rules runs 170 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_esm_library::preserve_modules::preserve_modules crates/rspack_plugin_esm_library/src/preserve_modules.rs:114— FunctionTooLong — rspack_plugin_esm_library::preserve_modules::preserve_modules runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_esm_library::split_chunks::split crates/rspack_plugin_esm_library/src/split_chunks.rs:178— FunctionTooLong — rspack_plugin_esm_library::split_chunks::split runs 163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_plugin_javascript::plugin::side_effects_flag_plugin::optimize_dependencies crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs:334— FunctionTooLong — rspack_plugin_javascript::plugin::side_effects_flag_plugin::optimize_dependencies runs 161 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: Diagnostics.createDiagnosticArray packages/rspack/src/Diagnostics.ts:7— FunctionTooLong — createDiagnosticArray runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rspack_ids::named_chunk_ids_plugin::assign_named_chunk_ids crates/rspack_ids/src/named_chunk_ids_plugin.rs:19— FunctionTooLong — rspack_ids::named_chunk_ids_plugin::assign_named_chunk_ids runs 155 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
rspack_plugin_javascript::magic_comment::analyze_raw_comments (cognitive 89) crates/rspack_plugin_javascript/src/magic_comment.rs:610— rspack_plugin_javascript::magic_comment::analyze_raw_comments has cognitive complexity 89 (threshold 15). Drivers by points: if/else 30 (78 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_get_linking_error (cognitive 59) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:279— rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_get_linking_error has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (48 pts), boolean chains 7, loops 1 (3 pts), match/switch 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_javascript::runtime_context::render_runtime_chunk_runtime_modules_sync (cognitive 51) crates/rspack_plugin_javascript/src/runtime_context.rs:198— rspack_plugin_javascript::runtime_context::render_runtime_chunk_runtime_modules_sync has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (34 pts), loops 6 (11 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::visitors::dependency::context_dependency_helper::create_context_dependency (cognitive 51) crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:24— rspack_plugin_javascript::visitors::dependency::context_dependency_helper::create_context_dependency has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (36 pts), match/switch 3 (8 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_add (cognitive 49) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:298— rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_add has cognitive complexity 49 (threshold 15). Drivers by points: if/else 30 (45 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::plugin::flag_dependency_usage_plugin::process_referenced_module_without_nested (cognitive 45) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:774— rspack_plugin_javascript::plugin::flag_dependency_usage_plugin::process_referenced_module_without_nested has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_const_operation (cognitive 43) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:444— rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_const_operation has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 6 (14 pts), boolean chains 5 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::collect_pure_annotations (cognitive 42) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:177— rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::collect_pure_annotations has cognitive complexity 42 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 5 (15 pts), boolean chains 6, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::runtime::render_module (cognitive 36) crates/rspack_plugin_javascript/src/runtime.rs:174— rspack_plugin_javascript::runtime::render_module has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::side_effects_analysis::may_have_side_effects (cognitive 33) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_analysis.rs:56— rspack_plugin_javascript::parser_plugin::side_effects_analysis::may_have_side_effects has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 5 (9 pts), boolean chains 8 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::plugin::side_effects_flag_plugin::optimize_dependencies (cognitive 31) crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs:334— rspack_plugin_javascript::plugin::side_effects_flag_plugin::optimize_dependencies has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (5 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 12). Of this number, 19 points are the body's own statements and 12 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::api_plugin::static_require_member_chain (cognitive 30) crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs:476— rspack_plugin_javascript::parser_plugin::api_plugin::static_require_member_chain has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::const::if_stmt::get_hoisted_declarations (cognitive 30) crates/rspack_plugin_javascript/src/parser_plugin/const/if_stmt.rs:60— rspack_plugin_javascript::parser_plugin::const::if_stmt::get_hoisted_declarations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::mark_auto_side_effects_free_program (cognitive 29) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:352— rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::mark_auto_side_effects_free_program has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::plugin::mangle_exports_plugin::mangle_exports_info (cognitive 28) crates/rspack_plugin_javascript/src/plugin/mangle_exports_plugin.rs:300— rspack_plugin_javascript::plugin::mangle_exports_plugin::mangle_exports_info has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (13 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_apply (cognitive 26) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:115— rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::plugin::mangle_exports_plugin::optimize_code_generation (cognitive 26) crates/rspack_plugin_javascript/src/plugin/mangle_exports_plugin.rs:132— rspack_plugin_javascript::plugin::mangle_exports_plugin::optimize_code_generation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::runtime::render_runtime_module_sources (cognitive 26) crates/rspack_plugin_javascript/src/runtime.rs:482— rspack_plugin_javascript::runtime::render_runtime_module_sources has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_javascript::runtime_context::render_hot_update_chunk_runtime_modules (cognitive 24) crates/rspack_plugin_javascript/src/runtime_context.rs:506— rspack_plugin_javascript::runtime_context::render_hot_update_chunk_runtime_modules has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::utils::eval::is_valid_reg_exp_flags (cognitive 24) crates/rspack_plugin_javascript/src/utils/eval/mod.rs:806— rspack_plugin_javascript::utils::eval::is_valid_reg_exp_flags has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::plugin::side_effects_flag_plugin::can_optimize_connection (cognitive 22) crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs:594— rspack_plugin_javascript::plugin::side_effects_flag_plugin::can_optimize_connection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::const::logic_expr::expression_logic_operator (cognitive 21) crates/rspack_plugin_javascript/src/parser_plugin/const/logic_expr.rs:9— rspack_plugin_javascript::parser_plugin::const::logic_expr::expression_logic_operator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::collect_defined_configured_side_effects_free (cognitive 21) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:90— rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::collect_defined_configured_side_effects_free has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::dependency::branch_guard::resolve_esm_imported_in_operator_guard (cognitive 20) crates/rspack_plugin_javascript/src/dependency/branch_guard.rs:311— rspack_plugin_javascript::dependency::branch_guard::resolve_esm_imported_in_operator_guard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_javascript::utils::eval::eval_new_expr::eval_new_expression (cognitive 20) crates/rspack_plugin_javascript/src/utils/eval/eval_new_expr.rs:12— rspack_plugin_javascript::utils::eval::eval_new_expr::eval_new_expression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
+ 16 more in this group — see findings.md.
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×40
JavaScript dependencies are not locked tests/rspack-test/configCases/chunk-ids/stable-chunk-ids-with-duplicate-chunks/package.json:6— tests/rspack-test/configCases/chunk-ids/stable-chunk-ids-with-duplicate-chunks/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container-1-5/exposed-overridables/package.json:2— tests/rspack-test/configCases/container-1-5/exposed-overridables/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container-1-5/manifest-disable-assets-analyze/package.json:4— tests/rspack-test/configCases/container-1-5/manifest-disable-assets-analyze/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container-1-5/manifest-entry-filter/package.json:4— tests/rspack-test/configCases/container-1-5/manifest-entry-filter/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container-1-5/manifest-file-name/package.json:4— tests/rspack-test/configCases/container-1-5/manifest-file-name/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container-1-5/manifest-required-version-range/package.json:4— tests/rspack-test/configCases/container-1-5/manifest-required-version-range/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container-1-5/manifest/package.json:4— tests/rspack-test/configCases/container-1-5/manifest/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/container/exposed-overridables/package.json:2— tests/rspack-test/configCases/container/exposed-overridables/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/css/css-order-concatenate-modules/package.json:5— tests/rspack-test/configCases/css/css-order-concatenate-modules/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/css/css-order-reexport/package.json:5— tests/rspack-test/configCases/css/css-order-reexport/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/css/css-order2/package.json:5— tests/rspack-test/configCases/css/css-order2/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/css/css-order3/package.json:5— tests/rspack-test/configCases/css/css-order3/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/mangle-exports/skipping-mangle-css-modules/package.json:5— tests/rspack-test/configCases/mangle-exports/skipping-mangle-css-modules/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/rstest/mock/package.json:3— tests/rspack-test/configCases/rstest/mock/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/consume-module-ignore-warnings/package.json:2— tests/rspack-test/configCases/sharing/consume-module-ignore-warnings/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/consume-module/package.json:2— tests/rspack-test/configCases/sharing/consume-module/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/consume-multiple-versions-ignore-warnings/package.json:2— tests/rspack-test/configCases/sharing/consume-multiple-versions-ignore-warnings/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/consume-multiple-versions/package.json:2— tests/rspack-test/configCases/sharing/consume-multiple-versions/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/consume-self-reference/package.json:2— tests/rspack-test/configCases/sharing/consume-self-reference/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/no-override-loaded/package.json:3— tests/rspack-test/configCases/sharing/no-override-loaded/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/provide-eager-module/package.json:2— tests/rspack-test/configCases/sharing/provide-eager-module/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/share-multiple-versions/package.json:2— tests/rspack-test/configCases/sharing/share-multiple-versions/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/share-plugin-dual-mode/package.json:2— tests/rspack-test/configCases/sharing/share-plugin-dual-mode/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/share-plugin-monorepo/app1/package.json:2— tests/rspack-test/configCases/sharing/share-plugin-monorepo/app1/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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 tests/rspack-test/configCases/sharing/share-plugin-monorepo/package.json:2— tests/rspack-test/configCases/sharing/share-plugin-monorepo/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / 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.
rspack_core::options::resolve::clever_merge::_merge_resolve (cognitive 264) crates/rspack_core/src/options/resolve/clever_merge.rs:194— rspack_core::options::resolve::clever_merge::_merge_resolve has cognitive complexity 264 (threshold 15). Drivers by points: if/else 93 (178 pts), loops 42 (86 pts) (nesting depth added 129). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::options::resolve::clever_merge::parse_resolve (cognitive 261) crates/rspack_core/src/options/resolve/clever_merge.rs:76— rspack_core::options::resolve::clever_merge::parse_resolve has cognitive complexity 261 (threshold 15). Drivers by points: if/else 81 (181 pts), loops 40 (80 pts) (nesting depth added 140). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::utils::find_graph_roots::find_graph_roots (cognitive 103) crates/rspack_core/src/utils/find_graph_roots.rs:59— rspack_core::utils::find_graph_roots::find_graph_roots has cognitive complexity 103 (threshold 15). Drivers by points: if/else 19 (66 pts), loops 10 (32 pts), match/switch 1 (5 pts) (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_core::utils::module_rules::module_rule_matcher_async (cognitive 80) crates/rspack_core/src/utils/module_rules.rs:304— rspack_core::utils::module_rules::module_rule_matcher_async has cognitive complexity 80 (threshold 15). Drivers by points: if/else 31 (51 pts), loops 5 (14 pts), boolean chains 13, match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::create_hash::create_hash (cognitive 65) crates/rspack_core/src/compilation/create_hash/mod.rs:34— rspack_core::compilation::create_hash::create_hash has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 14 (22 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 25). Of this number, 61 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::runtime_requirements::process_chunks_runtime_requirements (cognitive 64) crates/rspack_core/src/compilation/runtime_requirements/mod.rs:297— rspack_core::compilation::runtime_requirements::process_chunks_runtime_requirements has cognitive complexity 64 (threshold 15). Drivers by points: loops 17 (32 pts), if/else 14 (30 pts), boolean chains 2 (nesting depth added 31). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rspack_core::module::get_exports_type_impl (cognitive 57) crates/rspack_core/src/module.rs:926— rspack_core::module::get_exports_type_impl has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (45 pts), match/switch 4 (12 pts) (nesting depth added 35). Of this number, 54 points are the body's own statements and 3 belong to one function item inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rspack_core::utils::module_rules::module_rule_matcher_sync (cognitive 52) crates/rspack_core/src/utils/module_rules.rs:149— rspack_core::utils::module_rules::module_rule_matcher_sync has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (30 pts), loops 5 (14 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_core::resolver::resolve_for_error_hints (cognitive 51) crates/rspack_core/src/resolver/mod.rs:100— rspack_core::resolver::resolve_for_error_hints has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (42 pts), loops 1 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_core::compilation::create_module_hashes::create_module_hashes_pass_impl (cognitive 49) crates/rspack_core/src/compilation/create_module_hashes/mod.rs:23— rspack_core::compilation::create_module_hashes::create_module_hashes_pass_impl has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 3 (9 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_core::stats::utils::get_chunk_relations (cognitive 49) crates/rspack_core/src/stats/utils.rs:243— rspack_core::stats::utils::get_chunk_relations has cognitive complexity 49 (threshold 15). Drivers by points: if/else 6 (26 pts), loops 6 (20 pts), boolean chains 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::utils::compile_boolean_matcher::items_to_regexp (cognitive 38) crates/rspack_core/src/utils/compile_boolean_matcher.rs:75— rspack_core::utils::compile_boolean_matcher::items_to_regexp has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_core::runtime_template::runtime_globals_to_render_map (cognitive 35) crates/rspack_core/src/runtime_template.rs:418— rspack_core::runtime_template::runtime_globals_to_render_map has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (31 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::build_chunk_graph::code_splitter::extract_block_modules (cognitive 32) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:3029— rspack_core::compilation::build_chunk_graph::code_splitter::extract_block_modules has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::context_module::create_identifier (cognitive 24) crates/rspack_core/src/context_module.rs:1614— rspack_core::context_module::create_identifier has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (23 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_core::exports::target::resolve_target (cognitive 24) crates/rspack_core/src/exports/target.rs:215— rspack_core::exports::target::resolve_target has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::code_generation::code_generation_modules (cognitive 23) crates/rspack_core/src/compilation/code_generation/mod.rs:127— rspack_core::compilation::code_generation::code_generation_modules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::create_chunk_assets::create_chunk_assets (cognitive 23) crates/rspack_core/src/compilation/create_chunk_assets/mod.rs:27— rspack_core::compilation::create_chunk_assets::create_chunk_assets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (6 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::context_module_factory::alternative_requests (cognitive 22) crates/rspack_core/src/context_module_factory.rs:699— rspack_core::context_module_factory::alternative_requests has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (9 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::stats::utils::get_chunk_child_ids_by_order (cognitive 22) crates/rspack_core/src/stats/utils.rs:184— rspack_core::stats::utils::get_chunk_child_ids_by_order has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 pts), match/switch 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::utils::extract_source_map::extract_source_map (cognitive 22) crates/rspack_core/src/utils/extract_source_map.rs:332— rspack_core::utils::extract_source_map::extract_source_map has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::runtime_requirements::runtime_requirements_pass_impl (cognitive 21) crates/rspack_core/src/compilation/runtime_requirements/mod.rs:28— rspack_core::compilation::runtime_requirements::runtime_requirements_pass_impl has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (8 pts), match/switch 3 (6 pts), if/else 5, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::context_module_factory::visit_dirs (cognitive 21) crates/rspack_core/src/context_module_factory.rs:505— rspack_core::context_module_factory::visit_dirs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_core::utils::extract_source_map::trailing_source_mapping_url_range (cognitive 21) crates/rspack_core/src/utils/extract_source_map.rs:81— rspack_core::utils::extract_source_map::trailing_source_mapping_url_range has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_core::compilation::build_module_graph::graph_updater::expand_rebuild_modules (cognitive 20) crates/rspack_core/src/compilation/build_module_graph/graph_updater/mod.rs:17— rspack_core::compilation::build_module_graph::graph_updater::expand_rebuild_modules has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassTooLong: LexDependencies crates/css-module-lexer/src/dependencies.rs:1439— ClassTooLong — 2422 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 3 blocks, lines 1439-4712. The bar is 400 significant lines; this is 2022 over it, 6.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CodeSplitter crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:377— ClassTooLong — 1777 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 2 blocks, lines 377-2936. The bar is 400 significant lines; this is 1377 over it, 4.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ConcatenatedModule crates/rspack_core/src/concatenated_module.rs:509— ClassTooLong — 1590 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 7 blocks, lines 509-2811. The bar is 400 significant lines; this is 1190 over it, 3.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ResolverGeneric crates/rspack_resolver/src/lib.rs:135— ClassTooLong — 1405 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 5 blocks, lines 135-2403. The bar is 400 significant lines; this is 1005 over it, 3.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Stats crates/rspack_core/src/stats/mod.rs:125— ClassTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 4 blocks, lines 125-1779. The bar is 400 significant lines; this is 872 over it, 3.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ESMExportImportedSpecifierDependency crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:52— ClassTooLong — 1210 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 6 blocks, lines 52-1694. The bar is 400 significant lines; this is 810 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ServerActions crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:147— ClassTooLong — 1104 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 3 blocks, lines 147-1962. The bar is 400 significant lines; this is 704 over it, 2.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: JavascriptParser crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:472— ClassTooLong — 1046 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 230 methods, 3 blocks, lines 472-1914. The bar is 400 significant lines; this is 646 over it, 2.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CommonJsImportsParserPlugin crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1598— ClassTooLong — 951 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 1600-2855. The bar is 400 significant lines; this is 551 over it, 2.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModuleConcatenationPlugin crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:439— ClassTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 3 blocks, lines 439-1782. The bar is 400 significant lines; this is 490 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RstestParserPlugin crates/rspack_plugin_rstest/src/parser_plugin.rs:144— ClassTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 144-1438. The bar is 400 significant lines; this is 489 over it, 2.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Compilation crates/rspack_core/src/compilation/mod.rs:213— ClassTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 2 blocks, lines 213-1355. The bar is 400 significant lines; this is 435 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CssModuleGenerator crates/rspack_plugin_css/src/parser_and_generator/generator.rs:81— ClassTooLong — 800 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 81-1145. The bar is 400 significant lines; this is 400 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: JsCompilation crates/rspack_binding_api/src/compilation/mod.rs:49— ClassTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 3 blocks, lines 49-1124. The bar is 400 significant lines; this is 348 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModuleGraph crates/rspack_core/src/module_graph/mod.rs:162— ClassTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 72 methods, 3 blocks, lines 162-1214. The bar is 400 significant lines; this is 335 over it, 1.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OutputOptionsBuilder crates/rspack/src/builder/mod.rs:2175— ClassTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 4 blocks, lines 2175-3249. The bar is 400 significant lines; this is 290 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Compiler packages/rspack/src/Compiler.ts:142— ClassTooLong — 663 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 263 over it, 1.66× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SourceMapDevToolPlugin crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:298— ClassTooLong — 663 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 3 blocks, lines 298-1349. The bar is 400 significant lines; this is 263 over it, 1.66× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ExternalModule crates/rspack_core/src/external_module.rs:537— ClassTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 5 blocks, lines 537-1438. The bar is 400 significant lines; this is 258 over it, 1.65× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NormalModule crates/rspack_core/src/normal_module.rs:97— ClassTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 8 blocks, lines 97-1000. The bar is 400 significant lines; this is 234 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: InnerGraphParserPlugin crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:49— ClassTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 3 blocks, lines 49-990. The bar is 400 significant lines; this is 233 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Chunk crates/rspack_core/src/chunk.rs:96— ClassTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 3 blocks, lines 96-1036. The bar is 400 significant lines; this is 231 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FileSystemInfo crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:116— ClassTooLong — 614 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 3 blocks, lines 116-1001. The bar is 400 significant lines; this is 214 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: JavaScriptParserPluginDrive crates/rspack_plugin_javascript/src/parser_plugin/drive.rs:26— ClassTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 3 blocks, lines 26-954. The bar is 400 significant lines; this is 212 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AssetParserAndGenerator crates/rspack_plugin_asset/src/lib.rs:71— ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 3 blocks, lines 71-878. The bar is 400 significant lines; this is 179 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (11 lines × 2) crates/css-module-lexer/src/dependencies.rs:2393— crates/css-module-lexer/src/dependencies.rs:2393-2403 | crates/css-module-lexer/src/dependencies.rs:2706-2716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2393` it begins part-way through the construct above it, so those 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/css-module-lexer/src/dependencies.rs:2718` calls `slice`, `trim_end_matches` and `crates/css-module-lexer/src/dependencies.rs:2404` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) crates/rspack_binding_api/src/raw_options/raw_builtins/raw_circular_dependency.rs:86— crates/rspack_binding_api/src/raw_options/raw_builtins/raw_circular_dependency.rs:86-96 | crates/rspack_binding_api/src/raw_options/raw_builtins/raw_circular_dependency.rs:98-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1790— crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1790-1801 | crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1893-1903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1790` it begins part-way through the construct above it, so those 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 `item` to `&ProcessEntryBlock` in one and `&ProcessBlock` 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/rspack_core/src/compilation/create_hash/mod.rs:134— crates/rspack_core/src/compilation/create_hash/mod.rs:134-144 | crates/rspack_core/src/compilation/create_hash/mod.rs:366-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compilation/create_hash/mod.rs:134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) crates/rspack_core/src/module_graph/mod.rs:212— crates/rspack_core/src/module_graph/mod.rs:212-222 | crates/rspack_core/src/module_graph/mod.rs:237-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/module_graph/mod.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 (11 lines × 2) crates/rspack_core/src/module_graph/mod.rs:448— crates/rspack_core/src/module_graph/mod.rs:448-458 | crates/rspack_core/src/module_graph/mod.rs:479-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/module_graph/mod.rs:448` it begins part-way through the construct above it, so those exact lines 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/rspack_core/src/new_cache/snapshot/file_system_info.rs:436— crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:436-446 | crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:500-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/rspack_core/src/new_cache/snapshot/file_system_info.rs:436` 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/rspack_error/src/displayer/renderer/graphical.rs:482— crates/rspack_error/src/displayer/renderer/graphical.rs:482-492 | crates/rspack_error/src/displayer/renderer/graphical.rs:499-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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/rspack_hash/src/lib.rs:463— crates/rspack_hash/src/lib.rs:463-473 | crates/rspack_hash/src/lib.rs:501-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_hash/src/lib.rs:475` calls `write` and `crates/rspack_hash/src/lib.rs:513` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) crates/rspack_javascript_compiler/src/compiler/parse.rs:63— crates/rspack_javascript_compiler/src/compiler/parse.rs:63-73 | crates/rspack_javascript_compiler/src/compiler/parse.rs:87-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_javascript_compiler/src/compiler/parse.rs:63` it begins part-way through the construct above it, so those exact lines 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/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1740— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1740-1750 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1790-1800 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1740` 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/rspack_plugin_devtool/src/module_filename_helpers.rs:380— crates/rspack_plugin_devtool/src/module_filename_helpers.rs:380-390 | crates/rspack_plugin_devtool/src/module_filename_helpers.rs:471-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_devtool/src/module_filename_helpers.rs:380` it does not close everything it opens, so those exact lines 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/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:633— crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:633-643 | crates/rspack_plugin_library/src/system_library_plugin.rs:93-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_esm_library/src/link.rs:1060— crates/rspack_plugin_esm_library/src/link.rs:1060-1070 | crates/rspack_plugin_esm_library/src/link.rs:1072-1082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_esm_library/src/link.rs:1060` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/dependency/amd/amd_require_dependency.rs:164— crates/rspack_plugin_javascript/src/dependency/amd/amd_require_dependency.rs:164-174 | crates/rspack_plugin_javascript/src/dependency/amd/amd_require_dependency.rs:210-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2807— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2807-2817 | crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:851-861 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2807` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:104— crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:104-114 | crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:176-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/rspack_plugin_library/src/amd_library_plugin.rs:103— crates/rspack_plugin_library/src/amd_library_plugin.rs:103-113 | crates/rspack_plugin_library/src/umd_library_plugin.rs:117-127 — before extracting anything, compare `crates/rspack_plugin_library/src/amd_library_plugin.rs` and `crates/rspack_plugin_library/src/umd_library_plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_library/src/amd_library_plugin.rs:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs:392— crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs:392-402 | crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs:451-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs:392` it begins part-way through the construct above it, so those 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 (11 lines × 2) crates/rspack_plugin_rsc/src/rsc_entry_module.rs:164— crates/rspack_plugin_rsc/src/rsc_entry_module.rs:164-174 | crates/rspack_plugin_rsc/src/rsc_entry_module.rs:274-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/rspack_resolver/src/lib.rs:174— crates/rspack_resolver/src/lib.rs:174-184 | crates/rspack_resolver/src/lib.rs:195-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_resolver/src/lib.rs:174` 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_plugin_import/src/lib.rs:512— crates/swc_plugin_import/src/lib.rs:512-522 | crates/swc_plugin_import/src/lib.rs:528-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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_plugin_import/src/lib.rs:512` 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/rspack_allocative/src/key.rs:54— crates/rspack_allocative/src/key.rs:54-64 | crates/rspack_allocative_derive/src/derive_allocative.rs:17-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:97— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:97-107 | crates/rspack_plugin_rstest/src/parser_plugin.rs:86-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_runtime/src/runtime_module/create_script.rs:49— crates/rspack_plugin_runtime/src/runtime_module/create_script.rs:49-59 | crates/rspack_plugin_runtime/src/runtime_module/create_script_url.rs:49-59 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/create_script.rs` and `crates/rspack_plugin_runtime/src/runtime_module/create_script_url.rs` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_runtime/src/runtime_module/create_script.rs:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Change coupling: eval_dev_tool_module_plugin.rs ↔ eval_source_map_dev_tool_plugin.rs crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:1— `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `c878703d` perf: improve get chunk modules (#11579); `62c8e9e7` feat: support using declaration (#11395); `096bf260` fix: render namespace template in devtool plugins (#10448) — run `git show` on any of them.
Change coupling: node.rs ↔ write.rs crates/rspack_binding_api/src/fs_node/node.rs:1— `crates/rspack_binding_api/src/fs_node/node.rs` and `crates/rspack_fs/src/write.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `96e2777d` refactor: simplify file system code (#8654) (at that commit the file was still `crates/rspack_fs_node/src/node.rs`); `b77d7de1` refactor: rspack_fs use `Utf8Path` and `FileMetadata` (#8366) (at that commit the files were still `crates/rspack_fs_node/src/node.rs` and `crates/rspack_fs/src/async.rs`); `26801202` feat: add read API to output file system (#8274) (at that commit the files were still `crates/rspack_fs_node/src/node.rs` and `crates/rspack_fs/src/async.rs`) — run `git show` on any of them.
Change coupling: common_js_require_context_dependency.rs ↔ import_context_dependency.rs crates/rspack_plugin_javascript/src/dependency/context/common_js_require_context_dependency.rs:1— `crates/rspack_plugin_javascript/src/dependency/context/common_js_require_context_dependency.rs` and `crates/rspack_plugin_javascript/src/dependency/context/import_context_dependency.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `2e3a54eb` fix: empty references export for cjs and dynamic import tree shaking …; `c0a82b3a` feat: amd context require (#9495); `1d125ac4` refactor: use `RealDependencyLocation` instead of `range` in dependen… — run `git show` on any of them.
Change coupling: mod.rs ↔ defaults.ts crates/rspack_binding_api/src/raw_options/raw_experiments/mod.rs:1— `crates/rspack_binding_api/src/raw_options/raw_experiments/mod.rs` and `packages/rspack/src/config/defaults.ts` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `1ea0d42a` feat(cache): add fine-grained new cache options (#15261); `b67cad2e` feat!: remove `experiments.lazyBarrel` (#12724); `ffafc655` feat!: remove `experiments.topLevelAwait` (#12722) — run `git show` on any of them.
Change coupling: mod.rs ↔ normalization.ts crates/rspack_binding_api/src/raw_options/raw_experiments/mod.rs:1— `crates/rspack_binding_api/src/raw_options/raw_experiments/mod.rs` and `packages/rspack/src/config/normalization.ts` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `1ea0d42a` feat(cache): add fine-grained new cache options (#15261); `b67cad2e` feat!: remove `experiments.lazyBarrel` (#12724); `ffafc655` feat!: remove `experiments.topLevelAwait` (#12722) — run `git show` on any of them.
Change coupling: clever_merge.rs ↔ resolver_impl.rs crates/rspack_core/src/options/resolve/clever_merge.rs:1— `crates/rspack_core/src/options/resolve/clever_merge.rs` and `crates/rspack_core/src/resolver/resolver_impl.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `f03bd2f4` refactor: remove redundant clones and unused Clone derives (#15519); `72d1b7fb` feat(pnp)!: drop multi yarn pnp project resolving (#13389); `fb8c2cc1` feat: Add `pnp_manifest` option to resolver (#12417) — run `git show` on any of them.
Change coupling: raw_resolve.rs ↔ clever_merge.rs crates/rspack_binding_api/src/options/raw_resolve.rs:1— `crates/rspack_binding_api/src/options/raw_resolve.rs` and `crates/rspack_core/src/options/resolve/clever_merge.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `72d1b7fb` feat(pnp)!: drop multi yarn pnp project resolving (#13389); `fb8c2cc1` feat: Add `pnp_manifest` option to resolver (#12417); `89c37fbf` fix: buildDependencies skip resolve nodejs builtin module (#11256) — run `git show` on any of them.
Change coupling: index.ts ↔ worker.ts packages/rspack/src/loader-runner/index.ts:1— `packages/rspack/src/loader-runner/index.ts` and `packages/rspack/src/loader-runner/worker.ts` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `858fd43f` feat(loader): support buildInfo custom fields in parallel loaders (#1…; `8e0da07e` fix: preserve diagnostics returned by importModule (#15496); `2856c504` feat(javascript): add JavascriptModulesPlugin.getChunkFilenameTemplat… — run `git show` on any of them.
Change coupling: raw_html.rs ↔ plugin.rs crates/rspack_binding_api/src/raw_options/raw_builtins/raw_html.rs:1— `crates/rspack_binding_api/src/raw_options/raw_builtins/raw_html.rs` and `crates/rspack_plugin_html/src/plugin.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `5eac88c0` feat!: remove sri option of HtmlRspackPlugin (#12651); `972c005f` fix(html): not to override plugin options when using multiple instanc… (at that commit the file was still `crates/node_binding/src/raw_options/raw_builtins/raw_html.rs`); `5b7653b4` feat(html): support function filename and `[name]` in filename (#7753) (at that commit the file was still `crates/rspack_binding_options/src/options/raw_builtins/raw_html.rs`) — run `git show` on any of them.
Change coupling: raw_optimization.rs ↔ adapter.ts crates/rspack_binding_api/src/raw_options/raw_optimization.rs:1— `crates/rspack_binding_api/src/raw_options/raw_optimization.rs` and `packages/rspack/src/config/adapter.ts` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `28abee87` refactor: remove as much `getRawOptions` as possible (#8773) (at that commit the file was still `crates/rspack_binding_values/src/raw_options/raw_optimization.rs`); `ea2947e6` chore: remove new split chunks options (#6536) (at that commit the file was still `crates/rspack_binding_options/src/options/raw_optimization.rs`); `7ea17cc2` feat: add function type splitChunks chunks (#5019) (at that commit the file was still `crates/rspack_binding_options/src/options/raw_optimization.rs`) — run `git show` on any of them.
Change coupling: builder_context.rs ↔ mod.rs crates/rspack/src/builder/builder_context.rs:1— `crates/rspack/src/builder/builder_context.rs` and `crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `99a13944` fix(ids): correct compact hashed API names (#15356); `25762c20` feat(ids): add compact chunk ids (#14959); `df6cc3d1` feat(ids): add compat-hashed module ids (#14926) — run `git show` on any of them.
Change coupling: import_meta_context_dependency_parser_plugin.rs ↔ import_parser_plugin.rs crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs:1— `crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs` and `crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `5dc1d7ae` feat: support caseSensitive in import.meta.glob (#14811); `26060ed3` fix: handle context changes in import.meta.glob hooks (#14897); `11448d64` feat: support more import.meta.glob options (#14129) — run `git show` on any of them.
Change coupling: scheduler.rs ↔ index.ts crates/rspack_binding_api/src/plugins/js_loader/scheduler.rs:1— `crates/rspack_binding_api/src/plugins/js_loader/scheduler.rs` and `packages/rspack/src/loader-runner/index.ts` change together 64% of the time (14 of the 22 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `79bad3fc` fix(core): distinguish fatal module errors from loader diagnostics (#…; `2b1dd371` fix(loader): revert native loader hook invocation (#15719); `df236e5e` fix(loader): preserve string BOM across native boundaries (#15632) — run `git show` on any of them.
Change coupling: assign_library_plugin.rs ↔ export_property_library_plugin.rs crates/rspack_plugin_library/src/assign_library_plugin.rs:1— `crates/rspack_plugin_library/src/assign_library_plugin.rs` and `crates/rspack_plugin_library/src/export_property_library_plugin.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `2f54e648` refactor: make finishModules readonly for compilation (#13058); `e04df144` refactor: improve exports info (#12587); `e2b38893` refactor: refactor collect_build_module_graph_effects using artifact … — run `git show` on any of them.
Change coupling: mod.rs ↔ module_rules.rs crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:1— `crates/rspack_binding_api/src/raw_options/raw_module/mod.rs` and `crates/rspack_core/src/utils/module_rules.rs` change together 62% of the time (20 of the 32 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `cfa30dbf` feat: add experimental rule.as (#15917); `30043652` perf: reduce normal module creation and rule matching overhead (#13926); `4da33a84` feat: support `match_when_empty` for rule condition (#8809) (at that commit the file was still `crates/rspack_binding_values/src/raw_options/raw_module/mod.rs`) — run `git show` on any of them.
Change coupling: builder_context.rs ↔ rspackOptionsApply.ts crates/rspack/src/builder/builder_context.rs:1— `crates/rspack/src/builder/builder_context.rs` and `packages/rspack/src/rspackOptionsApply.ts` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `99a13944` fix(ids): correct compact hashed API names (#15356); `25762c20` feat(ids): add compact chunk ids (#14959); `df6cc3d1` feat(ids): add compat-hashed module ids (#14926) — run `git show` on any of them.
Change coupling: mod.rs ↔ mod.rs crates/rspack_plugin_javascript/src/parser_plugin/mod.rs:1— `crates/rspack_plugin_javascript/src/parser_plugin/mod.rs` and `crates/rspack_plugin_javascript/src/visitors/dependency/mod.rs` change together 57% of the time (21 of the 37 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `9c1a057c` refactor: side effects parser plugin (#12014); `f2bc023f` feat!: detect conflicting values in `DefinePlugin` (#7045); `c0e838d5` refactor: port inner graph (#7043) — run `git show` on any of them.
Change coupling: compiler_options.rs ↔ adapter.ts crates/rspack_core/src/options/compiler_options.rs:1— `crates/rspack_core/src/options/compiler_options.rs` and `packages/rspack/src/config/adapter.ts` change together 56% of the time (10 of the 18 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `96084cc0` feat: support invalidate persistent cache using `config.mode` and `co…; `28abee87` refactor: remove as much `getRawOptions` as possible (#8773); `e833f205` refactor: phases level switcher for incremental options (#7954) — run `git show` on any of them.
Change coupling: build.ts ↔ serve.ts packages/rspack-cli/src/commands/build.ts:1— `packages/rspack-cli/src/commands/build.ts` and `packages/rspack-cli/src/commands/serve.ts` change together 55% of the time (17 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `2ec536ba` fix(cli): surface fatal errors and unhandled rejections on process ex…; `f2efb67b` fix(cli): apply default lazy compilation value based on user config (…; `0e14994d` perf(cli): switch to cac and refactor code (#11893) — run `git show` on any of them.
Change coupling: common_js_require_context_dependency.rs ↔ import_parser_plugin.rs crates/rspack_plugin_javascript/src/dependency/context/common_js_require_context_dependency.rs:1— `crates/rspack_plugin_javascript/src/dependency/context/common_js_require_context_dependency.rs` and `crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 `2e3a54eb` fix: empty references export for cjs and dynamic import tree shaking …; `b072b9da` feat: cjs require variable property access tree shaking (#13155); `c0a82b3a` feat: amd context require (#9495) — run `git show` on any of them.
Change coupling: common_js_export_require_dependency.rs ↔ common_js_self_reference_dependency.rs crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:1— `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs` and `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_self_reference_dependency.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `304d4814` refactor: reuse current module in dependency templates (#16149); `e04df144` refactor: improve exports info (#12587); `4ecc0318` refactor: refine exports info for CJS and ESM interop (#12577) — run `git show` on any of them.
Change coupling: flag_dependency_exports_plugin.rs ↔ export_property_library_plugin.rs crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:1— `crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs` and `crates/rspack_plugin_library/src/export_property_library_plugin.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 `2f54e648` refactor: make finishModules readonly for compilation (#13058); `e04df144` refactor: improve exports info (#12587); `e2b38893` refactor: refactor collect_build_module_graph_effects using artifact … — run `git show` on any of them.
Change coupling: raw_split_chunk_name.rs ↔ module_group.rs crates/rspack_binding_api/src/raw_options/raw_split_chunks/raw_split_chunk_name.rs:1— `crates/rspack_binding_api/src/raw_options/raw_split_chunks/raw_split_chunk_name.rs` and `crates/rspack_plugin_split_chunks/src/plugin/module_group.rs` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4f1ce3e7` perf: batch splitChunks JavaScript callbacks (#15147); `722967d5` perf: improve bundle splitting part 2 (#11233); `8b3d3f4f` refactor: remove `block_on` in split chunk name and test (#9722) (at that commit the file was still `crates/node_binding/src/raw_options/raw_split_chunks/raw_split_chunk_name.rs`) — run `git show` on any of them.
Change coupling: ctrl.rs ↔ execute.rs crates/rspack_core/src/compilation/build_module_graph/module_executor/ctrl.rs:1— `crates/rspack_core/src/compilation/build_module_graph/module_executor/ctrl.rs` and `crates/rspack_core/src/compilation/build_module_graph/module_executor/execute.rs` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `1473292c` refactor: rename TaskType::Sync to Main & TaskType::Async to backgrou… (at that commit the files were still `crates/rspack_core/src/compiler/module_executor/ctrl.rs` and `crates/rspack_core/src/compiler/module_executor/execute.rs`); `bd6c7568` chore: support event tracing (#10225) (at that commit the files were still `crates/rspack_core/src/compiler/module_executor/ctrl.rs` and `crates/rspack_core/src/compiler/module_executor/execute.rs`); `242967b1` fix: should rebuild css module when rebuild css extract entry (#10124) (at that commit the files were still `crates/rspack_core/src/compiler/module_executor/ctrl.rs` and `crates/rspack_core/src/compiler/module_executor/execute.rs`) — run `git show` on any of them.
Change coupling: array_push_callback_chunk_format.rs ↔ common_js_chunk_format.rs crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:1— `crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs` and `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `b1b7a99c` refactor(hmr): use the chunk content hash as its hmr version (#16585); `6e6aedf7` perf: improve create hash (#11598); `7b2e1568` fix: css loading runtime order (#5896) — run `git show` on any of them.
Duplicated block (9 lines × 2) crates/rspack/src/builder/mod.rs:2781— crates/rspack/src/builder/mod.rs:2781-2789 | crates/rspack/src/builder/mod.rs:2792-2800 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack/src/builder/mod.rs:2781` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/rspack_allocative_derive/src/derive_allocative.rs:296— crates/rspack_allocative_derive/src/derive_allocative.rs:296-304 | crates/rspack_allocative_derive/src/derive_allocative.rs:318-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_allocative_derive/src/derive_allocative.rs:296` 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/rspack_binding_api/src/compilation/dependencies.rs:107— crates/rspack_binding_api/src/compilation/dependencies.rs:107-115 | crates/rspack_binding_api/src/compilation/dependencies.rs:122-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/rspack_binding_api/src/compilation/dependencies.rs:107` 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/rspack_binding_api/src/options/raw_resolve.rs:138— crates/rspack_binding_api/src/options/raw_resolve.rs:138-146 | crates/rspack_binding_api/src/options/raw_resolve.rs:276-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:1095— crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:1095-1103 | crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:1105-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/raw_options/raw_module/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 (9 lines × 2) crates/rspack_cacheable_macros/src/cacheable/args.rs:25— crates/rspack_cacheable_macros/src/cacheable/args.rs:25-33 | crates/rspack_cacheable_macros/src/cacheable_dyn/args.rs:16-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_cacheable_macros/src/cacheable/args.rs:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/rspack_core/src/runtime.rs:276— crates/rspack_core/src/runtime.rs:276-284 | crates/rspack_core/src/runtime.rs:295-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/runtime.rs:276` 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/rspack_core/src/stats/mod.rs:1412— crates/rspack_core/src/stats/mod.rs:1412-1420 | crates/rspack_core/src/stats/mod.rs:1423-1431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/mod.rs:1412` it begins part-way through the construct above it, so those exact lines 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/rspack_core/src/stats/utils.rs:168— crates/rspack_core/src/stats/utils.rs:168-176 | crates/rspack_core/src/stats/utils.rs:216-224 — both copies are in the same file, so extract the block into 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/rspack_loader_swc/src/rsc_transforms/server_actions.rs:478— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:478-486 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:631-639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/rspack_plugin_esm_library/src/link.rs:2193— crates/rspack_plugin_esm_library/src/link.rs:2193-2201 | crates/rspack_plugin_esm_library/src/link.rs:2264-2272 — both copies are in the same file, so extract the block into 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/rspack_plugin_javascript/src/parser_and_generator/mod.rs:552— crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs:552-560 | crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs:565-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs:552` 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/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:153— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:153-161 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:85-93 — before extracting anything, compare `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs` and `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:153` it begins part-way through the construct above it, so those 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/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:151` calls `insert`, `into` and `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:83` 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/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1097— crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1097-1105 | crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1200-1208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1097` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:310— crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:310-319 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:380-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:310` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/runtime_context.rs:319— crates/rspack_plugin_javascript/src/runtime_context.rs:319-327 | crates/rspack_plugin_javascript/src/runtime_context.rs:460-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/runtime_context.rs:319` it does not close everything it opens, so those exact lines 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/rspack_plugin_rsdoctor/src/plugin.rs:539— crates/rspack_plugin_rsdoctor/src/plugin.rs:539-547 | crates/rspack_plugin_rsdoctor/src/plugin.rs:576-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_rsdoctor/src/plugin.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 (9 lines × 2) crates/rspack_plugin_rslib/src/url_external.rs:48— crates/rspack_plugin_rslib/src/url_external.rs:48-56 | crates/rspack_plugin_rslib/src/worker_external.rs:46-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/utils.rs:80— crates/rspack_plugin_runtime/src/runtime_module/utils.rs:80-88 | crates/rspack_plugin_runtime/src/runtime_module/utils.rs:149-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/rspack_tracing_perfetto/src/lib.rs:245— crates/rspack_tracing_perfetto/src/lib.rs:245-253 | crates/rspack_tracing_perfetto/src/lib.rs:398-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_tracing_perfetto/src/lib.rs:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `id` to `&span::Id` in one and `Id` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) crates/rspack_plugin_sri/src/manifest.rs:269— crates/rspack_plugin_sri/src/manifest.rs:269-277 | crates/rspack_plugin_sri/src/manifest.rs:442-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/rspack_core/src/context_module.rs:1459— crates/rspack_core/src/context_module.rs:1459-1467 | crates/rspack_core/src/normal_module.rs:464-472 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_core/src/context_module.rs:1459` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/plugin/api_plugin.rs:22— crates/rspack_plugin_javascript/src/plugin/api_plugin.rs:22-30 | crates/rspack_plugin_javascript/src/plugin/url_plugin.rs:164-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/api_plugin.rs:22` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs:47— crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs:47-55 | crates/rspack_plugin_runtime/src/runtime_module/chunk_preload_trigger.rs:47-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/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs:47` it begins part-way through the construct above it, so those exact lines 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/rspack_tracing_perfetto/src/lib.rs:450— crates/rspack_tracing_perfetto/src/lib.rs:450-458 | crates/rspack_tracing_perfetto/src/lib.rs:463-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_tracing_perfetto/src/lib.rs:450` 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 `value` to `&dyn std::fmt::Debug` in one and `&(dyn std::error::Error + 'static)` 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/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:719— crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:719-726 | crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1999-2006 — both copies are in the same file, so extract the block into 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/rspack_core/src/stats/utils.rs:249— crates/rspack_core/src/stats/utils.rs:249-256 | crates/rspack_plugin_rsdoctor/src/chunk_graph.rs:65-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/utils.rs:249` it does not close everything it opens, so those exact lines 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/rspack_core/src/utils/module_rules.rs:267— crates/rspack_core/src/utils/module_rules.rs:267-274 | crates/rspack_core/src/utils/module_rules.rs:441-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/utils/module_rules.rs:267` it does not close everything it opens, so those exact lines 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/rspack_ids/src/sync_module_ids_plugin.rs:139— crates/rspack_ids/src/sync_module_ids_plugin.rs:139-146 | crates/rspack_ids/src/sync_module_ids_plugin.rs:200-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:573— crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:573-580 | crates/rspack_plugin_extract_css/src/plugin.rs:706-713 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:573` it does not close everything it opens, so those exact lines 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/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:605— crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:605-612 | crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:692-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:605` it does not close everything it opens, so those exact lines 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/rspack_plugin_hmr/src/lib.rs:434— crates/rspack_plugin_hmr/src/lib.rs:434-441 | crates/rspack_plugin_hmr/src/lib.rs:526-533 — both copies are in the same file, so extract the block into 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/rspack_plugin_javascript/src/parser_plugin/define_plugin/walk_data.rs:351— crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/walk_data.rs:351-358 | crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/walk_data.rs:374-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/walk_data.rs:351` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:370— crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:370-377 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:446-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:370` 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:378` calls `is_empty` and `crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:454` 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/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:175— crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:175-182 | crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:209-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:175` it begins part-way through the construct above it, so those 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 (8 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:225— crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:225-232 | crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:235-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.
Duplicated block (8 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:543— crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:543-550 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:613-620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:611` calls `span`, `arguments` and `crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:542` 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/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:531— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:531-538 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:542-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:50— crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:50-57 | crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:149-156 — both copies are in the same file, so extract the 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/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:62` calls `quote_meta`, `join` and `crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:158` 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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1111— crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1111-1118 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1132-1139 — both copies are in the same file, so extract the block into 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/rspack_tools/src/compare/snapshot.rs:25— crates/rspack_tools/src/compare/snapshot.rs:25-32 | crates/rspack_tools/src/compare/snapshot.rs:34-41 — both copies are in the same file, so extract the block into 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/rspack_core/src/utils/mod.rs:200— crates/rspack_core/src/utils/mod.rs:200-207 | crates/rspack_core/src/utils/mod.rs:223-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/rspack_core/src/utils/mod.rs:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/rspack_fs/src/memory_fs.rs:377— crates/rspack_fs/src/memory_fs.rs:377-384 | crates/rspack_fs/src/native_fs.rs:401-408 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/rspack_plugin_circular_dependencies/src/circular_check_rspack_plugin.rs:152— crates/rspack_plugin_circular_dependencies/src/circular_check_rspack_plugin.rs:152-159 | crates/rspack_plugin_circular_dependencies/src/circular_modules_info_plugin.rs:29-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/rspack_plugin_css_chunking/src/lib.rs:422— crates/rspack_plugin_css_chunking/src/lib.rs:422-431 | crates/rspack_plugin_mf/src/container/hoist_container_references_plugin.rs:303-310 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:210— crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:210-217 | crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:328-335 — before extracting anything, compare `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:1341— crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:1341-1348 | crates/rspack_plugin_swc_js_minimizer/src/lib.rs:636-643 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_javascript/src/parser_plugin/define_plugin/mod.rs:114— crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/mod.rs:114-121 | crates/rspack_plugin_javascript/src/parser_plugin/provide_plugin/mod.rs:101-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/rspack_plugin_rslib/src/isolated_dts.rs:204— crates/rspack_plugin_rslib/src/isolated_dts.rs:204-211 | crates/rspack_plugin_rslib/src/plugin.rs:148-155 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/rspack_binding_api/src/chunk_group.rs:70— crates/rspack_binding_api/src/chunk_group.rs:70-77 | crates/rspack_binding_api/src/module.rs:447-454 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
+ 1 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×26
No test reaches this file packages/rspack/src/config/types.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/node_binding/rspack.wasi-browser.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/rspack/src/loader-runner/worker.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/rspack/src/browser/BrowserHttpImportEsmPlugin.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/node_binding/scripts/build.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/rspack_binding_builder_testing/binding.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/node_binding/scripts/add-external-debug-info.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/node_binding/wasi-worker.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/create-rspack/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/rspack/src/browser/BrowserRequirePlugin.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/node_binding/wasi-worker-browser.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/rspack_loader_preact_refresh/src/runtime.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/rspack_binding_builder_testing/scripts/build.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/node_binding/scripts/dts-header.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/rspack/src/browser/service.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/node_binding/scripts/move-binding.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/node_binding/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 packages/rspack/src/browser/fs.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/rspack/move-tinypool.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/rspack_plugin_wasm/src/runtime/read_file_compile_async_wasm.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/rspack/src/browser/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/rspack_plugin_wasm/src/runtime/read_file_compile_async_wasm_with_import.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/create-rspack/template-vanilla-ts/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/rspack/src/browser/middleware.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.
TooManyMethods: JavascriptParser crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:472— TooManyMethods — 230 methods, declared across 9 files: parser/walk.rs (100), parser/mod.rs (82), parser/walk_pre.rs (25), parser/walk_block_pre.rs (8), +5 more file(s). The bar is 30 methods; this is 200 over it, 7.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BasicEvaluatedExpression crates/rspack_plugin_javascript/src/utils/eval/mod.rs:143— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChunkGraph crates/rspack_core/src/chunk_graph/mod.rs:12— TooManyMethods — 73 methods, declared across 3 files: chunk_graph/chunk_graph_chunk.rs (48), chunk_graph/chunk_graph_module.rs (24), chunk_graph/mod.rs (1). The bar is 30 methods; this is 43 over it, 2.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ModuleGraph crates/rspack_core/src/module_graph/mod.rs:162— TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LexDependencies crates/css-module-lexer/src/dependencies.rs:1439— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Compilation crates/rspack_core/src/compilation/mod.rs:213— TooManyMethods — 60 methods, declared across 2 files: compilation/mod.rs (57), compilation/run_passes.rs (3). The bar is 30 methods; this is 30 over it, 2.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Chunk crates/rspack_core/src/chunk.rs:96— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JsCompilation crates/rspack_binding_api/src/compilation/mod.rs:49— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ResolverGeneric crates/rspack_resolver/src/lib.rs:135— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ExportInfoData crates/rspack_core/src/exports/export_info.rs:42— TooManyMethods — 56 methods, declared across 3 files: exports/export_info.rs (35), exports/export_info_getter.rs (12), exports/export_info_setter.rs (9). The bar is 30 methods; this is 26 over it, 1.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OutputOptionsBuilder crates/rspack/src/builder/mod.rs:2175— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LoaderContext crates/rspack_loader_runner/src/context.rs:55— TooManyMethods — 44 methods, declared across 2 files: src/context.rs (42), src/runner.rs (2). The bar is 30 methods; this is 14 over it, 1.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Stats crates/rspack_core/src/stats/mod.rs:125— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CssModuleGenerator crates/rspack_plugin_css/src/parser_and_generator/generator.rs:81— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CodeSplitter crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:377— TooManyMethods — 39 methods, declared across 2 files: build_chunk_graph/code_splitter.rs (30), build_chunk_graph/incremental.rs (9). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EsmLibraryPlugin crates/rspack_plugin_esm_library/src/plugin.rs:73— TooManyMethods — 38 methods, declared across 3 files: src/link.rs (30), src/render.rs (6), src/plugin.rs (2). The bar is 30 methods; this is 8 over it, 1.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Compilation packages/rspack/src/Compilation.ts:283— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScopeInfoDB crates/rspack_plugin_javascript/src/visitors/scope_info.rs:117— TooManyMethods — 36 methods, declared across 2 files: visitors/scope_info.rs (21), scope_info/semantic.rs (15). The bar is 30 methods; this is 6 over it, 1.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ModuleCodeTemplate crates/rspack_core/src/runtime_template.rs:848— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PathManager crates/rspack_watcher/src/paths.rs:280— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ExportsInfoData crates/rspack_core/src/exports/exports_info.rs:35— TooManyMethods — 34 methods, declared across 4 files: exports/exports_info_getter.rs (13), exports/exports_info.rs (10), exports/exports_info_setter.rs (9), exports/export_info.rs (2). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CompilerBuilder crates/rspack/src/builder/mod.rs:109— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RuntimeTemplate packages/rspack/src/RuntimeTemplate.ts:125— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (7 lines × 2) crates/rspack_binding_api/src/fs_node/write.rs:197— crates/rspack_binding_api/src/fs_node/write.rs:197-203 | crates/rspack_binding_api/src/fs_node/write.rs:220-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/rspack_binding_api/src/fs_node/write.rs:197` it begins part-way through the construct above it, so those exact lines 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/rspack_binding_api/src/fs_node/write.rs:237— crates/rspack_binding_api/src/fs_node/write.rs:237-243 | crates/rspack_binding_api/src/fs_node/write.rs:254-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/fs_node/write.rs:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/rspack_binding_api/src/fs_node/write.rs:317— crates/rspack_binding_api/src/fs_node/write.rs:317-323 | crates/rspack_binding_api/src/fs_node/write.rs:416-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/fs_node/write.rs:317` it begins part-way through the construct above it, so those exact lines 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/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:352— crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:352-358 | crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:785-791 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:352` it begins part-way through the construct above it, so those exact lines 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/rspack_core/src/chunk.rs:557— crates/rspack_core/src/chunk.rs:557-563 | crates/rspack_core/src/chunk.rs:632-638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/rspack_core/src/options/resolve/clever_merge.rs:483— crates/rspack_core/src/options/resolve/clever_merge.rs:483-489 | crates/rspack_core/src/options/resolve/clever_merge.rs:497-503 — both copies are in the same file, so extract the block into 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/rspack_ids/src/named_chunk_ids_plugin.rs:191— crates/rspack_ids/src/named_chunk_ids_plugin.rs:191-197 | crates/rspack_ids/src/named_module_ids_plugin.rs:166-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_ids/src/named_chunk_ids_plugin.rs:191` it does not close everything it opens, so those exact lines 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/rspack_napi/src/threadsafe_function.rs:264— crates/rspack_napi/src/threadsafe_function.rs:264-270 | crates/rspack_napi/src/threadsafe_function.rs:288-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/rspack_napi/src/threadsafe_function.rs:264` 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/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1469— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1469-1475 | crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1518-1524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs:304— crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs:304-310 | crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs:354-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs:304` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:681— crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:681-687 | crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:692-698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:681` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:227— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:227-233 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:278-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/rspack_plugin_library/src/assign_library_plugin.rs:153— crates/rspack_plugin_library/src/assign_library_plugin.rs:153-159 | crates/rspack_plugin_library/src/umd_library_plugin.rs:378-384 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_library/src/assign_library_plugin.rs:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/rspack_plugin_mf/src/manifest/mod.rs:422— crates/rspack_plugin_mf/src/manifest/mod.rs:422-428 | crates/rspack_plugin_mf/src/manifest/mod.rs:482-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_mf/src/manifest/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.
Duplicated block (7 lines × 2) crates/rspack_plugin_rstest/src/plugin.rs:390— crates/rspack_plugin_rstest/src/plugin.rs:390-396 | crates/rspack_plugin_rstest/src/plugin.rs:408-414 — both copies are in the same file, so extract the block into 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/rspack_plugin_runtime/src/common_js_chunk_format.rs:134— crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:134-140 | crates/rspack_plugin_runtime/src/module_chunk_format.rs:154-160 — before extracting anything, compare `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs` and `crates/rspack_plugin_runtime/src/module_chunk_format.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:134` it does not close everything it opens, so those 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/rspack_plugin_runtime/src/module_chunk_format.rs:150` calls `create_chunk_code_template`, `json_stringify`, `expect_id` and `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:133` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/rspack_napi/src/threadsafe_function.rs:161— crates/rspack_napi/src/threadsafe_function.rs:161-167 | crates/rspack_napi/src/threadsafe_function.rs:200-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. 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/rspack/src/builder/target.rs:295— crates/rspack/src/builder/target.rs:295-301 | crates/rspack/src/builder/target.rs:449-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack/src/builder/target.rs:295` it begins part-way through the construct above it, so those 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/rspack/src/builder/target.rs:293` calls `Some`, `version_dependent` and `crates/rspack/src/builder/target.rs:448` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2064— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2064-2070 | crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:400-406 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2064` 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/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:226— crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:226-232 | crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:315-321 — before extracting anything, compare `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:226` it begins part-way through the construct above it, so those exact lines 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/css-module-lexer/src/dependencies.rs:4324— crates/css-module-lexer/src/dependencies.rs:4324-4330 | crates/css-module-lexer/src/dependencies.rs:4365-4371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:4324` it does not close everything it opens, so those exact lines 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/rspack_storage/src/filesystem/db/bucket/pack/mod.rs:52— crates/rspack_storage/src/filesystem/db/bucket/pack/mod.rs:52-58 | crates/rspack_storage/src/filesystem/db/bucket/pack/mod.rs:61-67 — both copies are in the same file, so extract the block into 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/rspack_fs/src/native_fs.rs:158— crates/rspack_fs/src/native_fs.rs:158-164 | crates/rspack_fs/src/native_fs.rs:172-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_fs/src/native_fs.rs:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/rspack_binding_api/src/fs_node/write.rs:337— crates/rspack_binding_api/src/fs_node/write.rs:337-346 | crates/rspack_binding_api/src/fs_node/write.rs:376-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/rspack_binding_api/src/fs_node/write.rs:337` it begins part-way through the construct above it, so those exact lines 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/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:685— crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:685-694 | crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs:698-707 — both copies are in the same file, so extract the block into 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/rspack_core/src/chunk.rs:412— crates/rspack_core/src/chunk.rs:412-421 | crates/rspack_core/src/chunk.rs:456-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/chunk.rs:412` it does not close everything it opens, so those 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/rspack_core/src/chunk.rs:467` calls `is_initial` and `crates/rspack_core/src/chunk.rs:423` 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/rspack_core/src/normal_module_factory.rs:49— crates/rspack_core/src/normal_module_factory.rs:49-58 | crates/rspack_core/src/normal_module_factory.rs:77-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/normal_module_factory.rs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/rspack_core/src/stats/utils.rs:255— crates/rspack_core/src/stats/utils.rs:255-264 | crates/rspack_core/src/stats/utils.rs:267-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/utils.rs:255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/rspack_loader_swc/src/rsc_transforms/cjs_finder.rs:83— crates/rspack_loader_swc/src/rsc_transforms/cjs_finder.rs:83-92 | crates/rspack_loader_swc/src/rsc_transforms/cjs_finder.rs:124-133 — both copies are in the same file, so extract the 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 `&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 (10 lines × 2) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:382— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:382-391 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:547-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2229— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2229-2238 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2291-2300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2229` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/dependency/context/import_meta_context_dependency.rs:189— crates/rspack_plugin_javascript/src/dependency/context/import_meta_context_dependency.rs:189-198 | crates/rspack_plugin_javascript/src/dependency/context/require_context_dependency.rs:137-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_javascript/src/dependency/context/import_meta_context_dependency.rs:189` 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:602— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:602-611 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:702-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:602` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:357— crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:357-366 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:433-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:357` it does not close everything it opens, so those 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:356` calls `callee` and `crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:432` 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/rspack_plugin_javascript/src/plugin/mod.rs:792— crates/rspack_plugin_javascript/src/plugin/mod.rs:792-801 | crates/rspack_plugin_javascript/src/plugin/mod.rs:1346-1355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/mod.rs:792` it does not close everything it opens, so those exact lines 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/rspack_plugin_mf/src/manifest/mod.rs:430— crates/rspack_plugin_mf/src/manifest/mod.rs:430-439 | crates/rspack_plugin_mf/src/manifest/mod.rs:461-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 (10 lines × 2) crates/rspack_plugin_library/src/amd_library_plugin.rs:202— crates/rspack_plugin_library/src/amd_library_plugin.rs:202-211 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:133-142 — before extracting anything, compare `crates/rspack_plugin_library/src/amd_library_plugin.rs` and `crates/rspack_plugin_library/src/jsonp_library_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_library/src/amd_library_plugin.rs:202` it begins part-way through the construct above it, so those exact lines 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/rspack_core/src/artifacts/cgm_hash_artifact.rs:38— crates/rspack_core/src/artifacts/cgm_hash_artifact.rs:38-47 | crates/rspack_core/src/artifacts/chunk_hashes_artifact.rs:23-32 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/artifacts/cgm_hash_artifact.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `hashes` to `RuntimeSpecMap<RspackHashDigest>` in one and `ChunkHashesResult` 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/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1152— crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1152-1161 | crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1186-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) crates/css-module-lexer/src/dependencies.rs:1068— crates/css-module-lexer/src/dependencies.rs:1068-1077 | crates/css-module-lexer/src/dependencies.rs:1143-1154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:1068` it does not close everything it opens, so those exact lines 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/rspack/src/builder/mod.rs:1405— crates/rspack/src/builder/mod.rs:1405-1414 | crates/rspack/src/builder/mod.rs:1417-1426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack/src/builder/mod.rs:1405` it begins part-way through the construct above it, so those exact lines 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/rspack_binding_api/src/lib.rs:474— crates/rspack_binding_api/src/lib.rs:474-483 | crates/rspack_binding_api/src/lib.rs:510-519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/lib.rs:474` it begins part-way through the construct above it, so those exact lines 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/css-module-lexer/src/dependencies.rs:2948— crates/css-module-lexer/src/dependencies.rs:2948-2957 | crates/css-module-lexer/src/dependencies.rs:3000-3009 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2948` 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/rspack_plugin_library/src/lib.rs:77— crates/rspack_plugin_library/src/lib.rs:77-86 | crates/rspack_plugin_library/src/lib.rs:87-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_library/src/lib.rs:77` 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.
rspack_plugin_javascript::parser_plugin::side_effects_analysis::may_have_side_effects (cyclomatic 46) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_analysis.rs:56— rspack_plugin_javascript::parser_plugin::side_effects_analysis::may_have_side_effects has cyclomatic complexity 46 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_const_operation (cyclomatic 39) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:444— rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_const_operation has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
rspack_plugin_javascript::magic_comment::analyze_raw_comments (cyclomatic 35) crates/rspack_plugin_javascript/src/magic_comment.rs:610— rspack_plugin_javascript::magic_comment::analyze_raw_comments has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::runtime_context::render_runtime_chunk_runtime_modules_sync (cyclomatic 34) crates/rspack_plugin_javascript/src/runtime_context.rs:198— rspack_plugin_javascript::runtime_context::render_runtime_chunk_runtime_modules_sync has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_add (cyclomatic 29) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:298— rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_add has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_get_linking_error (cyclomatic 27) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:279— rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_get_linking_error has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::collect_pure_annotations (cyclomatic 24) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:177— rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::collect_pure_annotations has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::parser_plugin::const::if_stmt::get_hoisted_declarations (cyclomatic 23) crates/rspack_plugin_javascript/src/parser_plugin/const/if_stmt.rs:60— rspack_plugin_javascript::parser_plugin::const::if_stmt::get_hoisted_declarations has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::visitors::dependency::context_dependency_helper::create_context_dependency (cyclomatic 23) crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:24— rspack_plugin_javascript::visitors::dependency::context_dependency_helper::create_context_dependency has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::runtime::render_module (cyclomatic 21) crates/rspack_plugin_javascript/src/runtime.rs:174— rspack_plugin_javascript::runtime::render_module has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::utils::eval::eval_unary_expr::eval_typeof (cyclomatic 20) crates/rspack_plugin_javascript/src/utils/eval/eval_unary_expr.rs:10— rspack_plugin_javascript::utils::eval::eval_unary_expr::eval_typeof has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_javascript::plugin::side_effects_flag_plugin::optimize_dependencies (cyclomatic 18) crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs:334— rspack_plugin_javascript::plugin::side_effects_flag_plugin::optimize_dependencies has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::runtime::render_runtime_module_sources (cyclomatic 18) crates/rspack_plugin_javascript/src/runtime.rs:482— rspack_plugin_javascript::runtime::render_runtime_module_sources has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_javascript::runtime_context::render_hot_update_chunk_runtime_modules (cyclomatic 18) crates/rspack_plugin_javascript/src/runtime_context.rs:506— rspack_plugin_javascript::runtime_context::render_hot_update_chunk_runtime_modules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_apply (cyclomatic 17) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:115— rspack_plugin_javascript::dependency::esm::esm_import_dependency::esm_import_dependency_apply has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::is_pure_expression (cyclomatic 17) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:799— rspack_plugin_javascript::parser_plugin::side_effects_parser_plugin::is_pure_expression has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_strict_equality_comparison (cyclomatic 17) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:77— rspack_plugin_javascript::utils::eval::eval_binary_expr::handle_strict_equality_comparison has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
rspack_plugin_javascript::dependency::branch_guard::is_dependency_export_presence_guarded (cyclomatic 16) crates/rspack_plugin_javascript/src/dependency/branch_guard.rs:35— rspack_plugin_javascript::dependency::branch_guard::is_dependency_export_presence_guarded has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (implies_export_presence, dependency_guards_export_presence). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
rspack_plugin_javascript::parser_plugin::common_js_imports_parse_plugin::evaluate_create_require_argument (cyclomatic 16) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:484— rspack_plugin_javascript::parser_plugin::common_js_imports_parse_plugin::evaluate_create_require_argument has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_javascript::plugin::flag_dependency_usage_plugin::process_referenced_module_without_nested (cyclomatic 16) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:774— rspack_plugin_javascript::plugin::flag_dependency_usage_plugin::process_referenced_module_without_nested has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Repeated repair: tests/rspack-test/cacheTestOptions.mjs tests/rspack-test/cacheTestOptions.mjs:157— tests/rspack-test/cacheTestOptions.mjs changed 18 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is getCacheTestOptions at line 157), 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(cache): cache module-not-found resolution results (#16560)”; “fix: finalize finishMake module rebuilds and artifacts (#16580)”; “fix(cache): snapshot invalid Windows missing paths (#16584)”; “fix(cache): reuse loader output after a caught import cycle (#16583)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- tests/rspack-test/cacheTestOptions.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/rspack/src/Compiler.ts packages/rspack/src/Compiler.ts:457— packages/rspack/src/Compiler.ts changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is Compiler.getInfrastructureLogger at line 457), 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(cache): share loader cache across modes and SSR compilers (#16558)”; “fix(types): allow omitting child compiler plugins (#15948)”; “fix(types): accept falsy loaders and child compiler plugins (#15912)”; “fix(types): allow shouldEmit hooks to return void (#15881)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/Compiler.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/rspack_binding_api/src/plugins/js_loader/scheduler.rs crates/rspack_binding_api/src/plugins/js_loader/scheduler.rs:76— crates/rspack_binding_api/src/plugins/js_loader/scheduler.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is rspack_binding_api::plugins::js_loader::scheduler::merge_loader_context at line 76), 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(core): distinguish fatal module errors from loader diagnostics (#16538)”; “fix(loader): revert native loader hook invocation (#15719)”; “fix(loader): preserve string BOM across native boundaries (#15632)”; “fix(loader): invoke loader hooks through the native hook (#15591)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_binding_api/src/plugins/js_loader/scheduler.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/rspack_binding_api/src/plugins/js_hooks_plugin.rs crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs:84— crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is JsHooksAdapterPlugin::fmt at line 84), 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(loader): revert native loader hook invocation (#15719)”; “fix: revert "feat(core): expose NormalModule beforeLoaders hook to JS" (#15660)”; “fix(loader): invoke loader hooks through the native hook (#15591)”; “fix: revert afterOptimizeChunkIds and renderContent hooks (#15471)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_binding_api/src/plugins/js_hooks_plugin.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/rspack_core/src/compilation/build_module_graph/pass.rs crates/rspack_core/src/compilation/build_module_graph/pass.rs:81— crates/rspack_core/src/compilation/build_module_graph/pass.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is rspack_core::compilation::build_module_graph::pass::run_build_module_graph_phase 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: finalize finishMake module rebuilds and artifacts (#16580)”; “fix(cache): share loader cache across modes and SSR compilers (#16558)”; “fix: isolate module build cache sessions by graph (#16540)”; “fix(core): decouple incremental artifacts from cache! (#15229)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_core/src/compilation/build_module_graph/pass.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/rspack_watcher/src/executor.rs crates/rspack_watcher/src/executor.rs:156— crates/rspack_watcher/src/executor.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 10 (its worst body is Executor::wait_for_execute at line 156), 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(watcher): preserve concrete paths in native watcher events (#16411)”; “fix(watcher): wait for aggregateTimeout after the last change (#16304)”; “fix(watcher): preserve native event delivery while JavaScript is blocked (#16106)”; “fix(watcher): report recreated files by their final state (#16040)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_watcher/src/executor.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/rspack/src/config/adapterRuleUse.ts packages/rspack/src/config/adapterRuleUse.ts:589— packages/rspack/src/config/adapterRuleUse.ts 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 15 (its worst body is adapterRuleUse.resolveStringifyLoaders at line 589), 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!: rename loader filter.code to codeFilter (#16184)”; “fix(types): accept falsy loaders and child compiler plugins (#15912)”; “fix(loader): normalize builtin options for inline requests (#15909)”; “fix(types): improve loader context filesystem types (#15437)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/config/adapterRuleUse.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/rspack_core/src/compilation/build_module_graph/module_executor/mod.rs crates/rspack_core/src/compilation/build_module_graph/module_executor/mod.rs:268— crates/rspack_core/src/compilation/build_module_graph/module_executor/mod.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is ModuleExecutor::import_module at line 268), 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: finalize finishMake module rebuilds and artifacts (#16580)”; “fix(cache): reuse loader output after a caught import cycle (#16583)”; “fix: isolate module build cache sessions by graph (#16540)”; “fix: preserve diagnostics returned by importModule (#15496)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_core/src/compilation/build_module_graph/module_executor/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/rspack_ids/src/compact_hashed_chunk_ids_plugin.rs crates/rspack_ids/src/compact_hashed_chunk_ids_plugin.rs:49— crates/rspack_ids/src/compact_hashed_chunk_ids_plugin.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is rspack_ids::compact_hashed_chunk_ids_plugin::chunk_ids at line 49), 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(ids): rehash identical keys in compact-hashed ids (#15915)”; “fix: avoid chunk name collisions in compact hashed ids (#15693)”; “fix(esm): remove empty chunks except for facade chunks (#15424)”; “fix(ids): correct compact hashed API names (#15356)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_ids/src/compact_hashed_chunk_ids_plugin.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/rspack/src/util/fs.ts packages/rspack/src/util/fs.ts:590— packages/rspack/src/util/fs.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is fs.rmrf at line 590), 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(watcher): preserve concrete paths in native watcher events (#16411)”; “fix(types): allow Node fs as intermediate file system (#15895)”; “fix(types): allow optionless filesystem sync calls (#15438)”; “fix(types): improve loader context filesystem types (#15437)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- packages/rspack/src/util/fs.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/rspack_core/src/compilation/build_module_graph/graph_updater/mod.rs crates/rspack_core/src/compilation/build_module_graph/graph_updater/mod.rs:17— crates/rspack_core/src/compilation/build_module_graph/graph_updater/mod.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is rspack_core::compilation::build_module_graph::graph_updater::expand_rebuild_modules at line 17), 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: finalize finishMake module rebuilds and artifacts (#16580)”; “fix(cache): share loader cache across modes and SSR compilers (#16558)”; “fix(core): align module need_build and FileSystemInfo with webpack (#15374)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_core/src/compilation/build_module_graph/graph_updater/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/rspack_loader_lightningcss/src/lib.rs crates/rspack_loader_lightningcss/src/lib.rs:100— crates/rspack_loader_lightningcss/src/lib.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is LightningCssLoader::loader_impl 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: “fix(lightningcss-loader): preserve parser flags during stylesheet conversion (#16378)”; “fix(sources): preserve missing source contents as null (#16366)”; “fix(deps): upgrade lightningcss to 1.0.0-alpha.72 (#15991)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_loader_lightningcss/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/rspack_watcher/src/disk_watcher.rs crates/rspack_watcher/src/disk_watcher.rs:118— crates/rspack_watcher/src/disk_watcher.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is rspack_watcher::disk_watcher::handle_event at line 118), 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(watcher): align rename events with watchpack (#16460)”; “fix(watcher): keep watching when unwatching a stale path fails (#16199)”; “fix(watcher): report watched files inside directories that appear (#15966)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_watcher/src/disk_watcher.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/rspack_binding_api/src/raw_options/raw_split_chunks/mod.rs crates/rspack_binding_api/src/raw_options/raw_split_chunks/mod.rs:123— crates/rspack_binding_api/src/raw_options/raw_split_chunks/mod.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is RawSplitChunksOptions::normalize at line 123), 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 "fix: inherit splitChunks request limits in cache group" (#16273)”; “fix: inherit splitChunks request limits in cache groups (#16191)”; “fix(split-chunks): support minRemainingSize (#15594)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_binding_api/src/raw_options/raw_split_chunks/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/rspack_plugin_css/src/dependency/import.rs crates/rspack_plugin_css/src/dependency/import.rs:132— crates/rspack_plugin_css/src/dependency/import.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is rspack_plugin_css::dependency::import::create_resource_identifier at line 132), 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(css): calculate CSS module hashes from graph dependencies (#16120)”; “fix(css): align CSS Modules behavior with webpack css-loader fixtures (#15816)”; “fix: preserve css-import external conditions (#15522)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_css/src/dependency/import.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/rspack_napi/src/threadsafe_function.rs crates/rspack_napi/src/threadsafe_function.rs:286— crates/rspack_napi/src/threadsafe_function.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 3 (its worst body is ThreadsafeFunction::call_with_promise at line 286), 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(binding): preserve worker callback ownership and native module lifetime (#16318)”; “fix(release): synchronize workspace versions and CLI peer dependencies (#16181)”; “fix(binding): release transient TSFN callbacks (#15938)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_napi/src/threadsafe_function.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/css-module-lexer/src/dependency_types.rs crates/css-module-lexer/src/dependency_types.rs:686— crates/css-module-lexer/src/dependency_types.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 12 (its worst body is Warning::fmt at line 686), 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(css): localize type-first nested selectors (#16011)”; “fix(css): align CSS Modules behavior with webpack css-loader fixtures (#15816)”; “fix(css): CSS module dashed identifier and composes edge cases (#15223)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/css-module-lexer/src/dependency_types.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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:248— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.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 11 (its worst body is ReadFileChunkLoadingRuntimeModule::generate at line 248), 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(hmr): complete new entry chunk dependencies (#15955)”; “fix(hmr): validate chunk versions before installation (#16360)”; “fix(HMR): correct hot updated chunk path resolution in Node.js HMR (#16174)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.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/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:259— crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.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 11 (its worst body is RequireChunkLoadingRuntimeModule::generate at line 259), 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(hmr): complete new entry chunk dependencies (#15955)”; “fix(hmr): validate chunk versions before installation (#16360)”; “fix(HMR): correct hot updated chunk path resolution in Node.js HMR (#16174)”. 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 10:00:01 +00:00' --until='2026-11-14 10:00:01 +00:00' --full-history --no-merges -- crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.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.
FixmeComment packages/rspack/src/trace/traceHookPlugin.ts:176— // FIXME: we need a compiler.id for track child compiler — 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/rspack_plugin_schemes/src/http_uri/mod.rs:341— // FIXME: add more test cases — 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/rspack_plugin_lightning_css_minimizer/src/lib.rs:186— // FIXME: Disable the warnings for now, cause it cause too much positive-negative warnings, — 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/rspack_loader_lightningcss/src/lib.rs:142— // FIXME: Disable the warnings for now, cause it cause too much positive-negative warnings, — 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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1276— // FIXME: remove `.clone` — 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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1795— // FIXME: should mv it to plugin(for example `parse.hooks.evaluate for`) — 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/rspack_plugin_javascript/src/utils/eval/mod.rs:379— // FIXME: maybe we can use std::ptr::eq — 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/rspack_plugin_javascript/src/parser_plugin/require_context_dependency_parser_plugin.rs:45— // FIXME: return `None` in webpack — 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/rspack_plugin_javascript/src/parser_plugin/require_context_dependency_parser_plugin.rs:73— // FIXME: return `None` in webpack — 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/rspack_plugin_javascript/src/parser_plugin/require_context_dependency_parser_plugin.rs:87— // FIXME: return `None` in webpack — 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/rspack_plugin_javascript/src/parser_plugin/provide_plugin/parser.rs:80— // FIXME: webpack use `walk_expression` here — 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/rspack_core/src/context_module_factory.rs:558— // FIXME: nodejs resolver return path of context, sometimes is '/a/b', sometimes is '/a/b/' — 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/rspack_core/src/options/resolve/clever_merge.rs:190— // FIXME: not use clone — 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/rspack_core/src/exports/referenced_export.rs:170— // FIXME: more branch — 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/rspack_core/src/compilation/mod.rs:425— // FIXME: this should be removed in future — 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/rspack_core/src/compilation/build_module_graph/graph_updater/repair/process_dependencies.rs:44— // FIXME: now only module/context dependency can put into resolve queue. — 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/rspack_core/src/compilation/build_module_graph/graph_updater/repair/process_dependencies.rs:45— // FIXME: should align webpack — 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/rspack_binding_api/src/raw_options/raw_split_chunks/raw_split_chunk_name.rs:161— // FIXME: when set bool is true? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (6 lines × 2) crates/rspack_binding_api/src/compilation/mod.rs:914— crates/rspack_binding_api/src/compilation/mod.rs:914-919 | crates/rspack_binding_api/src/compilation/mod.rs:1017-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/rspack_binding_api/src/compilation/mod.rs:914` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack_binding_api/src/compilation/mod.rs:913` calls `within_compiler_context_sync`, `clone` and `crates/rspack_binding_api/src/compilation/mod.rs:1015` 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/rspack_binding_api/src/exports_info.rs:44— crates/rspack_binding_api/src/exports_info.rs:44-49 | crates/rspack_binding_api/src/exports_info.rs:60-65 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/exports_info.rs:44` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crates/rspack_binding_api/src/file_system_dependency_strings.rs:20— crates/rspack_binding_api/src/file_system_dependency_strings.rs:20-25 | crates/rspack_binding_api/src/lib.rs:172-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/file_system_dependency_strings.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 (6 lines × 2) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:935— crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:935-940 | crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:976-981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:935` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1669— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1669-1674 | crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:403-410 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1669` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:214— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:214-219 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:265-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 `crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:214` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:566— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:566-571 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:603-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:566` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_library/src/export_property_library_plugin.rs:64— crates/rspack_plugin_library/src/export_property_library_plugin.rs:64-69 | crates/rspack_plugin_library/src/module_library_plugin.rs:50-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (6 lines × 2) crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:29— crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:29-34 | crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:159— crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:159-164 | crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:1138-1144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:1138` it does not close everything it opens, so those exact lines 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/rspack_tracing/src/perfetto.rs:96— crates/rspack_tracing/src/perfetto.rs:96-101 | crates/rspack_tracing/src/perfetto.rs:152-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/rspack_watcher/src/scanner.rs:48— crates/rspack_watcher/src/scanner.rs:48-53 | crates/rspack_watcher/src/scanner.rs:80-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_watcher/src/scanner.rs:48` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/hot_module_replacement_plugin.rs:66— crates/rspack_plugin_javascript/src/parser_plugin/hot_module_replacement_plugin.rs:66-71 | crates/rspack_plugin_javascript/src/parser_plugin/hot_module_replacement_plugin.rs:106-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/hot_module_replacement_plugin.rs:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/rspack_core/src/options/snapshot.rs:13— crates/rspack_core/src/options/snapshot.rs:13-18 | crates/rspack_util/src/asset_condition.rs:10-15 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/rspack_plugin_library/src/amd_library_plugin.rs:66— crates/rspack_plugin_library/src/amd_library_plugin.rs:66-71 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:49-54 — before extracting anything, compare `crates/rspack_plugin_library/src/amd_library_plugin.rs` and `crates/rspack_plugin_library/src/jsonp_library_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_library/src/amd_library_plugin.rs:66` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_runtime/src/runtime_plugin.rs:111— crates/rspack_plugin_runtime/src/runtime_plugin.rs:111-116 | crates/rspack_plugin_swc_js_minimizer/src/lib.rs:204-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_runtime/src/runtime_plugin.rs:111` it begins part-way through the construct above it, so those exact lines 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/rspack_allocative_derive/src/derive_allocative.rs:29— crates/rspack_allocative_derive/src/derive_allocative.rs:29-34 | crates/rspack_allocative_derive/src/root.rs:15-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/rspack_cacheable/src/with/as_tuple2.rs:24— crates/rspack_cacheable/src/with/as_tuple2.rs:24-29 | crates/rspack_cacheable/src/with/as_tuple3.rs:25-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `field` to `&(K, V)` in one and `&(K, V, H)` 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/rspack_cacheable/src/with/as_tuple3.rs:31` calls `mut`, `ptr`, `from_field_unchecked` and `crates/rspack_cacheable/src/with/as_tuple2.rs:30` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/css-module-lexer/src/dependencies.rs:3877— crates/css-module-lexer/src/dependencies.rs:3877-3889 | crates/css-module-lexer/src/dependencies.rs:3902-3914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:3877` 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/css-module-lexer/src/dependencies.rs:4555— crates/css-module-lexer/src/dependencies.rs:4555-4567 | crates/css-module-lexer/src/dependencies.rs:4596-4608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) crates/rspack_allocative/src/impls/rspack.rs:58— crates/rspack_allocative/src/impls/rspack.rs:58-70 | crates/rspack_allocative/src/impls/rspack.rs:184-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_allocative/src/impls/rspack.rs:58` 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/rspack_core/src/concatenated_module.rs:898— crates/rspack_core/src/concatenated_module.rs:898-910 | crates/rspack_core/src/concatenated_module.rs:1723-1735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/rspack_core/src/context_module_factory.rs:362— crates/rspack_core/src/context_module_factory.rs:362-374 | crates/rspack_core/src/context_module_factory.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/rspack_core/src/context_module_factory.rs:362` 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/rspack_core/src/options/module.rs:1546— crates/rspack_core/src/options/module.rs:1546-1558 | crates/rspack_core/src/utils/module_rules.rs:286-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_core/src/options/module.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.
Duplicated block (13 lines × 2) crates/rspack_plugin_css/src/runtime/mod.rs:183— crates/rspack_plugin_css/src/runtime/mod.rs:183-195 | crates/rspack_plugin_extract_css/src/runtime.rs:198-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_css/src/runtime/mod.rs:183` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_esm_library/src/split_chunks.rs:102— crates/rspack_plugin_esm_library/src/split_chunks.rs:102-114 | crates/rspack_plugin_split_chunks/src/module_group.rs:265-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_esm_library/src/split_chunks.rs:102` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/magic_comment.rs:686— crates/rspack_plugin_javascript/src/magic_comment.rs:686-698 | crates/rspack_plugin_javascript/src/magic_comment.rs:700-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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/rspack_plugin_javascript/src/utils/mangle_exports.rs:15— crates/rspack_plugin_javascript/src/utils/mangle_exports.rs:15-28 | crates/rspack_plugin_javascript/src/utils/mangle_exports.rs:45-57 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) crates/rspack_plugin_mf/src/container/container_entry_module.rs:66— crates/rspack_plugin_mf/src/container/container_entry_module.rs:66-78 | crates/rspack_plugin_rsc/src/rsc_entry_module.rs:84-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_rstest/src/parser_plugin.rs:414— crates/rspack_plugin_rstest/src/parser_plugin.rs:414-426 | crates/rspack_plugin_rstest/src/parser_plugin.rs:486-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_rstest/src/parser_plugin.rs:414` it does not close everything it opens, so those exact lines 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/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs:50— crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs:50-62 | crates/rspack_plugin_runtime/src/runtime_module/utils.rs:114-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs:50` it does not close everything it opens, so those exact lines 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/rspack_plugin_runtime/src/runtime_module/make_deferred_namespace_object_runtime.rs:40— crates/rspack_plugin_runtime/src/runtime_module/make_deferred_namespace_object_runtime.rs:40-52 | crates/rspack_plugin_runtime/src/runtime_module/make_optimized_deferred_namespace_object_runtime.rs:40-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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/rspack_plugin_runtime/src/runtime_module/create_script.rs:25— crates/rspack_plugin_runtime/src/runtime_module/create_script.rs:25-37 | crates/rspack_plugin_runtime/src/runtime_module/create_script_url.rs:25-37 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/create_script.rs` and `crates/rspack_plugin_runtime/src/runtime_module/create_script_url.rs` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_runtime/src/runtime_module/create_script.rs:25` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:310— crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:310-323 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:454-466 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.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. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:310` 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/rspack_core/src/runtime_template.rs:550— crates/rspack_core/src/runtime_template.rs:550-562 | crates/rspack_core/src/runtime_template.rs:575-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/runtime_template.rs:550` it does not close everything it opens, so those exact lines 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/rspack/src/builder/target.rs:255— crates/rspack/src/builder/target.rs:255-266 | crates/rspack/src/builder/target.rs:413-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack/src/builder/target.rs:255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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/rspack_binding_api/src/lib.rs:190— crates/rspack_binding_api/src/lib.rs:190-201 | crates/rspack_binding_api/src/lib.rs:218-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/lib.rs:190` 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/rspack_binding_api/src/raw_options/raw_external.rs:196— crates/rspack_binding_api/src/raw_options/raw_external.rs:196-207 | crates/rspack_binding_api/src/resolver.rs:92-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_binding_api/src/raw_options/raw_external.rs:196` 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/rspack_binding_api/src/raw_options/raw_module/mod.rs:637— crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:637-648 | crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:678-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:637` it does not close everything it opens, so those 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 `RawCssModuleParserOptions` in one and `RawCssAutoOrModuleParserOptions` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/rspack_javascript_compiler/src/compiler/parse.rs:150— crates/rspack_javascript_compiler/src/compiler/parse.rs:150-161 | crates/rspack_loader_swc/src/lib.rs:321-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_javascript_compiler/src/compiler/parse.rs:150` 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/rspack_loader_swc/src/rsc_transforms/server_actions.rs:707— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:707-718 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:721-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:45— crates/rspack_plugin_esm_library/src/optimize_chunks.rs:45-56 | crates/rspack_plugin_esm_library/src/optimize_chunks.rs:576-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_esm_library/src/optimize_chunks.rs:45` it begins part-way through the construct above it, so those 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/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:195— crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:195-206 | crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_self_reference_dependency.rs:164-175 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/rspack_plugin_javascript/src/magic_comment.rs:752— crates/rspack_plugin_javascript/src/magic_comment.rs:752-763 | crates/rspack_plugin_javascript/src/magic_comment.rs:765-776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:205— crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:205-216 | crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:240-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:205` 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/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:465— crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:465-476 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:479-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `stmt` to `ForOfStatement` in one and `ForInStatement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2013— crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2013-2024 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2032-2043 — both copies are in the same file, so extract the block into 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/rspack_core/src/stats/mod.rs:986— crates/rspack_core/src/stats/mod.rs:986-997 | crates/rspack_core/src/stats/mod.rs:1069-1080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/mod.rs:986` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_library/src/assign_library_plugin.rs:510— crates/rspack_plugin_library/src/assign_library_plugin.rs:510-521 | crates/rspack_plugin_library/src/export_property_library_plugin.rs:185-196 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:225— crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:225-236 | crates/rspack_plugin_runtime/src/module_chunk_format.rs:448-459 — before extracting anything, compare `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs` and `crates/rspack_plugin_runtime/src/module_chunk_format.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/rspack_dojang/src/context.rs:403— crates/rspack_dojang/src/context.rs:403-415 | crates/rspack_dojang/src/context.rs:426-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_dojang/src/context.rs:403` it does not close everything it opens, so those exact lines 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/rspack_core/src/artifacts/runtime_proxy_metadata_artifact.rs:79— crates/rspack_core/src/artifacts/runtime_proxy_metadata_artifact.rs:79-90 | crates/rspack_core/src/compilation/build_module_graph/module_executor/execute.rs:77-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
rspack_core::options::resolve::clever_merge::_merge_resolve (cyclomatic 131) crates/rspack_core/src/options/resolve/clever_merge.rs:194— rspack_core::options::resolve::clever_merge::_merge_resolve has cyclomatic complexity 131 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::options::resolve::clever_merge::parse_resolve (cyclomatic 122) crates/rspack_core/src/options/resolve/clever_merge.rs:76— rspack_core::options::resolve::clever_merge::parse_resolve has cyclomatic complexity 122 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::utils::module_rules::module_rule_matcher_async (cyclomatic 49) crates/rspack_core/src/utils/module_rules.rs:304— rspack_core::utils::module_rules::module_rule_matcher_async has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::compilation::create_hash::create_hash (cyclomatic 40) crates/rspack_core/src/compilation/create_hash/mod.rs:34— rspack_core::compilation::create_hash::create_hash has cyclomatic complexity 40 (threshold 15). Of this number, 37 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::utils::module_rules::module_rule_matcher_sync (cyclomatic 38) crates/rspack_core/src/utils/module_rules.rs:149— rspack_core::utils::module_rules::module_rule_matcher_sync has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_core::compilation::runtime_requirements::process_chunks_runtime_requirements (cyclomatic 31) crates/rspack_core/src/compilation/runtime_requirements/mod.rs:297— rspack_core::compilation::runtime_requirements::process_chunks_runtime_requirements has cyclomatic complexity 31 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rspack_core::utils::find_graph_roots::find_graph_roots (cyclomatic 31) crates/rspack_core/src/utils/find_graph_roots.rs:59— rspack_core::utils::find_graph_roots::find_graph_roots has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::utils::compile_boolean_matcher::items_to_regexp (cyclomatic 25) crates/rspack_core/src/utils/compile_boolean_matcher.rs:75— rspack_core::utils::compile_boolean_matcher::items_to_regexp has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_core::context_module::create_identifier (cyclomatic 23) crates/rspack_core/src/context_module.rs:1614— rspack_core::context_module::create_identifier has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_core::module::get_exports_type_impl (cyclomatic 21) crates/rspack_core/src/module.rs:926— rspack_core::module::get_exports_type_impl has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::resolver::resolve_for_error_hints (cyclomatic 21) crates/rspack_core/src/resolver/mod.rs:100— rspack_core::resolver::resolve_for_error_hints has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::runtime_template::runtime_globals_to_render_map (cyclomatic 21) crates/rspack_core/src/runtime_template.rs:418— rspack_core::runtime_template::runtime_globals_to_render_map has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::compilation::build_chunk_graph::code_splitter::extract_block_modules (cyclomatic 18) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:3029— rspack_core::compilation::build_chunk_graph::code_splitter::extract_block_modules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::compilation::create_module_hashes::create_module_hashes_pass_impl (cyclomatic 16) crates/rspack_core/src/compilation/create_module_hashes/mod.rs:23— rspack_core::compilation::create_module_hashes::create_module_hashes_pass_impl has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_core::context_module_factory::visit_dirs (cyclomatic 16) crates/rspack_core/src/context_module_factory.rs:505— rspack_core::context_module_factory::visit_dirs has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_core::stats::utils::get_chunk_relations (cyclomatic 16) crates/rspack_core/src/stats/utils.rs:243— rspack_core::stats::utils::get_chunk_relations has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×16
Edited copy of a member (12 corresponding lines) crates/rspack_plugin_javascript/src/magic_comment.rs:421— crates/rspack_plugin_javascript/src/magic_comment.rs:421-432 | crates/rspack_plugin_javascript/src/visitors/dependency/util.rs:48-64 — 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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1758— crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1758-1769 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1771-1784 — 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/rspack_loader_preact_refresh/src/lib.rs:39— crates/rspack_loader_preact_refresh/src/lib.rs:39-50 | crates/rspack_loader_react_refresh/src/lib.rs:39-69 — 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/rspack_fs/src/memory_fs.rs:195— crates/rspack_fs/src/memory_fs.rs:195-209 | crates/rspack_fs/src/memory_fs.rs:211-222 — 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/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:191— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:191-202 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:205-218 — 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/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:84— crates/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:84-96 | crates/rspack_core/src/module_graph/rollback/overlay_map.rs:140-151 — 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/rspack_core/src/options/filename.rs:461— crates/rspack_core/src/options/filename.rs:461-472 | crates/rspack_core/src/options/filename.rs:478-493 — 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/rspack_binding_api/src/compilation/mod.rs:626— crates/rspack_binding_api/src/compilation/mod.rs:626-637 | crates/rspack_binding_api/src/compilation/mod.rs:650-663 — 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/rspack_tracing_perfetto/src/lib.rs:447— crates/rspack_tracing_perfetto/src/lib.rs:447-458 | crates/rspack_tracing_perfetto/src/lib.rs:460-472 — 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/rspack_core/src/utils/source_size_cache.rs:62— crates/rspack_core/src/utils/source_size_cache.rs:62-76 | crates/rspack_core/src/utils/source_size_cache.rs:110-121 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/rspack_binding_api/src/stats.rs:1131— crates/rspack_binding_api/src/stats.rs:1131-1142 | crates/rspack_binding_api/src/stats.rs:1144-1155 — 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/rspack_watcher/src/paths.rs:466— crates/rspack_watcher/src/paths.rs:466-482 | crates/rspack_watcher/src/paths.rs:534-545 — 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/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:471— crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:471-482 | crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:492-504 — 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/rspack_core/src/new_cache/snapshot/file_system_info.rs:1017— crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:1017-1028 | crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:1034-1045 — 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/rspack_plugin_rslib/src/url_external.rs:14— crates/rspack_plugin_rslib/src/url_external.rs:14-32 | crates/rspack_plugin_rslib/src/worker_external.rs:13-24 — 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/rspack_binding_api/src/module_graph.rs:50— crates/rspack_binding_api/src/module_graph.rs:50-61 | crates/rspack_binding_api/src/module_graph.rs:173-185 — 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.
LexDependencies::lex_streaming_inner (cognitive 90) crates/css-module-lexer/src/dependencies.rs:1576— LexDependencies::lex_streaming_inner has cognitive complexity 90 (threshold 15). Drivers by points: if/else 27 (62 pts), boolean chains 23, match/switch 2 (4 pts), loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_ident (cognitive 84) crates/css-module-lexer/src/dependencies.rs:4126— LexDependencies::handle_ident has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (70 pts), boolean chains 13, match/switch 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LexDependencies::lex_composes (cognitive 71) crates/css-module-lexer/src/dependencies.rs:3202— LexDependencies::lex_composes has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (64 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::lex_value_at_rule (cognitive 37) crates/css-module-lexer/src/dependencies.rs:2510— LexDependencies::lex_value_at_rule has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_function (cognitive 29) crates/css-module-lexer/src/dependencies.rs:3955— LexDependencies::handle_function has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 8 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::lex_local_function_decl (cognitive 27) crates/css-module-lexer/src/dependencies.rs:3044— LexDependencies::lex_local_function_decl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LexDependencies::handle_string (cognitive 26) crates/css-module-lexer/src/dependencies.rs:3527— LexDependencies::handle_string has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, match/switch 3 (4 pts), loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_at_keyword (cognitive 23) crates/css-module-lexer/src/dependencies.rs:3628— LexDependencies::handle_at_keyword has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_semicolon (cognitive 23) crates/css-module-lexer/src/dependencies.rs:3825— LexDependencies::handle_semicolon has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LexDependencies::lex_local_keyframes_decl (cognitive 22) crates/css-module-lexer/src/dependencies.rs:2845— LexDependencies::lex_local_keyframes_decl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_right_parenthesis (cognitive 22) crates/css-module-lexer/src/dependencies.rs:4049— LexDependencies::handle_right_parenthesis has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_left_curly_bracket (cognitive 22) crates/css-module-lexer/src/dependencies.rs:4398— LexDependencies::handle_left_curly_bracket has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::classify_property (cognitive 18) crates/css-module-lexer/src/dependencies.rs:2174— LexDependencies::classify_property has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LexDependencies::handle_pseudo_class (cognitive 18) crates/css-module-lexer/src/dependencies.rs:4585— LexDependencies::handle_pseudo_class has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexDependencies::handle_recovery_boundary (cognitive 17) crates/css-module-lexer/src/dependencies.rs:3758— LexDependencies::handle_recovery_boundary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (14 lines × 2) crates/css-module-lexer/src/css_syntax.rs:91— crates/css-module-lexer/src/css_syntax.rs:91-104 | crates/css-module-lexer/src/css_syntax.rs:145-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/css-module-lexer/src/css_syntax.rs:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/css-module-lexer/src/dependencies.rs:2928— crates/css-module-lexer/src/dependencies.rs:2928-2941 | crates/css-module-lexer/src/dependencies.rs:3136-3149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2928` it begins part-way through the construct above it, so those exact lines 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/rspack_binding_api/src/async_dependency_block.rs:35— crates/rspack_binding_api/src/async_dependency_block.rs:35-48 | crates/rspack_binding_api/src/module.rs:331-344 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (14 lines × 2) crates/rspack_core/src/compilation/mod.rs:715— crates/rspack_core/src/compilation/mod.rs:715-728 | crates/rspack_core/src/compilation/mod.rs:764-777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compilation/mod.rs:715` 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/rspack_core/src/runtime_template.rs:1733— crates/rspack_core/src/runtime_template.rs:1733-1746 | crates/rspack_plugin_esm_library/src/dependency/dyn_import.rs:51-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_core/src/runtime_template.rs:1733` it does not close everything it opens, so those exact lines 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/rspack_core/src/stats/mod.rs:1604— crates/rspack_core/src/stats/mod.rs:1604-1618 | crates/rspack_core/src/stats/mod.rs:1720-1733 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/mod.rs:1604` 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/rspack_hash/src/lib.rs:477— crates/rspack_hash/src/lib.rs:477-490 | crates/rspack_hash/src/lib.rs:513-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_hash/src/lib.rs:477` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack_hash/src/lib.rs:475` calls `write` and `crates/rspack_hash/src/lib.rs:511` 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 (14 lines × 2) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:399— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:399-412 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:566-579 — both copies are in the same file, so extract the block into 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/rspack_plugin_css/src/parser_and_generator/generator.rs:1172— crates/rspack_plugin_css/src/parser_and_generator/generator.rs:1172-1185 | crates/rspack_plugin_css/src/parser_and_generator/generator.rs:1267-1280 — both copies are in the same file, so extract the block into 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/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs:225— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs:225-238 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs:279-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/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs:225` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:197— crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:197-210 | crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs:190-203 — before extracting anything, compare `crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs` and `crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/rspack_plugin_javascript/src/runtime_context.rs:439— crates/rspack_plugin_javascript/src/runtime_context.rs:439-452 | crates/rspack_plugin_javascript/src/runtime_context.rs:542-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_javascript/src/runtime_context.rs:453` calls `render_context_field` and `crates/rspack_plugin_javascript/src/runtime_context.rs:556` 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) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:177— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:177-190 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:254-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:177` it does not close everything it opens, so those exact lines 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/rspack_plugin_mf/src/sharing/provide_shared_plugin.rs:294— crates/rspack_plugin_mf/src/sharing/provide_shared_plugin.rs:294-307 | crates/rspack_plugin_mf/src/sharing/provide_shared_plugin.rs:315-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_mf/src/sharing/provide_shared_plugin.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.
Duplicated block (14 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:276— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:276-289 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:287-300 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×14
Edited copy of a member (9 corresponding lines) crates/rspack_core/src/stats/utils.rs:131— crates/rspack_core/src/stats/utils.rs:131-139 | crates/rspack_core/src/utils/mod.rs:113-134 — 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/rspack_binding_api/src/module.rs:66— crates/rspack_binding_api/src/module.rs:66-74 | crates/rspack_binding_api/src/module.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/rspack_regex/src/lib.rs:96— crates/rspack_regex/src/lib.rs:96-104 | crates/rspack_regex/src/lib.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/rspack_binding_api/src/modules/normal_module.rs:76— crates/rspack_binding_api/src/modules/normal_module.rs:76-84 | crates/rspack_binding_api/src/modules/normal_module.rs:112-120 — 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/rspack_napi/src/threadsafe_function.rs:262— crates/rspack_napi/src/threadsafe_function.rs:262-270 | crates/rspack_napi/src/threadsafe_function.rs:286-294 — 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/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:43— crates/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:43-53 | crates/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:56-64 — 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/rspack_fs/src/native_fs.rs:61— crates/rspack_fs/src/native_fs.rs:61-69 | crates/rspack_fs/src/native_fs.rs:113-122 — 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/rspack_core/src/exports/export_info.rs:300— crates/rspack_core/src/exports/export_info.rs:300-308 | crates/rspack_core/src/exports/export_info.rs:310-320 — 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/rspack_binding_api/src/raw_options/mod.rs:164— crates/rspack_binding_api/src/raw_options/mod.rs:164-172 | crates/rspack_binding_api/src/raw_options/mod.rs:216-224 — 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/rspack_plugin_javascript/src/parser_plugin/esm_top_level_this_plugin.rs:18— crates/rspack_plugin_javascript/src/parser_plugin/esm_top_level_this_plugin.rs:18-26 | crates/rspack_plugin_javascript/src/parser_plugin/require_ensure_dependencies_block_parse_plugin.rs:62-70 — 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/rspack_loader_runner/src/loader.rs:274— crates/rspack_loader_runner/src/loader.rs:274-283 | crates/rspack_storage/src/filesystem/db/bucket/index/bloom_filter.rs:15-23 — 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/rspack_core/src/concatenated_module.rs:1797— crates/rspack_core/src/concatenated_module.rs:1797-1808 | crates/rspack_core/src/normal_module.rs:813-821 — 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/rspack_core/src/concatenated_module.rs:1810— crates/rspack_core/src/concatenated_module.rs:1810-1818 | crates/rspack_core/src/normal_module.rs:823-831 — 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/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1601— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1601-1613 | crates/rspack_plugin_rstest/src/parser_plugin.rs:158-166 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (15 lines × 2) crates/rspack/src/builder/mod.rs:2942— crates/rspack/src/builder/mod.rs:2942-2956 | crates/rspack/src/builder/mod.rs:2988-3002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack/src/builder/mod.rs:2942` 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/rspack_binding_api/src/compilation/mod.rs:954— crates/rspack_binding_api/src/compilation/mod.rs:954-968 | crates/rspack_binding_api/src/compilation/mod.rs:1057-1071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/compilation/mod.rs:954` 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/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:457— crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:457-471 | crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:496-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/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/rspack_core/src/resolver/resolver_impl.rs:305— crates/rspack_core/src/resolver/resolver_impl.rs:305-319 | crates/rspack_core/src/resolver/resolver_impl.rs:336-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crates/rspack_core/src/utils/mod.rs:147— crates/rspack_core/src/utils/mod.rs:147-161 | crates/rspack_core/src/utils/mod.rs:174-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/rspack_ids/src/id_helpers.rs:476— crates/rspack_ids/src/id_helpers.rs:476-492 | crates/rspack_ids/src/id_helpers.rs:542-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_ids/src/id_helpers.rs:476` it begins part-way through the construct above it, so those exact lines 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/rspack_macros/src/rspack_hash.rs:140— crates/rspack_macros/src/rspack_hash.rs:140-154 | crates/rspack_macros/src/rspack_hash.rs:166-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_macros/src/rspack_hash.rs:140` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_esm_library/src/link.rs:1258— crates/rspack_plugin_esm_library/src/link.rs:1258-1272 | crates/rspack_plugin_esm_library/src/link.rs:1275-1289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:314— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:314-328 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:343-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/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:314` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:495— crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:495-509 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:815-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:264— crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:264-278 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:475-489 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.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. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:264` it does not close everything it opens, so those exact lines 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/rspack_plugin_swc_js_minimizer/src/lib.rs:368— crates/rspack_plugin_swc_js_minimizer/src/lib.rs:368-382 | crates/rspack_plugin_swc_js_minimizer/src/lib.rs:383-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.
Duplicated block (15 lines × 2) crates/rspack_core/src/compilation/create_chunk_assets/mod.rs:100— crates/rspack_core/src/compilation/create_chunk_assets/mod.rs:100-114 | crates/rspack_core/src/compilation/runtime_requirements/mod.rs:116-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compilation/create_chunk_assets/mod.rs:100` 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/rspack_plugin_rstest/src/parser_plugin.rs:278— crates/rspack_plugin_rstest/src/parser_plugin.rs:278-292 | crates/rspack_plugin_rstest/src/parser_plugin.rs:334-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_rstest/src/parser_plugin.rs:278` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/rspack_binding_api/src/options/raw_resolve.rs:132— crates/rspack_binding_api/src/options/raw_resolve.rs:132-136 | crates/rspack_binding_api/src/options/raw_resolve.rs:254-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/options/raw_resolve.rs:132` it begins part-way through the construct above it, so those exact lines 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/rspack_cacheable_macros/src/cacheable/impl.rs:18— crates/rspack_cacheable_macros/src/cacheable/impl.rs:18-22 | crates/rspack_cacheable_macros/src/cacheable/impl_disable.rs:27-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_cacheable_macros/src/cacheable/impl.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 (5 lines × 2) crates/rspack_macros/src/hook.rs:70— crates/rspack_macros/src/hook.rs:70-74 | crates/rspack_macros/src/plugin.rs:137-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_macros/src/hook.rs:70` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/magic_comment.rs:193— crates/rspack_plugin_javascript/src/magic_comment.rs:193-197 | crates/rspack_plugin_javascript/src/magic_comment.rs:201-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/magic_comment.rs:193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:87— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:87-91 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:137-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:87` it begins part-way through the construct above it, so those exact lines 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/rspack_regex/src/lib.rs:97— crates/rspack_regex/src/lib.rs:97-101 | crates/rspack_regex/src/lib.rs:107-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_regex/src/lib.rs:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/rspack_watcher/src/lib.rs:434— crates/rspack_watcher/src/lib.rs:434-438 | crates/rspack_watcher/src/testing.rs:76-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_watcher/src/lib.rs:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) crates/rspack_binding_api/src/fs_node/write.rs:431— crates/rspack_binding_api/src/fs_node/write.rs:431-435 | crates/rspack_fs/src/intermediate.rs:37-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_fs/src/memory_fs.rs:371— crates/rspack_fs/src/memory_fs.rs:371-375 | crates/rspack_fs/src/native_fs.rs:395-399 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/rspack_fs/src/memory_fs.rs:385— crates/rspack_fs/src/memory_fs.rs:385-389 | crates/rspack_fs/src/native_fs.rs:410-414 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/rspack_plugin_library/src/export_property_library_plugin.rs:51— crates/rspack_plugin_library/src/export_property_library_plugin.rs:51-55 | crates/rspack_plugin_library/src/umd_library_plugin.rs:75-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_library/src/export_property_library_plugin.rs:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:195— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:195-200 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:209-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/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:195` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:214` calls `is_string`, `Some`, `to_owned` and `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:201` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:821— crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:821-825 | crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:872-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:821` it does not close everything it opens, so those 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 `RawAssetGeneratorOptions` in one and `RawAssetResourceGeneratorOptions` 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/rspack_binding_api/src/raw_options/raw_module/mod.rs:828` calls `RawAssetGeneratorDataUrlWrapper`, `into` and `crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:877` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/rspack_core/src/normal_module_factory.rs:198— crates/rspack_core/src/normal_module_factory.rs:198-202 | crates/rspack_core/src/normal_module_factory.rs:231-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/rspack_core/src/normal_module_factory.rs:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TooManyFields: Compilation crates/rspack_core/src/compilation/mod.rs:213— TooManyFields — 73 stored fields beside 60 methods. The bar is 30 stored fields; this is 43 over it, 2.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: JsHooksAdapterPlugin crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs:20— TooManyFields — 55 stored fields beside 2 methods. The bar is 30 stored fields; this is 25 over it, 1.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RegisterJsTaps crates/rspack_binding_api/src/plugins/interceptor.rs:515— TooManyFields — 54 stored fields. The bar is 30 stored fields; this is 24 over it, 1.80× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: JavascriptParser crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:472— TooManyFields — 53 stored fields beside 230 methods. The bar is 30 stored fields; this is 23 over it, 1.77× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: OutputOptionsBuilder crates/rspack/src/builder/mod.rs:2175— TooManyFields — 47 stored fields beside 48 methods. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RawOutputOptions crates/rspack_binding_api/src/raw_options/raw_output.rs:95— TooManyFields — 44 stored fields. The bar is 30 stored fields; this is 14 over it, 1.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: OutputOptions crates/rspack_core/src/options/output.rs:29— TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CodeSplitter crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:377— TooManyFields — 40 stored fields beside 39 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CompilationHooks crates/rspack_core/src/compilation/mod.rs:150— TooManyFields — 39 stored fields. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: StatsModule crates/rspack_core/src/stats/struct.rs:155— TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NormalModule crates/rspack_core/src/normal_module.rs:97— TooManyFields — 31 stored fields beside 21 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: JavascriptParserOptions crates/rspack_core/src/options/module.rs:501— TooManyFields — 31 stored fields beside 3 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RawJavascriptParserOptions crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:298— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×13
Edited copy of a member (11 corresponding lines) crates/rspack_binding_api/src/filename.rs:48— crates/rspack_binding_api/src/filename.rs:48-58 | crates/rspack_binding_api/src/filename.rs:62-72 — 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/rspack_binding_api/src/stats.rs:113— crates/rspack_binding_api/src/stats.rs:113-123 | crates/rspack_binding_api/src/stats.rs:149-159 — 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/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs:326— crates/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs:326-336 | crates/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs:338-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/rspack_plugin_javascript/src/parser_and_generator/mod.rs:550— crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs:550-560 | crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs:563-573 — 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/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:268— crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:268-279 | crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:871-881 — 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/rspack_fs/src/memory_fs.rs:75— crates/rspack_fs/src/memory_fs.rs:75-85 | crates/rspack_fs/src/memory_fs.rs:87-97 — 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/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:67— crates/rspack_core/src/module_graph/rollback/dense_id_overlay_map.rs:67-78 | crates/rspack_core/src/module_graph/rollback/overlay_map.rs:123-133 — 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/rspack_core/src/artifacts/code_generate_cache_artifact.rs:28— crates/rspack_core/src/artifacts/code_generate_cache_artifact.rs:28-39 | crates/rspack_core/src/artifacts/process_runtime_requirements_cache_artifact.rs:26-36 — 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/rspack_plugin_library/src/utils.rs:54— crates/rspack_plugin_library/src/utils.rs:54-71 | crates/rspack_plugin_runtime/src/module_chunk_loading.rs:16-26 — 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/rspack_plugin_javascript/src/magic_comment.rs:112— crates/rspack_plugin_javascript/src/magic_comment.rs:112-124 | crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1044-1054 — 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/rspack_binding_api/src/chunk.rs:243— crates/rspack_binding_api/src/chunk.rs:243-253 | crates/rspack_binding_api/src/chunk_group.rs:47-57 — 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/rspack_plugin_javascript/src/dependency/context/amd_require_context_dependency.rs:26— crates/rspack_plugin_javascript/src/dependency/context/amd_require_context_dependency.rs:26-36 | crates/rspack_plugin_javascript/src/dependency/context/url_context_dependency.rs:32-43 — 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/rspack_plugin_schemes/src/data_uri.rs:91— crates/rspack_plugin_schemes/src/data_uri.rs:91-101 | crates/rspack_plugin_schemes/src/http_uri/mod.rs:239-253 — 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.
EsmLibraryPlugin::link_imports_and_exports (cognitive 218) crates/rspack_plugin_esm_library/src/link.rs:2111— EsmLibraryPlugin::link_imports_and_exports has cognitive complexity 218 (threshold 15). Drivers by points: if/else 43 (139 pts), loops 27 (59 pts), match/switch 5 (13 pts), boolean chains 7 (nesting depth added 136). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::link (cognitive 158) crates/rspack_plugin_esm_library/src/link.rs:514— EsmLibraryPlugin::link has cognitive complexity 158 (threshold 15). Drivers by points: if/else 27 (112 pts), match/switch 3 (28 pts), loops 7 (13 pts), boolean chains 5 (nesting depth added 116). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EsmLibraryPlugin::render_chunk (cognitive 136) crates/rspack_plugin_esm_library/src/render.rs:131— EsmLibraryPlugin::render_chunk has cognitive complexity 136 (threshold 15). Drivers by points: if/else 50 (95 pts), loops 20 (32 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::deconflict_symbols (cognitive 129) crates/rspack_plugin_esm_library/src/link.rs:1005— EsmLibraryPlugin::deconflict_symbols has cognitive complexity 129 (threshold 15). Drivers by points: if/else 33 (93 pts), loops 11 (19 pts), boolean chains 11, match/switch 3 (6 pts) (nesting depth added 71). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EsmLibraryPlugin::link_entry_module_exports (cognitive 91) crates/rspack_plugin_esm_library/src/link.rs:1789— EsmLibraryPlugin::link_entry_module_exports has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (59 pts), boolean chains 17, match/switch 4 (12 pts), loops 2 (3 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::get_binding (cognitive 33) crates/rspack_plugin_esm_library/src/link.rs:2909— EsmLibraryPlugin::get_binding has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 9 (15 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EsmLibraryPlugin::mark_modules (cognitive 30) crates/rspack_plugin_esm_library/src/plugin.rs:112— EsmLibraryPlugin::mark_modules has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::analyze_module (cognitive 25) crates/rspack_plugin_esm_library/src/link.rs:1342— EsmLibraryPlugin::analyze_module has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::render_module (cognitive 23) crates/rspack_plugin_esm_library/src/render.rs:773— EsmLibraryPlugin::render_module has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::get_external_import_source_and_binding (cognitive 20) crates/rspack_plugin_esm_library/src/link.rs:467— EsmLibraryPlugin::get_external_import_source_and_binding has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EsmLibraryPlugin::resolve_re_export_star_from_unknown (cognitive 19) crates/rspack_plugin_esm_library/src/link.rs:1540— EsmLibraryPlugin::resolve_re_export_star_from_unknown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::invalidate_chunk_group (cognitive 77) crates/rspack_core/src/compilation/build_chunk_graph/incremental.rs:97— CodeSplitter::invalidate_chunk_group has cognitive complexity 77 (threshold 15). Drivers by points: if/else 24 (57 pts), loops 9 (16 pts), boolean chains 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::update_with_compilation (cognitive 56) crates/rspack_core/src/compilation/build_chunk_graph/incremental.rs:488— CodeSplitter::update_with_compilation has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 12 (22 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::split (cognitive 44) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1203— CodeSplitter::split has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 6 (10 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::make_chunk_group (cognitive 44) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1919— CodeSplitter::make_chunk_group has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::process_chunk_groups_for_merging (cognitive 43) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2759— CodeSplitter::process_chunk_groups_for_merging has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 6 (11 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::set_entry_runtime_and_depend_on (cognitive 38) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:866— CodeSplitter::set_entry_runtime_and_depend_on has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (8 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::get_module_reuse_info (cognitive 26) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:531— CodeSplitter::get_module_reuse_info has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::process_block (cognitive 22) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1817— CodeSplitter::process_block has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::process_chunk_groups_for_combining (cognitive 20) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2563— CodeSplitter::process_chunk_groups_for_combining has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::process_outdated_chunk_group_info (cognitive 18) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2406— CodeSplitter::process_outdated_chunk_group_info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeSplitter::process_chunk_groups_for_adding (cognitive 16) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2657— CodeSplitter::process_chunk_groups_for_adding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 6 (7 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::walk_assignment_expression (cognitive 33) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1947— JavascriptParser::walk_assignment_expression has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::walk_call_expression (cognitive 32) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1642— JavascriptParser::walk_call_expression has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::walk_member_expression (cognitive 27) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1279— JavascriptParser::walk_member_expression has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::evaluating (cognitive 24) crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1796— JavascriptParser::evaluating has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
JavascriptParser::walk_variable_declaration (cognitive 24) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:548— JavascriptParser::walk_variable_declaration has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::walk_class (cognitive 24) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2283— JavascriptParser::walk_class has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::build_plugin_drive (cognitive 23) crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:554— JavascriptParser::build_plugin_drive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JavascriptParser::walk_if_statement (cognitive 22) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:390— JavascriptParser::walk_if_statement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::_walk_iife (cognitive 19) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1519— JavascriptParser::_walk_iife has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2, match/switch 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::extract_member_expression_chain_raw (cognitive 17) crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1431— JavascriptParser::extract_member_expression_chain_raw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavascriptParser::enter_assignment_target_pattern (cognitive 17) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1887— JavascriptParser::enter_assignment_target_pattern has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Low cohesion: NativeFileSystem (LCOM4 16) crates/rspack_fs/src/native_fs.rs:23— NativeFileSystem's methods fall into 16 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 16 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: APIPlugin (LCOM4 12) crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs:262— APIPlugin'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: InnerGraphParserPlugin (LCOM4 12) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:49— InnerGraphParserPlugin'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: Compilation (LCOM4 7) crates/rspack_core/src/compilation/mod.rs:213— Compilation'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: ImportMetaPlugin (LCOM4 6) crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:307— ImportMetaPlugin'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: ResolveContext (LCOM4 6) crates/rspack_resolver/src/context.rs:8— ResolveContext'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: JsPlugin (LCOM4 5) crates/rspack_plugin_javascript/src/plugin/mod.rs:108— JsPlugin'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: OutputOptionsBuilder (LCOM4 4) crates/rspack/src/builder/mod.rs:2175— OutputOptionsBuilder'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: RuntimeGlobals (LCOM4 4) crates/rspack_core/src/runtime_globals.rs:10— RuntimeGlobals'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: SplitChunkSizes (LCOM4 4) crates/rspack_plugin_split_chunks/src/common.rs:160— SplitChunkSizes'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: FsWatcher (LCOM4 4) crates/rspack_watcher/src/lib.rs:151— FsWatcher'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.
LexDependencies::lex_streaming_inner (cyclomatic 82) crates/css-module-lexer/src/dependencies.rs:1576— LexDependencies::lex_streaming_inner has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LexDependencies::handle_ident (cyclomatic 44) crates/css-module-lexer/src/dependencies.rs:4126— LexDependencies::handle_ident has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LexDependencies::lex_composes (cyclomatic 30) crates/css-module-lexer/src/dependencies.rs:3202— LexDependencies::lex_composes has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LexDependencies::handle_function (cyclomatic 23) crates/css-module-lexer/src/dependencies.rs:3955— LexDependencies::handle_function has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LexDependencies::handle_string (cyclomatic 21) crates/css-module-lexer/src/dependencies.rs:3527— LexDependencies::handle_string has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LexDependencies::lex_local_function_decl (cyclomatic 20) crates/css-module-lexer/src/dependencies.rs:3044— LexDependencies::lex_local_function_decl has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: AnimationReserved::check (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
LexDependencies::lex_value_at_rule (cyclomatic 19) crates/css-module-lexer/src/dependencies.rs:2510— LexDependencies::lex_value_at_rule has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AnimationReserved::check (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
LexDependencies::handle_left_curly_bracket (cyclomatic 19) crates/css-module-lexer/src/dependencies.rs:4398— LexDependencies::handle_left_curly_bracket has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AnimationReserved::check (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
LexDependencies::handle_at_keyword (cyclomatic 17) crates/css-module-lexer/src/dependencies.rs:3628— LexDependencies::handle_at_keyword has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AnimationReserved::check (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
LexDependencies::lex_local_keyframes_decl (cyclomatic 16) crates/css-module-lexer/src/dependencies.rs:2845— LexDependencies::lex_local_keyframes_decl has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AnimationReserved::check (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×10
Edited copy of a member (13 corresponding lines) crates/rspack_binding_api/src/compilation/dependencies.rs:102— crates/rspack_binding_api/src/compilation/dependencies.rs:102-115 | crates/rspack_binding_api/src/compilation/dependencies.rs:118-130 — 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/rspack_plugin_javascript/src/utils/eval/mod.rs:276— crates/rspack_plugin_javascript/src/utils/eval/mod.rs:276-288 | crates/rspack_plugin_javascript/src/utils/eval/mod.rs:290-302 — 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/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs:248— crates/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs:248-260 | crates/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs:290-305 — 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/rspack_tracing/src/perfetto.rs:40— crates/rspack_tracing/src/perfetto.rs:40-61 | crates/rspack_tracing_perfetto/src/lib.rs:91-103 — 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/rspack_plugin_extract_css/src/runtime.rs:482— crates/rspack_plugin_extract_css/src/runtime.rs:482-495 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:119-131 — 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/rspack_binding_api/src/compilation/entries.rs:194— crates/rspack_binding_api/src/compilation/entries.rs:194-206 | crates/rspack_binding_api/src/compilation/entries.rs:209-221 — 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/rspack_binding_api/src/resolver_factory.rs:78— crates/rspack_binding_api/src/resolver_factory.rs:78-91 | crates/rspack_binding_api/src/resolver_factory.rs:93-105 — 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/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:63— crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:63-75 | crates/rspack_plugin_javascript/src/dependency/commonjs/require_resolve_dependency.rs:42-54 — 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/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:807— crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:807-819 | crates/rspack_plugin_javascript/src/dependency/url/mod.rs:205-217 — 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/rspack_plugin_extract_css/src/css_dependency.rs:48— crates/rspack_plugin_extract_css/src/css_dependency.rs:48-66 | crates/rspack_plugin_rsc/src/rsc_entry_dependency.rs:43-55 — 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 (8 corresponding lines) · ×10
Edited copy of a member (8 corresponding lines) crates/rspack_napi/src/threadsafe_function.rs:160— crates/rspack_napi/src/threadsafe_function.rs:160-167 | crates/rspack_napi/src/threadsafe_function.rs:199-206 — 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/rspack_core/src/options/resolve/clever_merge.rs:172— crates/rspack_core/src/options/resolve/clever_merge.rs:172-179 | crates/rspack_util/src/merge.rs:53-60 — 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/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:52— crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:52-61 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/estree.rs:295-302 — 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/rspack_plugin_javascript/src/parser_plugin/provide_plugin/mod.rs:84— crates/rspack_plugin_javascript/src/parser_plugin/provide_plugin/mod.rs:84-94 | crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/mod.rs:100-107 — 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/rspack_plugin_library/src/jsonp_library_plugin.rs:117— crates/rspack_plugin_library/src/jsonp_library_plugin.rs:117-124 | crates/rspack_plugin_library/src/system_library_plugin.rs:187-196 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/rspack_ids/src/id_helpers.rs:185— crates/rspack_ids/src/id_helpers.rs:185-194 | crates/rspack_plugin_css/src/utils.rs:394-401 — 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/rspack_binding_api/src/compilation/chunks.rs:22— crates/rspack_binding_api/src/compilation/chunks.rs:22-29 | crates/rspack_binding_api/src/compilation/diagnostics.rs:21-28 — 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/rspack_plugin_esm_library/src/plugin.rs:727— crates/rspack_plugin_esm_library/src/plugin.rs:727-734 | crates/rspack_plugin_extract_css/src/plugin.rs:754-763 — 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/rspack_binding_api/src/build_info.rs:29— crates/rspack_binding_api/src/build_info.rs:29-36 | crates/rspack_binding_api/src/resource_data.rs:24-31 — 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/rspack_core/src/compilation/finish_make/mod.rs:8— crates/rspack_core/src/compilation/finish_make/mod.rs:8-19 | crates/rspack_core/src/compilation/finish_module_graph/mod.rs:11-18 — 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.
rspack_plugin_mf::manifest::process_assets (cognitive 238) crates/rspack_plugin_mf/src/manifest/mod.rs:164— rspack_plugin_mf::manifest::process_assets has cognitive complexity 238 (threshold 15). Drivers by points: if/else 47 (165 pts), loops 19 (60 pts), boolean chains 7, match/switch 3 (6 pts) (nesting depth added 162). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::optimize_dependencies (cognitive 72) crates/rspack_plugin_mf/src/sharing/shared_used_exports_optimizer_plugin.rs:129— rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::optimize_dependencies has cognitive complexity 72 (threshold 15). Drivers by points: if/else 17 (51 pts), loops 4 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_mf::manifest::utils::collect_entry_files (cognitive 67) crates/rspack_plugin_mf/src/manifest/utils.rs:37— rspack_plugin_mf::manifest::utils::collect_entry_files has cognitive complexity 67 (threshold 15). Drivers by points: if/else 8 (38 pts), loops 7 (28 pts), boolean chains 1 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_mf::sharing::collect_shared_entry_plugin::finish_make (cognitive 53) crates/rspack_plugin_mf/src/sharing/collect_shared_entry_plugin.rs:100— rspack_plugin_mf::sharing::collect_shared_entry_plugin::finish_make has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 6 (12 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_mf::manifest::asset::collect_assets_from_chunk (cognitive 48) crates/rspack_plugin_mf/src/manifest/asset.rs:11— rspack_plugin_mf::manifest::asset::collect_assets_from_chunk has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 8 (18 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_mf::container::hoist_container_references_plugin::optimize_chunks (cognitive 34) crates/rspack_plugin_mf/src/container/hoist_container_references_plugin.rs:140— rspack_plugin_mf::container::hoist_container_references_plugin::optimize_chunks has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 6 (9 pts), boolean chains 1 (nesting depth added 20). Of this number, 21 points are the body's own statements and 13 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::dependency_referenced_exports (cognitive 24) crates/rspack_plugin_mf/src/sharing/shared_used_exports_optimizer_plugin.rs:384— rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::dependency_referenced_exports has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_mf::manifest::asset::module_source_path (cognitive 23) crates/rspack_plugin_mf/src/manifest/asset.rs:188— rspack_plugin_mf::manifest::asset::module_source_path has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_mf::container::container_reference_plugin::factorize (cognitive 19) crates/rspack_plugin_mf/src/container/container_reference_plugin.rs:66— rspack_plugin_mf::container::container_reference_plugin::factorize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_esm_library::optimize_chunks::extract_tla_shared_modules (cognitive 99) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:27— rspack_plugin_esm_library::optimize_chunks::extract_tla_shared_modules has cognitive complexity 99 (threshold 15). Drivers by points: if/else 19 (62 pts), loops 16 (36 pts), boolean chains 1 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::optimize_chunks::analyze_dyn_import_targets (cognitive 84) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:565— rspack_plugin_esm_library::optimize_chunks::analyze_dyn_import_targets has cognitive complexity 84 (threshold 15). Drivers by points: if/else 22 (59 pts), loops 10 (18 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::split_chunks::split (cognitive 68) crates/rspack_plugin_esm_library/src/split_chunks.rs:178— rspack_plugin_esm_library::split_chunks::split has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 8 (15 pts), match/switch 6 (13 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::preserve_modules::preserve_modules (cognitive 53) crates/rspack_plugin_esm_library/src/preserve_modules.rs:114— rspack_plugin_esm_library::preserve_modules::preserve_modules has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (46 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::optimize_chunks::assign_dyn_import_chunk_short_names (cognitive 40) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:878— rspack_plugin_esm_library::optimize_chunks::assign_dyn_import_chunk_short_names has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 7 (12 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::plugin::process_assets (cognitive 37) crates/rspack_plugin_esm_library/src/plugin.rs:559— rspack_plugin_esm_library::plugin::process_assets has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::dependency::commonjs_external::cutout_commonjs_externals (cognitive 36) crates/rspack_plugin_esm_library/src/dependency/commonjs_external.rs:43— rspack_plugin_esm_library::dependency::commonjs_external::cutout_commonjs_externals has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::plugin::optimize_chunk_modules (cognitive 33) crates/rspack_plugin_esm_library/src/plugin.rs:762— rspack_plugin_esm_library::plugin::optimize_chunk_modules has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 6 (13 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_esm_library::optimize_chunks::ensure_entry_exports (cognitive 22) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:273— rspack_plugin_esm_library::optimize_chunks::ensure_entry_exports has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 4 (9 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×9
Edited copy of a member (16 corresponding lines) crates/rspack_plugin_mf/src/sharing/consume_shared_module.rs:209— crates/rspack_plugin_mf/src/sharing/consume_shared_module.rs:209-226 | crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs:167-182 — 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/rspack_plugin_rstest/src/parser_plugin.rs:353— crates/rspack_plugin_rstest/src/parser_plugin.rs:353-373 | crates/rspack_plugin_rstest/src/plugin.rs:227-242 — 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/rspack_plugin_css/src/runtime/mod.rs:125— crates/rspack_plugin_css/src/runtime/mod.rs:125-140 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:145-160 — 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/rspack_core/src/module_graph/mod.rs:211— crates/rspack_core/src/module_graph/mod.rs:211-226 | crates/rspack_core/src/module_graph/mod.rs:236-260 — 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/rspack_paths/src/path_list.rs:51— crates/rspack_paths/src/path_list.rs:51-66 | crates/rspack_paths/src/path_list.rs:69-86 — 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/rspack_binding_api/src/chunk_graph.rs:62— crates/rspack_binding_api/src/chunk_graph.rs:62-77 | crates/rspack_binding_api/src/chunk_graph.rs:85-100 — 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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1033— crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1033-1048 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1054-1071 — 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/rspack_plugin_runtime/src/runtime_module/make_deferred_namespace_object_runtime.rs:56— crates/rspack_plugin_runtime/src/runtime_module/make_deferred_namespace_object_runtime.rs:56-71 | crates/rspack_plugin_runtime/src/runtime_module/make_optimized_deferred_namespace_object_runtime.rs:56-71 — 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/rspack_binding_api/src/chunk.rs:36— crates/rspack_binding_api/src/chunk.rs:36-51 | crates/rspack_binding_api/src/chunk_group.rs:26-41 — 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.
Lexer::scan_value (cognitive 164) crates/css-module-lexer/src/lexer.rs:352— Lexer::scan_value has cognitive complexity 164 (threshold 15). Drivers by points: if/else 47 (125 pts), boolean chains 28, match/switch 3 (6 pts), loops 2 (5 pts) (nesting depth added 84). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Lexer::scan_url (cognitive 54) crates/css-module-lexer/src/lexer.rs:1457— Lexer::scan_url has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::fast_forward_selector (cognitive 48) crates/css-module-lexer/src/lexer.rs:759— Lexer::fast_forward_selector has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 4 (9 pts), boolean chains 5, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::scan_string (cognitive 41) crates/css-module-lexer/src/lexer.rs:1354— Lexer::scan_string has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::scan_bad_url (cognitive 36) crates/css-module-lexer/src/lexer.rs:1568— Lexer::scan_bad_url has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::scan_name_impl (cognitive 34) crates/css-module-lexer/src/lexer.rs:1756— Lexer::scan_name_impl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Lexer::next_token_without_visit (cognitive 26) crates/css-module-lexer/src/lexer.rs:1069— Lexer::next_token_without_visit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::fast_forward (cognitive 16) crates/css-module-lexer/src/lexer.rs:933— Lexer::fast_forward has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×8
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×8
Edited copy of a member (10 corresponding lines) crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:820— crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:820-832 | crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:871-880 — 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/rspack_core/src/artifacts/code_generation_results.rs:344— crates/rspack_core/src/artifacts/code_generation_results.rs:344-353 | crates/rspack_core/src/artifacts/code_generation_results.rs:365-374 — 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/rspack_fs/src/memory_fs.rs:284— crates/rspack_fs/src/memory_fs.rs:284-293 | crates/rspack_fs/src/memory_fs.rs:299-308 — 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/rspack_core/src/resolver/boxfs.rs:29— crates/rspack_core/src/resolver/boxfs.rs:29-38 | crates/rspack_core/src/resolver/boxfs.rs:40-49 — 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/rspack_storage/src/filesystem/scope_fs.rs:71— crates/rspack_storage/src/filesystem/scope_fs.rs:71-82 | crates/rspack_storage/src/filesystem/scope_fs.rs:105-114 — 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/rspack_binding_api/src/js_helpers.rs:52— crates/rspack_binding_api/src/js_helpers.rs:52-61 | crates/rspack_binding_api/src/js_helpers.rs:68-78 — 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/rspack_binding_api/src/chunk.rs:256— crates/rspack_binding_api/src/chunk.rs:256-266 | crates/rspack_binding_api/src/chunk_group.rs:116-125 — 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/rspack_plugin_mf/src/container/container_exposed_dependency.rs:18— crates/rspack_plugin_mf/src/container/container_exposed_dependency.rs:18-27 | crates/rspack_plugin_rsc/src/client_reference_dependency.rs:28-37 — 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.
EsmLibraryPlugin::link_imports_and_exports (cyclomatic 80) crates/rspack_plugin_esm_library/src/link.rs:2111— EsmLibraryPlugin::link_imports_and_exports has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EsmLibraryPlugin::render_chunk (cyclomatic 70) crates/rspack_plugin_esm_library/src/render.rs:131— EsmLibraryPlugin::render_chunk has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EsmLibraryPlugin::deconflict_symbols (cyclomatic 55) crates/rspack_plugin_esm_library/src/link.rs:1005— EsmLibraryPlugin::deconflict_symbols has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EsmLibraryPlugin::link_entry_module_exports (cyclomatic 40) crates/rspack_plugin_esm_library/src/link.rs:1789— EsmLibraryPlugin::link_entry_module_exports has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EsmLibraryPlugin::link (cyclomatic 39) crates/rspack_plugin_esm_library/src/link.rs:514— EsmLibraryPlugin::link has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EsmLibraryPlugin::get_binding (cyclomatic 31) crates/rspack_plugin_esm_library/src/link.rs:2909— EsmLibraryPlugin::get_binding has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EsmLibraryPlugin::mark_modules (cyclomatic 18) crates/rspack_plugin_esm_library/src/plugin.rs:112— EsmLibraryPlugin::mark_modules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::manifest::process_assets (cyclomatic 71) crates/rspack_plugin_mf/src/manifest/mod.rs:164— rspack_plugin_mf::manifest::process_assets has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::optimize_dependencies (cyclomatic 25) crates/rspack_plugin_mf/src/sharing/shared_used_exports_optimizer_plugin.rs:129— rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::optimize_dependencies has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::sharing::collect_shared_entry_plugin::finish_make (cyclomatic 23) crates/rspack_plugin_mf/src/sharing/collect_shared_entry_plugin.rs:100— rspack_plugin_mf::sharing::collect_shared_entry_plugin::finish_make has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::manifest::asset::collect_assets_from_chunk (cyclomatic 22) crates/rspack_plugin_mf/src/manifest/asset.rs:11— rspack_plugin_mf::manifest::asset::collect_assets_from_chunk has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::manifest::utils::collect_entry_files (cyclomatic 17) crates/rspack_plugin_mf/src/manifest/utils.rs:37— rspack_plugin_mf::manifest::utils::collect_entry_files has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::dependency_referenced_exports (cyclomatic 17) crates/rspack_plugin_mf/src/sharing/shared_used_exports_optimizer_plugin.rs:384— rspack_plugin_mf::sharing::shared_used_exports_optimizer_plugin::dependency_referenced_exports has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_mf::manifest::asset::module_source_path (cyclomatic 16) crates/rspack_plugin_mf/src/manifest/asset.rs:188— rspack_plugin_mf::manifest::asset::module_source_path has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodeSplitter::invalidate_chunk_group (cyclomatic 38) crates/rspack_core/src/compilation/build_chunk_graph/incremental.rs:97— CodeSplitter::invalidate_chunk_group has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeSplitter::update_with_compilation (cyclomatic 29) crates/rspack_core/src/compilation/build_chunk_graph/incremental.rs:488— CodeSplitter::update_with_compilation has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeSplitter::split (cyclomatic 24) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1203— CodeSplitter::split has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeSplitter::make_chunk_group (cyclomatic 21) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1919— CodeSplitter::make_chunk_group has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeSplitter::process_chunk_groups_for_merging (cyclomatic 19) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2759— CodeSplitter::process_chunk_groups_for_merging has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeSplitter::set_entry_runtime_and_depend_on (cyclomatic 18) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:866— CodeSplitter::set_entry_runtime_and_depend_on has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeSplitter::get_module_reuse_info (cyclomatic 16) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:531— CodeSplitter::get_module_reuse_info has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JavascriptParser::evaluating (cyclomatic 28) crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1796— JavascriptParser::evaluating has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
JavascriptParser::walk_call_expression (cyclomatic 23) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1642— JavascriptParser::walk_call_expression has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JavascriptParser::walk_expression (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
JavascriptParser::build_plugin_drive (cyclomatic 21) crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:554— JavascriptParser::build_plugin_drive has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JavascriptParser::walk_assignment_expression (cyclomatic 21) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1947— JavascriptParser::walk_assignment_expression has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JavascriptParser::walk_expression (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
JavascriptParser::_walk_iife (cyclomatic 18) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1519— JavascriptParser::_walk_iife has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JavascriptParser::walk_expression (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
JavascriptParser::walk_member_expression (cyclomatic 16) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1279— JavascriptParser::walk_member_expression has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JavascriptParser::walk_expression (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
JavascriptParser::walk_class (cyclomatic 16) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2283— JavascriptParser::walk_class has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JavascriptParser::walk_expression (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
No assertions: test a-1 tests/rspack-test/configCases/source-map/nosources/list.test.ts:4— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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: test a-2 tests/rspack-test/configCases/source-map/nosources/list.test.ts:9— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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: (unnamed test) tests/rspack-test/configCases/source-map/nosources/list.test.ts:17— 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 compile tests/e2e/cases/persistent-cache/rename-file/index.test.ts:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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 compile tests/e2e/cases/make/rewrite-factorize-request/index.test.ts:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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 compile tests/e2e/cases/make/rewrite-factorize-reexport-request/index.test.ts:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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 compile tests/e2e/cases/make/rewrite-factorize-provide-request/index.test.ts:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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.
rspack_plugin_runtime::module_chunk_format::render_chunk (cognitive 47) crates/rspack_plugin_runtime/src/module_chunk_format.rs:137— rspack_plugin_runtime::module_chunk_format::render_chunk has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_runtime::common_js_chunk_loading::runtime_requirements_in_tree (cognitive 36) crates/rspack_plugin_runtime/src/common_js_chunk_loading.rs:57— rspack_plugin_runtime::common_js_chunk_loading::runtime_requirements_in_tree has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (36 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_runtime::array_push_callback_chunk_format::render_chunk (cognitive 27) crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:104— rspack_plugin_runtime::array_push_callback_chunk_format::render_chunk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_runtime::module_chunk_loading::runtime_requirements_in_tree (cognitive 25) crates/rspack_plugin_runtime/src/module_chunk_loading.rs:47— rspack_plugin_runtime::module_chunk_loading::runtime_requirements_in_tree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_runtime::runtime_plugin::runtime_requirements_in_tree (cognitive 23) crates/rspack_plugin_runtime/src/runtime_plugin.rs:157— rspack_plugin_runtime::runtime_plugin::runtime_requirements_in_tree has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_runtime::helpers::get_all_chunks::add_chunks (cognitive 19) crates/rspack_plugin_runtime/src/helpers.rs:84— rspack_plugin_runtime::helpers::get_all_chunks::add_chunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_runtime::helpers::generate_entry_startup (cognitive 18) crates/rspack_plugin_runtime/src/helpers.rs:223— rspack_plugin_runtime::helpers::generate_entry_startup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::named_chunk_ids_plugin::assign_named_chunk_ids (cognitive 43) crates/rspack_ids/src/named_chunk_ids_plugin.rs:19— rspack_ids::named_chunk_ids_plugin::assign_named_chunk_ids has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 7 (14 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::named_module_ids_plugin::assign_named_module_ids (cognitive 39) crates/rspack_ids/src/named_module_ids_plugin.rs:33— rspack_ids::named_module_ids_plugin::assign_named_module_ids has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 7 (14 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::named_module_ids_plugin::module_ids (cognitive 28) crates/rspack_ids/src/named_module_ids_plugin.rs:194— rspack_ids::named_module_ids_plugin::module_ids has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::named_chunk_ids_plugin::chunk_ids (cognitive 26) crates/rspack_ids/src/named_chunk_ids_plugin.rs:240— rspack_ids::named_chunk_ids_plugin::chunk_ids has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (7 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::occurrence_chunk_ids_plugin::chunk_ids (cognitive 22) crates/rspack_ids/src/occurrence_chunk_ids_plugin.rs:32— rspack_ids::occurrence_chunk_ids_plugin::chunk_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::sync_module_ids_plugin::revive_modules (cognitive 18) crates/rspack_ids/src/sync_module_ids_plugin.rs:101— rspack_ids::sync_module_ids_plugin::revive_modules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_ids::id_helpers::assign_ascending_chunk_ids (cognitive 16) crates/rspack_ids/src/id_helpers.rs:683— rspack_ids::id_helpers::assign_ascending_chunk_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×7
Edited copy of a member (27 corresponding lines) crates/rspack_ids/src/id_helpers.rs:42— crates/rspack_ids/src/id_helpers.rs:42-73 | crates/rspack_ids/src/id_helpers.rs:79-105 — 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/rspack_fs/src/native_fs.rs:311— crates/rspack_fs/src/native_fs.rs:311-337 | crates/rspack_resolver/src/file_system.rs:251-282 — 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/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:466— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:466-492 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:498-528 — 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/rspack_plugin_mf/src/container/container_entry_module.rs:56— crates/rspack_plugin_mf/src/container/container_entry_module.rs:56-86 | crates/rspack_plugin_mf/src/container/container_entry_module.rs:93-119 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/rspack_loader_swc/src/rsc_transforms/react_server_components.rs:143— crates/rspack_loader_swc/src/rsc_transforms/react_server_components.rs:143-169 | crates/rspack_loader_swc/src/rsc_transforms/react_server_components.rs:171-197 — 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/rspack_plugin_sri/src/runtime.rs:244— crates/rspack_plugin_sri/src/runtime.rs:244-270 | crates/rspack_plugin_sri/src/runtime.rs:277-308 — 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/rspack_plugin_hmr/src/lib.rs:1088— crates/rspack_plugin_hmr/src/lib.rs:1088-1115 | crates/rspack_plugin_rslib/src/plugin.rs:425-451 — 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 (18 corresponding lines) · ×7
Edited copy of a member (18 corresponding lines) crates/rspack_util/src/identifier.rs:199— crates/rspack_util/src/identifier.rs:199-224 | crates/rspack_util/src/identifier.rs:226-243 — 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/rspack_binding_api/src/lib.rs:466— crates/rspack_binding_api/src/lib.rs:466-483 | crates/rspack_binding_api/src/lib.rs:496-519 — 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/rspack_core/src/glob_utils.rs:150— crates/rspack_core/src/glob_utils.rs:150-168 | crates/rspack_core/src/glob_utils.rs:175-192 — 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/rspack_plugin_library/src/amd_library_plugin.rs:38— crates/rspack_plugin_library/src/amd_library_plugin.rs:38-60 | crates/rspack_plugin_library/src/system_library_plugin.rs:31-48 — 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/rspack_plugin_swc_js_minimizer/src/lib.rs:609— crates/rspack_plugin_swc_js_minimizer/src/lib.rs:609-629 | crates/rspack_util/src/asset_condition.rs:39-56 — 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/rspack_core/src/context_module.rs:319— crates/rspack_core/src/context_module.rs:319-336 | crates/rspack_core/src/normal_module.rs:351-368 — 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/rspack_plugin_runtime/src/runtime_module/get_chunk_update_filename.rs:26— crates/rspack_plugin_runtime/src/runtime_module/get_chunk_update_filename.rs:26-43 | crates/rspack_plugin_runtime/src/runtime_module/get_main_filename.rs:38-55 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×7
Edited copy of a member (17 corresponding lines) crates/rspack_core/src/utils/mod.rs:199— crates/rspack_core/src/utils/mod.rs:199-215 | crates/rspack_core/src/utils/mod.rs:222-238 — 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/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2055— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2055-2077 | crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:397-413 — 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/rspack_plugin_javascript/src/parser_plugin/initialize_evaluating.rs:293— crates/rspack_plugin_javascript/src/parser_plugin/initialize_evaluating.rs:293-314 | crates/rspack_plugin_javascript/src/parser_plugin/initialize_evaluating.rs:317-333 — 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/rspack_plugin_rsdoctor/src/plugin.rs:258— crates/rspack_plugin_rsdoctor/src/plugin.rs:258-284 | crates/rspack_plugin_rsdoctor/src/plugin.rs:349-365 — 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/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1110— crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1110-1126 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1131-1147 — 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) linting/rspack_collection_hasher/src/lib.rs:363— linting/rspack_collection_hasher/src/lib.rs:363-379 | linting/rspack_collection_hasher/src/lib.rs:391-409 — 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/rspack_plugin_runtime/src/common_js_chunk_loading.rs:32— crates/rspack_plugin_runtime/src/common_js_chunk_loading.rs:32-54 | crates/rspack_plugin_runtime/src/import_scripts_chunk_loading.rs:22-38 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×7
Edited copy of a member (15 corresponding lines) crates/rspack_plugin_runtime/src/runtime_module/utils.rs:48— crates/rspack_plugin_runtime/src/runtime_module/utils.rs:48-63 | crates/rspack_plugin_runtime/src/runtime_module/utils.rs:255-269 — 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/rspack_core/src/compilation/mod.rs:996— crates/rspack_core/src/compilation/mod.rs:996-1010 | crates/rspack_core/src/compilation/mod.rs:1022-1036 — 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/rspack_binding_api/src/fs_node/write.rs:313— crates/rspack_binding_api/src/fs_node/write.rs:313-327 | crates/rspack_binding_api/src/fs_node/write.rs:412-426 — 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/rspack_core/src/runtime.rs:362— crates/rspack_core/src/runtime.rs:362-376 | crates/rspack_core/src/runtime.rs:378-392 — 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/rspack_macros/src/ast_object.rs:171— crates/rspack_macros/src/ast_object.rs:171-185 | crates/rspack_napi_macros/src/field_names.rs:41-55 — 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/rspack_plugin_css/src/parser_and_generator/generator.rs:43— crates/rspack_plugin_css/src/parser_and_generator/generator.rs:43-57 | crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs:216-230 — 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:86— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:86-102 | crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:94-108 — 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.
Off the main sequence: rspack_browserslist — rspack_browserslist: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: rspack_swc_plugin_ts_collector — rspack_swc_plugin_ts_collector: 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: rspack_tasks — rspack_tasks: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: css-module-lexer — css-module-lexer: abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: rspack_intern — rspack_intern: abstractness 0.10, instability 0.06, distance 0.84 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
Off the main sequence: rspack_regex — rspack_regex: abstractness 0.00, instability 0.18, distance 0.82 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
Off the main sequence: rspack_paths — rspack_paths: abstractness 0.17, instability 0.08, distance 0.76 — zone of pain — concrete and depended on by 24 project(s), so it's rigid to change.
AC3 · Page structure· Page without a main landmark · ×6
Page without a main landmark packages/create-rspack/template-react-js/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark packages/create-rspack/template-react-ts/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark packages/create-rspack/template-vanilla-js/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark packages/create-rspack/template-vanilla-ts/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark packages/create-rspack/template-vue-js/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="app">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark packages/create-rspack/template-vue-ts/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="app">, so there is no content here to wrap — render the <main> from the component mounted into it.
Lexer::scan_value (cyclomatic 87) crates/css-module-lexer/src/lexer.rs:352— Lexer::scan_value has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Lexer::next_token_without_visit (cyclomatic 38) crates/css-module-lexer/src/lexer.rs:1069— Lexer::next_token_without_visit has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Lexer::fast_forward_selector (cyclomatic 31) crates/css-module-lexer/src/lexer.rs:759— Lexer::fast_forward_selector has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Lexer::scan_url (cyclomatic 22) crates/css-module-lexer/src/lexer.rs:1457— Lexer::scan_url has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Lexer::scan_string (cyclomatic 17) crates/css-module-lexer/src/lexer.rs:1354— Lexer::scan_string has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Lexer::fast_forward (cyclomatic 16) crates/css-module-lexer/src/lexer.rs:933— Lexer::fast_forward has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_esm_library::optimize_chunks::analyze_dyn_import_targets (cyclomatic 39) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:565— rspack_plugin_esm_library::optimize_chunks::analyze_dyn_import_targets has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_esm_library::optimize_chunks::extract_tla_shared_modules (cyclomatic 37) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:27— rspack_plugin_esm_library::optimize_chunks::extract_tla_shared_modules has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_esm_library::split_chunks::split (cyclomatic 35) crates/rspack_plugin_esm_library/src/split_chunks.rs:178— rspack_plugin_esm_library::split_chunks::split has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_esm_library::preserve_modules::preserve_modules (cyclomatic 24) crates/rspack_plugin_esm_library/src/preserve_modules.rs:114— rspack_plugin_esm_library::preserve_modules::preserve_modules has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_esm_library::dependency::commonjs_external::cutout_commonjs_externals (cyclomatic 18) crates/rspack_plugin_esm_library/src/dependency/commonjs_external.rs:43— rspack_plugin_esm_library::dependency::commonjs_external::cutout_commonjs_externals has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_esm_library::optimize_chunks::assign_dyn_import_chunk_short_names (cyclomatic 18) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:878— rspack_plugin_esm_library::optimize_chunks::assign_dyn_import_chunk_short_names has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsPlugin::render_rspack_bootstrap (cognitive 128) crates/rspack_plugin_javascript/src/plugin/runtime_context.rs:138— JsPlugin::render_rspack_bootstrap has cognitive complexity 128 (threshold 15). Drivers by points: if/else 44 (104 pts), boolean chains 21, loops 1 (3 pts) (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
JsPlugin::render_webpack_bootstrap (cognitive 116) crates/rspack_plugin_javascript/src/plugin/mod.rs:261— JsPlugin::render_webpack_bootstrap has cognitive complexity 116 (threshold 15). Drivers by points: if/else 40 (98 pts), boolean chains 15, loops 1 (3 pts) (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
JsPlugin::render_rspack_main (cognitive 84) crates/rspack_plugin_javascript/src/plugin/runtime_context.rs:633— JsPlugin::render_rspack_main has cognitive complexity 84 (threshold 15). Drivers by points: if/else 45 (72 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsPlugin::render_webpack_main (cognitive 82) crates/rspack_plugin_javascript/src/plugin/mod.rs:733— JsPlugin::render_webpack_main has cognitive complexity 82 (threshold 15). Drivers by points: if/else 44 (71 pts), boolean chains 9, loops 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsPlugin::get_renamed_inline_module (cognitive 38) crates/rspack_plugin_javascript/src/plugin/mod.rs:1076— JsPlugin::get_renamed_inline_module has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5, loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsPlugin::render_rspack_require (cognitive 17) crates/rspack_plugin_javascript/src/plugin/runtime_context.rs:25— JsPlugin::render_rspack_require has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_rslib::dyn_import_external::cutout_dyn_import_externals (cognitive 43) crates/rspack_plugin_rslib/src/dyn_import_external.rs:131— rspack_plugin_rslib::dyn_import_external::cutout_dyn_import_externals has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (36 pts), loops 4 (7 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rslib::dyn_import_external::cutout_star_re_export_externals (cognitive 40) crates/rspack_plugin_rslib/src/dyn_import_external.rs:14— rspack_plugin_rslib::dyn_import_external::cutout_star_re_export_externals has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 5 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rslib::isolated_dts::complete_isolated_dts_outputs (cognitive 30) crates/rspack_plugin_rslib/src/isolated_dts.rs:37— rspack_plugin_rslib::isolated_dts::complete_isolated_dts_outputs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rslib::worker_external::cutout_worker_externals (cognitive 30) crates/rspack_plugin_rslib/src/worker_external.rs:26— rspack_plugin_rslib::worker_external::cutout_worker_externals has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 4 (7 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rslib::plugin::render (cognitive 22) crates/rspack_plugin_rslib/src/plugin.rs:271— rspack_plugin_rslib::plugin::render has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rslib::url_external::cutout_url_externals (cognitive 19) crates/rspack_plugin_rslib/src/url_external.rs:34— rspack_plugin_rslib::url_external::cutout_url_externals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResolverGeneric::package_target_resolve (cognitive 41) crates/rspack_resolver/src/lib.rs:2159— ResolverGeneric::package_target_resolve has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (nesting depth added 19). Of this number, 30 points are the body's own statements and 11 belong to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolverGeneric::resolve_in_module_dir (cognitive 31) crates/rspack_resolver/src/lib.rs:932— ResolverGeneric::resolve_in_module_dir has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 1 (nesting depth added 18). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolverGeneric::package_exports_resolve (cognitive 28) crates/rspack_resolver/src/lib.rs:1898— ResolverGeneric::package_exports_resolve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 11). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolverGeneric::package_imports_exports_resolve (cognitive 21) crates/rspack_resolver/src/lib.rs:2070— ResolverGeneric::package_imports_exports_resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 1 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolverGeneric::load_as_directory (cognitive 20) crates/rspack_resolver/src/lib.rs:696— ResolverGeneric::load_as_directory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolverGeneric::package_resolve_in_dir (cognitive 17) crates/rspack_resolver/src/lib.rs:1856— ResolverGeneric::package_resolve_in_dir has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_plugin_rsc::reference_manifest::build_server_manifest_per_entry (cognitive 24) crates/rspack_plugin_rsc/src/reference_manifest.rs:113— rspack_plugin_rsc::reference_manifest::build_server_manifest_per_entry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (8 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsc::client_plugin::record_chunk_group (cognitive 22) crates/rspack_plugin_rsc/src/client_plugin.rs:248— rspack_plugin_rsc::client_plugin::record_chunk_group has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsc::server_plugin::group_client_entries_by_owner (cognitive 22) crates/rspack_plugin_rsc/src/server_plugin.rs:96— rspack_plugin_rsc::server_plugin::group_client_entries_by_owner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsc::loaders::action_entry_loader::parse_action_entries (cognitive 21) crates/rspack_plugin_rsc/src/loaders/action_entry_loader.rs:41— rspack_plugin_rsc::loaders::action_entry_loader::parse_action_entries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (8 pts), loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsc::component_info::add_client_import (cognitive 18) crates/rspack_plugin_rsc/src/component_info.rs:377— rspack_plugin_rsc::component_info::add_client_import has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsc::client_plugin::collect_server_entry_css_files (cognitive 17) crates/rspack_plugin_rsc/src/client_plugin.rs:173— rspack_plugin_rsc::client_plugin::collect_server_entry_css_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rspack_binding_api/src/async_dependency_block.rs:144— crates/rspack_binding_api/src/async_dependency_block.rs:144-173 | crates/rspack_binding_api/src/chunk.rs:380-409 | crates/rspack_binding_api/src/chunk_group.rs:223-252 | crates/rspack_binding_api/src/module_graph_connection.rs:224-254 — 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/rspack_binding_api/src/chunk.rs:95— crates/rspack_binding_api/src/chunk.rs:95-104 | crates/rspack_binding_api/src/chunk.rs:129-139 | crates/rspack_binding_api/src/chunk.rs:142-151 | crates/rspack_binding_api/src/chunk.rs:207-216 — 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/rspack_plugin_esm_library/src/optimize_chunks.rs:27— crates/rspack_plugin_esm_library/src/optimize_chunks.rs:27-264 | crates/rspack_plugin_esm_library/src/optimize_chunks.rs:569-801 | crates/rspack_plugin_rslib/src/dyn_import_external.rs:135-191 | crates/rspack_plugin_rslib/src/worker_external.rs:30-70 — 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/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:285— crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:285-343 | crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:134-161 | crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:117-144 | crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs:106-133 — 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:171— crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:171-244 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:298-344 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:354-421 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:431-492 — 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/rspack_plugin_library/src/amd_library_plugin.rs:79— crates/rspack_plugin_library/src/amd_library_plugin.rs:79-85 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:62-68 | crates/rspack_plugin_library/src/system_library_plugin.rs:67-73 | crates/rspack_plugin_library/src/umd_library_plugin.rs:87-93 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×6
Edited copy of a member (21 corresponding lines) crates/rspack_allocative/src/impls/rspack.rs:50— crates/rspack_allocative/src/impls/rspack.rs:50-70 | crates/rspack_allocative/src/impls/rspack.rs:175-196 — 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/rspack_macros/src/rspack_hash.rs:77— crates/rspack_macros/src/rspack_hash.rs:77-97 | crates/rspack_macros/src/rspack_hash.rs:99-123 — 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/rspack_binding_api/src/plugins/js_hooks_plugin.rs:422— crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs:422-451 | crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs:481-501 — 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/css-module-lexer/src/dependencies.rs:2459— crates/css-module-lexer/src/dependencies.rs:2459-2482 | crates/css-module-lexer/src/dependencies.rs:2488-2508 — 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/rspack_plugin_wasm/src/runtime.rs:108— crates/rspack_plugin_wasm/src/runtime.rs:108-128 | crates/rspack_plugin_wasm/src/runtime.rs:155-175 — 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/rspack_plugin_extract_css/src/plugin.rs:766— crates/rspack_plugin_extract_css/src/plugin.rs:766-787 | crates/rspack_plugin_mf/src/container/module_federation_runtime_plugin.rs:141-161 — 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 (14 corresponding lines) · ×6
Edited copy of a member (14 corresponding lines) crates/rspack_core/src/resolver/resolver_impl.rs:194— crates/rspack_core/src/resolver/resolver_impl.rs:194-207 | crates/rspack_core/src/resolver/resolver_impl.rs:216-239 — 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/rspack_core/src/runtime.rs:270— crates/rspack_core/src/runtime.rs:270-284 | crates/rspack_core/src/runtime.rs:290-303 — 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/rspack_binding_api/src/module_graph.rs:70— crates/rspack_binding_api/src/module_graph.rs:70-85 | crates/rspack_binding_api/src/module_graph.rs:281-294 — 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/rspack_binding_api/src/virtual_modules/fs.rs:112— crates/rspack_binding_api/src/virtual_modules/fs.rs:112-125 | crates/rspack_binding_api/src/virtual_modules/fs.rs:127-140 — 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/css-module-lexer/src/dependencies.rs:2037— crates/css-module-lexer/src/dependencies.rs:2037-2057 | crates/css-module-lexer/src/dependencies.rs:2060-2073 — 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/rspack_plugin_javascript/src/magic_comment.rs:225— crates/rspack_plugin_javascript/src/magic_comment.rs:225-238 | crates/rspack_plugin_javascript/src/magic_comment.rs:240-253 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) crates/rspack_plugin_extract_css/src/runtime.rs:417— crates/rspack_plugin_extract_css/src/runtime.rs:417-433 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:388-404 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_extract_css/src/runtime.rs:417` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_extract_css/src/runtime.rs:451— crates/rspack_plugin_extract_css/src/runtime.rs:451-467 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:420-436 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_extract_css/src/runtime.rs:451` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/parser_plugin/compatibility_plugin.rs:200— crates/rspack_plugin_javascript/src/parser_plugin/compatibility_plugin.rs:200-216 | crates/rspack_plugin_javascript/src/parser_plugin/compatibility_plugin.rs:283-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/rspack_plugin_mf/src/container/remote_module.rs:66— crates/rspack_plugin_mf/src/container/remote_module.rs:66-82 | crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs:76-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_mf/src/container/remote_module.rs:66` 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:101— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:101-117 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:105-121 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:101` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/rspack_util/src/time.rs:33— crates/rspack_util/src/time.rs:33-49 | crates/rspack_watcher/src/time.rs:29-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_util/src/time.rs:33` 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/rspack_util/src/time.rs:32` calls `is_multiple_of` and `crates/rspack_watcher/src/time.rs:28` 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 × 3) crates/rspack_core/src/context_module.rs:1067— crates/rspack_core/src/context_module.rs:1067-1074 | crates/rspack_core/src/context_module.rs:1145-1152 | crates/rspack_core/src/context_module.rs:1255-1262 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_core/src/context_module.rs:1067` it begins part-way through the construct above it, so those exact lines 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/rspack_core/src/options/module.rs:1363— crates/rspack_core/src/options/module.rs:1363-1370 | crates/rspack_core/src/options/module.rs:1406-1413 | crates/rspack_core/src/options/module.rs:1652-1659 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_core/src/options/module.rs:1363` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:248— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:248-255 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:177-184 | crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1472-1479 — before extracting anything, compare `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs` and `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:248` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:769— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:769-776 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:864-871 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:914-921 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:769` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:164— crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:164-171 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:199-206 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:206-213 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:106— crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:106-113 | crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:178-185 | crates/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:205-212 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_plugin_javascript/src/visitors/dependency/context_dependency_helper.rs:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
JsPlugin::render_rspack_bootstrap (cyclomatic 60) crates/rspack_plugin_javascript/src/plugin/runtime_context.rs:138— JsPlugin::render_rspack_bootstrap has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsPlugin::render_webpack_bootstrap (cyclomatic 51) crates/rspack_plugin_javascript/src/plugin/mod.rs:261— JsPlugin::render_webpack_bootstrap has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsPlugin::render_rspack_main (cyclomatic 45) crates/rspack_plugin_javascript/src/plugin/runtime_context.rs:633— JsPlugin::render_rspack_main has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsPlugin::render_webpack_main (cyclomatic 43) crates/rspack_plugin_javascript/src/plugin/mod.rs:733— JsPlugin::render_webpack_main has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsPlugin::get_renamed_inline_module (cyclomatic 23) crates/rspack_plugin_javascript/src/plugin/mod.rs:1076— JsPlugin::get_renamed_inline_module has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SplitChunksPlugin::inner_impl (cognitive 160) crates/rspack_plugin_split_chunks/src/plugin/mod.rs:93— SplitChunksPlugin::inner_impl has cognitive complexity 160 (threshold 15). Drivers by points: if/else 27 (80 pts), loops 14 (53 pts), match/switch 5 (16 pts), boolean chains 11 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SplitChunksPlugin::prepare_module_group_map (cognitive 95) crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:1034— SplitChunksPlugin::prepare_module_group_map has cognitive complexity 95 (threshold 15). Drivers by points: if/else 31 (69 pts), match/switch 3 (10 pts), loops 5 (9 pts), boolean chains 7 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SplitChunksPlugin::ensure_max_size_fit (cognitive 76) crates/rspack_plugin_split_chunks/src/plugin/max_size.rs:477— SplitChunksPlugin::ensure_max_size_fit has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (61 pts), loops 4 (8 pts), boolean chains 7 (nesting depth added 38). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
SplitChunksPlugin::prepare_native_cache_group_matches (cognitive 57) crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:922— SplitChunksPlugin::prepare_native_cache_group_matches has cognitive complexity 57 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 8 (20 pts), match/switch 1 (5 pts), boolean chains 2 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SplitChunksPlugin::check_min_size_reduction_for_module_chunks (cognitive 18) crates/rspack_plugin_split_chunks/src/plugin/min_size.rs:182— SplitChunksPlugin::check_min_size_reduction_for_module_chunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_split_chunks::plugin::max_size::deterministic_grouping (cognitive 55) crates/rspack_plugin_split_chunks/src/plugin/max_size.rs:279— rspack_plugin_split_chunks::plugin::max_size::deterministic_grouping has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 6 (20 pts), boolean chains 4 (nesting depth added 33). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_plugin_split_chunks::plugin::intersections::collect_intersections (cognitive 47) crates/rspack_plugin_split_chunks/src/plugin/intersections.rs:158— rspack_plugin_split_chunks::plugin::intersections::collect_intersections has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (31 pts), loops 8 (13 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_split_chunks::plugin::intersections::discover_intersections (cognitive 41) crates/rspack_plugin_split_chunks/src/plugin/intersections.rs:68— rspack_plugin_split_chunks::plugin::intersections::discover_intersections has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_split_chunks::plugin::module_group::process_name_requests (cognitive 17) crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:272— rspack_plugin_split_chunks::plugin::module_group::process_name_requests has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 1 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rspack_plugin_split_chunks::plugin::max_size::remove_problematic_nodes (cognitive 16) crates/rspack_plugin_split_chunks/src/plugin/max_size.rs:150— rspack_plugin_split_chunks::plugin::max_size::remove_problematic_nodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_plugin_sri::asset::process_chunks (cognitive 31) crates/rspack_plugin_sri/src/asset.rs:40— rspack_plugin_sri::asset::process_chunks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_sri::manifest::strongly_connected_components (cognitive 31) crates/rspack_plugin_sri/src/manifest.rs:478— rspack_plugin_sri::manifest::strongly_connected_components has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_sri::asset::digest_chunks (cognitive 29) crates/rspack_plugin_sri/src/asset.rs:206— rspack_plugin_sri::asset::digest_chunks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 3 (7 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_sri::manifest::available_chunks (cognitive 20) crates/rspack_plugin_sri/src/manifest.rs:46— rspack_plugin_sri::manifest::available_chunks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_sri::html::process_tag (cognitive 17) crates/rspack_plugin_sri/src/html.rs:159— rspack_plugin_sri::html::process_tag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×5
Edited copy of a member (22 corresponding lines) crates/rspack_napi/src/threadsafe_function.rs:169— crates/rspack_napi/src/threadsafe_function.rs:169-190 | crates/rspack_napi/src/threadsafe_function.rs:212-235 — 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/rspack_core/src/options/module.rs:1340— crates/rspack_core/src/options/module.rs:1340-1373 | crates/rspack_core/src/options/module.rs:1395-1416 — 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/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2252— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2252-2282 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2290-2311 — 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/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:82— crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:82-109 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:115-136 — 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/rspack_util/src/time.rs:27— crates/rspack_util/src/time.rs:27-49 | crates/rspack_watcher/src/time.rs:24-45 — 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 (20 corresponding lines) · ×5
Edited copy of a member (20 corresponding lines) crates/rspack_plugin_split_chunks/src/plugin/bitmap.rs:48— crates/rspack_plugin_split_chunks/src/plugin/bitmap.rs:48-69 | crates/rspack_plugin_split_chunks/src/plugin/bitmap.rs:78-97 — 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/rspack_core/src/utils/mod.rs:146— crates/rspack_core/src/utils/mod.rs:146-165 | crates/rspack_core/src/utils/mod.rs:173-197 — 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/rspack_plugin_javascript/src/parser_plugin/import_meta_path.rs:227— crates/rspack_plugin_javascript/src/parser_plugin/import_meta_path.rs:227-246 | crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:84-103 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1096— crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1096-1115 | crates/rspack_plugin_javascript/src/parser_plugin/side_effects_parser_plugin.rs:1199-1218 — 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/rspack_resolver/src/lib.rs:651— crates/rspack_resolver/src/lib.rs:651-670 | crates/rspack_resolver/src/lib.rs:1191-1215 — 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) · ×5
Edited copy of a member (6 corresponding lines) crates/rspack_plugin_extract_css/src/css_module.rs:186— crates/rspack_plugin_extract_css/src/css_module.rs:186-191 | crates/rspack_plugin_lazy_compilation/src/module.rs:388-394 — 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/rspack_napi/src/js_values/one_shot_value_ref.rs:30— crates/rspack_napi/src/js_values/one_shot_value_ref.rs:30-37 | crates/rspack_napi/src/js_values/threadsafe_one_shot_value_ref.rs:193-198 — 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/rspack_binding_api/src/modules/concatenated_module.rs:9— crates/rspack_binding_api/src/modules/concatenated_module.rs:9-16 | crates/rspack_binding_api/src/modules/normal_module.rs:14-19 — 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/rspack_cacheable/src/with/as_tuple2.rs:40— crates/rspack_cacheable/src/with/as_tuple2.rs:40-45 | crates/rspack_cacheable/src/with/as_tuple3.rs:45-51 — 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/rspack_cacheable/src/with/as_tuple2.rs:58— crates/rspack_cacheable/src/with/as_tuple2.rs:58-63 | crates/rspack_cacheable/src/with/as_tuple3.rs:66-72 — 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.
Duplicated block (22 lines × 2) crates/rspack_core/src/stats/mod.rs:1640— crates/rspack_core/src/stats/mod.rs:1640-1661 | crates/rspack_core/src/stats/mod.rs:1757-1778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/mod.rs:1640` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:325— crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:325-346 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:394-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/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:324` calls `get_exports_info` and `crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:393` 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/rspack_plugin_javascript/src/runtime_context.rs:223— crates/rspack_plugin_javascript/src/runtime_context.rs:223-244 | crates/rspack_plugin_javascript/src/runtime_context.rs:519-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1095— crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1095-1116 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:1286-1307 — both copies are in the same file, so extract the 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 (22 lines × 2) crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:78— crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:78-99 | crates/rspack_plugin_runtime/src/module_chunk_format.rs:86-107 — before extracting anything, compare `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs` and `crates/rspack_plugin_runtime/src/module_chunk_format.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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/css-module-lexer/src/dependencies.rs:2846— crates/css-module-lexer/src/dependencies.rs:2846-2864 | crates/css-module-lexer/src/dependencies.rs:3045-3063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2846` it does not close everything it opens, so those exact lines 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/css-module-lexer/src/lexer.rs:1497— crates/css-module-lexer/src/lexer.rs:1497-1515 | crates/css-module-lexer/src/lexer.rs:1588-1606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/lexer.rs:1497` it does not close everything it opens, so those exact lines 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/rspack_loader_swc/src/rsc_transforms/server_actions.rs:437— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:437-455 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:599-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:437` 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/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:516— crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:516-534 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:542-560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:516` it begins part-way through the construct above it, so those exact lines 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/rspack_dojang/src/eval.rs:281— crates/rspack_dojang/src/eval.rs:281-299 | crates/rspack_dojang/src/eval.rs:341-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_dojang/src/eval.rs:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/css-module-lexer/src/dependencies.rs:2918— crates/css-module-lexer/src/dependencies.rs:2918-2926 | crates/css-module-lexer/src/dependencies.rs:3125-3134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2918` 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–10 lines × 2) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2591— crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2591-2599 | crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2612-2621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:2591` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:286— crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:286-294 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:361-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/rspack_plugin_rslib/src/dyn_import_external.rs:136— crates/rspack_plugin_rslib/src/dyn_import_external.rs:136-144 | crates/rspack_plugin_rslib/src/worker_external.rs:31-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_rslib/src/dyn_import_external.rs:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:252— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:252-260 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:263-272 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2 locations) packages/rspack/src/ChunkGraph.ts:7— packages/rspack/src/ChunkGraph.ts:7 · packages/rspack/src/ChunkGraph.ts:27 — 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 (15 lines × 2 locations) packages/rspack/src/loader-runner/index.ts:545— packages/rspack/src/loader-runner/index.ts:545 · packages/rspack/src/loader-runner/worker.ts:131 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (15 lines × 2 locations) packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:118— packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:118 · packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:287 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (15 lines × 2 locations) packages/rspack/src/taps/compilation.ts:370— packages/rspack/src/taps/compilation.ts:370 · packages/rspack/src/taps/compilation.ts: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.
Duplicated block (15 lines × 2 locations) packages/rspack/src/trace/traceHookPlugin.ts:49— packages/rspack/src/trace/traceHookPlugin.ts:49 · packages/rspack/src/trace/traceHookPlugin.ts:82 — 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.
SplitChunksPlugin::inner_impl (cyclomatic 57) crates/rspack_plugin_split_chunks/src/plugin/mod.rs:93— SplitChunksPlugin::inner_impl has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SplitChunksPlugin::prepare_module_group_map (cyclomatic 44) crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:1034— SplitChunksPlugin::prepare_module_group_map has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SplitChunksPlugin::ensure_max_size_fit (cyclomatic 33) crates/rspack_plugin_split_chunks/src/plugin/max_size.rs:477— SplitChunksPlugin::ensure_max_size_fit has cyclomatic complexity 33 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
SplitChunksPlugin::prepare_native_cache_group_matches (cyclomatic 21) crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:922— SplitChunksPlugin::prepare_native_cache_group_matches has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_runtime::runtime_plugin::runtime_requirements_in_tree (cyclomatic 49) crates/rspack_plugin_runtime/src/runtime_plugin.rs:157— rspack_plugin_runtime::runtime_plugin::runtime_requirements_in_tree has cyclomatic complexity 49 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
rspack_plugin_runtime::module_chunk_loading::runtime_requirements_in_tree (cyclomatic 22) crates/rspack_plugin_runtime/src/module_chunk_loading.rs:47— rspack_plugin_runtime::module_chunk_loading::runtime_requirements_in_tree has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_runtime::common_js_chunk_loading::runtime_requirements_in_tree (cyclomatic 21) crates/rspack_plugin_runtime/src/common_js_chunk_loading.rs:57— rspack_plugin_runtime::common_js_chunk_loading::runtime_requirements_in_tree has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_runtime::module_chunk_format::render_chunk (cyclomatic 20) crates/rspack_plugin_runtime/src/module_chunk_format.rs:137— rspack_plugin_runtime::module_chunk_format::render_chunk has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ESMExportImportedSpecifierDependency::add_export_fragments (cyclomatic 26) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:545— ESMExportImportedSpecifierDependency::add_export_fragments has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ESMExportImportedSpecifierDependency::get_conflicting_star_exports_errors (cyclomatic 22) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1069— ESMExportImportedSpecifierDependency::get_conflicting_star_exports_errors has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ESMExportImportedSpecifierDependency::get_star_reexports (cyclomatic 21) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:325— ESMExportImportedSpecifierDependency::get_star_reexports has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ESMExportImportedSpecifierDependency::get_mode_inner (cyclomatic 17) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:163— ESMExportImportedSpecifierDependency::get_mode_inner has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_ids::named_chunk_ids_plugin::assign_named_chunk_ids (cyclomatic 22) crates/rspack_ids/src/named_chunk_ids_plugin.rs:19— rspack_ids::named_chunk_ids_plugin::assign_named_chunk_ids has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_ids::named_module_ids_plugin::assign_named_module_ids (cyclomatic 22) crates/rspack_ids/src/named_module_ids_plugin.rs:33— rspack_ids::named_module_ids_plugin::assign_named_module_ids has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_ids::named_module_ids_plugin::module_ids (cyclomatic 20) crates/rspack_ids/src/named_module_ids_plugin.rs:194— rspack_ids::named_module_ids_plugin::module_ids has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_ids::named_chunk_ids_plugin::chunk_ids (cyclomatic 19) crates/rspack_ids/src/named_chunk_ids_plugin.rs:240— rspack_ids::named_chunk_ids_plugin::chunk_ids has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PathManager::collect_time_info_entries (cyclomatic 19) crates/rspack_watcher/src/paths.rs:1055— PathManager::collect_time_info_entries has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PathManager::scan_below (cyclomatic 18) crates/rspack_watcher/src/paths.rs:589— PathManager::scan_below has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PathManager::set_context_entry (cyclomatic 16) crates/rspack_watcher/src/paths.rs:693— PathManager::set_context_entry has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PathManager::update (cyclomatic 16) crates/rspack_watcher/src/paths.rs:883— PathManager::update has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConcatenatedModule::code_generation (cognitive 174) crates/rspack_core/src/concatenated_module.rs:887— ConcatenatedModule::code_generation has cognitive complexity 174 (threshold 15). Drivers by points: if/else 56 (132 pts), loops 18 (31 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 91). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ConcatenatedModule::get_final_binding (cognitive 38) crates/rspack_core/src/concatenated_module.rs:2499— ConcatenatedModule::get_final_binding has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 6 (12 pts), boolean chains 3 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ConcatenatedModule::enter_module (cognitive 24) crates/rspack_core/src/concatenated_module.rs:1973— ConcatenatedModule::enter_module has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcatenatedModule::is_missing_star_export (cognitive 22) crates/rspack_core/src/concatenated_module.rs:2318— ConcatenatedModule::is_missing_star_export has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleConcatenationPlugin::optimize_chunk_modules_impl (cognitive 82) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1048— ModuleConcatenationPlugin::optimize_chunk_modules_impl has cognitive complexity 82 (threshold 15). Drivers by points: if/else 30 (44 pts), loops 17 (24 pts), boolean chains 9, match/switch 2 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleConcatenationPlugin::compute_incoming_modules (cognitive 62) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:682— ModuleConcatenationPlugin::compute_incoming_modules has cognitive complexity 62 (threshold 15). Drivers by points: if/else 19 (50 pts), loops 5 (12 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleConcatenationPlugin::try_to_add (cognitive 22) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:855— ModuleConcatenationPlugin::try_to_add has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ModuleConcatenationPlugin::get_imports (cognitive 20) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:584— ModuleConcatenationPlugin::get_imports has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ESMExportImportedSpecifierDependency::get_conflicting_star_exports_errors (cognitive 51) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1069— ESMExportImportedSpecifierDependency::get_conflicting_star_exports_errors has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (47 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ESMExportImportedSpecifierDependency::add_export_fragments (cognitive 44) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:545— ESMExportImportedSpecifierDependency::add_export_fragments has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ESMExportImportedSpecifierDependency::get_star_reexports (cognitive 43) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:325— ESMExportImportedSpecifierDependency::get_star_reexports has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ESMExportImportedSpecifierDependency::get_mode_inner (cognitive 27) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:163— ESMExportImportedSpecifierDependency::get_mode_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 3 (9 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_devtool::module_filename_helpers::template_replace (cognitive 47) crates/rspack_plugin_devtool/src/module_filename_helpers.rs:522— rspack_plugin_devtool::module_filename_helpers::template_replace has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_devtool::eval_source_map_dev_tool_plugin::render_module_content (cognitive 29) crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:94— rspack_plugin_devtool::eval_source_map_dev_tool_plugin::render_module_content has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_devtool::source_map_dev_tool_plugin::process_assets (cognitive 23) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:1204— rspack_plugin_devtool::source_map_dev_tool_plugin::process_assets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_devtool::eval_dev_tool_module_plugin::encode_uri (cognitive 17) crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:261— rspack_plugin_devtool::eval_dev_tool_module_plugin::encode_uri has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathManager::scan_below (cognitive 39) crates/rspack_watcher/src/paths.rs:589— PathManager::scan_below has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathManager::collect_time_info_entries (cognitive 35) crates/rspack_watcher/src/paths.rs:1055— PathManager::collect_time_info_entries has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 9 (14 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathManager::update (cognitive 25) crates/rspack_watcher/src/paths.rs:883— PathManager::update has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 7, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathManager::set_context_entry (cognitive 17) crates/rspack_watcher/src/paths.rs:693— PathManager::set_context_entry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChunkGraph::get_runtime_chunk_dependent_chunks_iterable (cognitive 36) crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:778— ChunkGraph::get_runtime_chunk_dependent_chunks_iterable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 6 (14 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkGraph::integrate_chunks (cognitive 23) crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:1014— ChunkGraph::integrate_chunks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkGraph::get_chunk_entry_dependent_chunks_iterable (cognitive 16) crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:839— ChunkGraph::get_chunk_entry_dependent_chunks_iterable has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 2 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ChunkGraph::can_chunks_be_integrated (cognitive 16) crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:883— ChunkGraph::can_chunks_be_integrated has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GraphicalReportHandler::render_snippets (cognitive 35) crates/rspack_error/src/displayer/renderer/graphical.rs:284— GraphicalReportHandler::render_snippets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 22). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
GraphicalReportHandler::render_context (cognitive 20) crates/rspack_error/src/displayer/renderer/graphical.rs:347— GraphicalReportHandler::render_context has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
GraphicalReportHandler::render_causes (cognitive 16) crates/rspack_error/src/displayer/renderer/graphical.rs:171— GraphicalReportHandler::render_causes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
GraphicalReportHandler::render_single_line_highlights (cognitive 16) crates/rspack_error/src/displayer/renderer/graphical.rs:634— GraphicalReportHandler::render_single_line_highlights has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (8 pts) (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
CommonJsImportsParserPlugin::call (cognitive 26) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2530— CommonJsImportsParserPlugin::call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommonJsImportsParserPlugin::require_handler (cognitive 19) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1913— CommonJsImportsParserPlugin::require_handler has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CommonJsImportsParserPlugin::finish (cognitive 18) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2796— CommonJsImportsParserPlugin::finish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommonJsImportsParserPlugin::declarator (cognitive 17) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2106— CommonJsImportsParserPlugin::declarator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_library::umd_library_plugin::render (cognitive 26) crates/rspack_plugin_library/src/umd_library_plugin.rs:96— rspack_plugin_library::umd_library_plugin::render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_library::assign_library_plugin::render_startup (cognitive 18) crates/rspack_plugin_library/src/assign_library_plugin.rs:244— rspack_plugin_library::assign_library_plugin::render_startup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_library::export_property_library_plugin::finish_modules (cognitive 16) crates/rspack_plugin_library/src/export_property_library_plugin.rs:114— rspack_plugin_library::export_property_library_plugin::finish_modules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_library::module_library_plugin::render_startup (cognitive 16) crates/rspack_plugin_library/src/module_library_plugin.rs:58— rspack_plugin_library::module_library_plugin::render_startup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Chunk::get_all_async_chunks (cognitive 25) crates/rspack_core/src/chunk.rs:627— Chunk::get_all_async_chunks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 12). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 2 function items inside it that branch (add_to_queue, add_chunks). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Chunk::has_async_chunks (cognitive 23) crates/rspack_core/src/chunk.rs:550— Chunk::has_async_chunks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (7 pts) (nesting depth added 11). Of this number, 13 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Chunk::get_child_ids_by_order (cognitive 23) crates/rspack_core/src/chunk.rs:882— Chunk::get_child_ids_by_order has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Chunk::update_hash (cognitive 16) crates/rspack_core/src/chunk.rs:740— Chunk::update_hash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×4
Edited copy of a member (34 corresponding lines) crates/rspack_plugin_rstest/src/parser_plugin.rs:1294— crates/rspack_plugin_rstest/src/parser_plugin.rs:1294-1327 | crates/rspack_plugin_rstest/src/parser_plugin.rs:1334-1377 — 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/rspack_hash/src/lib.rs:461— crates/rspack_hash/src/lib.rs:461-497 | crates/rspack_hash/src/lib.rs:499-532 — 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/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:746— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:746-779 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:841-878 — 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/rspack_core/src/context_module.rs:1158— crates/rspack_core/src/context_module.rs:1158-1197 | crates/rspack_core/src/context_module.rs:1268-1301 — 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 (24 corresponding lines) · ×4
Edited copy of a member (24 corresponding lines) crates/rspack_binding_api/src/lib.rs:188— crates/rspack_binding_api/src/lib.rs:188-211 | crates/rspack_binding_api/src/lib.rs:216-239 — 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/rspack_plugin_swc_js_minimizer/src/lib.rs:75— crates/rspack_plugin_swc_js_minimizer/src/lib.rs:75-100 | crates/rspack_plugin_swc_js_minimizer/src/lib.rs:104-127 — 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/rspack_core/src/compiler/mod.rs:256— crates/rspack_core/src/compiler/mod.rs:256-279 | crates/rspack_core/src/compiler/rebuild.rs:23-50 — 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/css-module-lexer/src/lexer.rs:2392— crates/css-module-lexer/src/lexer.rs:2392-2415 | crates/css-module-lexer/src/lexer.rs:2499-2522 — 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· Edited copy of a member (19 corresponding lines) · ×4
Edited copy of a member (19 corresponding lines) crates/rspack_plugin_devtool/src/module_filename_helpers.rs:378— crates/rspack_plugin_devtool/src/module_filename_helpers.rs:378-396 | crates/rspack_plugin_devtool/src/module_filename_helpers.rs:469-490 — 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) linting/rspack_collection_hasher/src/lib.rs:453— linting/rspack_collection_hasher/src/lib.rs:453-471 | linting/rspack_collection_hasher/src/lib.rs:473-504 — 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/rspack_binding_api/src/module.rs:456— crates/rspack_binding_api/src/module.rs:456-475 | crates/rspack_binding_api/src/module.rs:477-495 — 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/rspack_binding_api/src/html.rs:156— crates/rspack_binding_api/src/html.rs:156-174 | crates/rspack_binding_api/src/html.rs:178-196 — 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· Edited copies of one member (3 members, 15+ corresponding lines) · ×4
Edited copies of one member (3 members, 15+ corresponding lines) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:632— crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:632-651 | crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:653-667 | crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:672-694 — 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/css-module-lexer/src/dependencies.rs:2959— crates/css-module-lexer/src/dependencies.rs:2959-2974 | crates/css-module-lexer/src/dependencies.rs:3170-3184 | crates/css-module-lexer/src/dependencies.rs:3186-3200 — 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/rspack_binding_api/src/raw_options/raw_module/mod.rs:636— crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:636-650 | crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:677-692 | crates/rspack_core/src/options/module.rs:731-746 — 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/rspack_binding_api/src/async_dependency_block.rs:68— crates/rspack_binding_api/src/async_dependency_block.rs:68-82 | crates/rspack_binding_api/src/async_dependency_block.rs:85-100 | crates/rspack_binding_api/src/compilation/mod.rs:255-269 — 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, 14+ corresponding lines) · ×4
Edited copies of one member (3 members, 14+ corresponding lines) crates/rspack_resolver/src/file_system.rs:150— crates/rspack_resolver/src/file_system.rs:150-163 | crates/rspack_resolver/src/file_system.rs:165-178 | crates/rspack_resolver/src/file_system.rs:180-199 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/rspack_core/src/runtime_template.rs:1213— crates/rspack_core/src/runtime_template.rs:1213-1230 | crates/rspack_core/src/runtime_template.rs:1301-1314 | crates/rspack_plugin_rstest/src/import_dependency.rs:165-180 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:50— crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:50-66 | crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:43-56 | crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs:40-53 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/rspack_plugin_javascript/src/dependency/context/amd_require_context_dependency.rs:133— crates/rspack_plugin_javascript/src/dependency/context/amd_require_context_dependency.rs:133-146 | crates/rspack_plugin_javascript/src/dependency/context/import_context_dependency.rs:174-187 | crates/rspack_plugin_javascript/src/dependency/context/url_context_dependency.rs:140-153 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×4
Edited copy of a member (7 corresponding lines) crates/rspack_plugin_javascript/src/magic_comment.rs:191— crates/rspack_plugin_javascript/src/magic_comment.rs:191-197 | crates/rspack_plugin_javascript/src/magic_comment.rs:199-205 — 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/rspack_util/src/identifier.rs:81— crates/rspack_util/src/identifier.rs:81-92 | crates/rspack_core/src/utils/identifier.rs:77-83 — 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/rspack_plugin_library/src/system_library_plugin.rs:205— crates/rspack_plugin_library/src/system_library_plugin.rs:205-211 | crates/rspack_plugin_library/src/umd_library_plugin.rs:349-355 — 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/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:62— crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:62-68 | crates/rspack_core/src/chunk_graph/chunk_graph_module.rs:58-64 — 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.
Duplicated block (21 lines × 2) crates/rspack_plugin_esm_library/src/link.rs:86— crates/rspack_plugin_esm_library/src/link.rs:86-106 | crates/rspack_plugin_esm_library/src/link.rs:155-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_esm_library/src/link.rs:86` it begins part-way through the construct above it, so those 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/rspack_plugin_esm_library/src/link.rs:151` calls `key`, `ModuleExternal` and `crates/rspack_plugin_esm_library/src/link.rs:85` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:237— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:237-257 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:166-186 — before extracting anything, compare `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs` and `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) crates/rspack_macros/src/rspack_hash.rs:208— crates/rspack_macros/src/rspack_hash.rs:208-228 | crates/rspack_macros/src/rspack_hash.rs:240-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_macros/src/rspack_hash.rs:208` it begins part-way through the construct above it, so those exact lines 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/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:23— crates/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:23-43 | crates/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:62-83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:23` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/rspack_core/src/chunk.rs:905— crates/rspack_core/src/chunk.rs:905-920 | crates/rspack_core/src/stats/utils.rs:202-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_core/src/chunk.rs:905` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:458— crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:458-473 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:787-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:458` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/rspack_plugin_javascript/src/plugin/infer_async_modules_plugin.rs:135— crates/rspack_plugin_javascript/src/plugin/infer_async_modules_plugin.rs:135-149 | crates/rspack_plugin_javascript/src/plugin/infer_async_modules_plugin.rs:171-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/infer_async_modules_plugin.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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/rspack_plugin_rsc/src/server_plugin.rs:442— crates/rspack_plugin_rsc/src/server_plugin.rs:442-457 | crates/rspack_plugin_rsc/src/server_plugin.rs:536-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_rsc/src/server_plugin.rs:442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:823— crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:823-834 | crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:853-862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:823` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/rspack_core/src/compilation/build_module_graph/mod.rs:72— crates/rspack_core/src/compilation/build_module_graph/mod.rs:72-83 | crates/rspack_core/src/compilation/build_module_graph/module_executor/mod.rs:74-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–12 lines × 2) crates/rspack_plugin_devtool/src/module_filename_helpers.rs:160— crates/rspack_plugin_devtool/src/module_filename_helpers.rs:160-171 | crates/rspack_plugin_devtool/src/module_filename_helpers.rs:200-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/rspack_plugin_devtool/src/module_filename_helpers.rs:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/rspack_plugin_rsc/src/server_plugin.rs:417— crates/rspack_plugin_rsc/src/server_plugin.rs:417-428 | crates/rspack_plugin_rsc/src/server_plugin.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/rspack_plugin_rsc/src/server_plugin.rs:417` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:70— crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:70-81 | crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:81-91 — before extracting anything, compare `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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–12 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1820— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1820-1831 | crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1879-1889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:590— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:590-601 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:902-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:590` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_rstest/src/parser_plugin.rs:362— crates/rspack_plugin_rstest/src/parser_plugin.rs:362-373 | crates/rspack_plugin_rstest/src/plugin.rs:232-242 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_rstest/src/parser_plugin.rs:362` 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 × 3) crates/rspack_binding_api/src/module_graph.rs:196— crates/rspack_binding_api/src/module_graph.rs:196-204 | crates/rspack_binding_api/src/module_graph.rs:225-233 | crates/rspack_binding_api/src/module_graph.rs:254-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 `crates/rspack_binding_api/src/module_graph.rs:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2230— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2230-2238 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2259-2267 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2292-2300 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/rspack_binding_api/src/module_graph.rs:206— crates/rspack_binding_api/src/module_graph.rs:206-214 | crates/rspack_binding_api/src/module_graph.rs:235-243 | crates/rspack_binding_api/src/module_graph.rs:264-272 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_binding_api/src/module_graph.rs:206` 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 × 3) crates/css-module-lexer/src/dependencies.rs:2352— crates/css-module-lexer/src/dependencies.rs:2352-2360 | crates/css-module-lexer/src/dependencies.rs:2923-2931 | crates/css-module-lexer/src/dependencies.rs:3131-3139 — all 3 copies are in the same file, so extract the block into one function there and call 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 after the matched lines, `crates/css-module-lexer/src/dependencies.rs:2932` calls `next_parser_token` and `crates/css-module-lexer/src/dependencies.rs:2361` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) crates/rspack_binding_api/src/exports_info.rs:44— crates/rspack_binding_api/src/exports_info.rs:44-48 | crates/rspack_binding_api/src/exports_info.rs:60-64 | crates/rspack_binding_api/src/exports_info.rs:76-80 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_binding_api/src/exports_info.rs:44` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 3) crates/rspack_tracing/src/perfetto.rs:95— crates/rspack_tracing/src/perfetto.rs:95-100 | crates/rspack_tracing/src/perfetto.rs:126-130 | crates/rspack_tracing/src/perfetto.rs:151-156 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_tracing/src/perfetto.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) crates/rspack_binding_api/src/build_info.rs:76— crates/rspack_binding_api/src/build_info.rs:76-80 | crates/rspack_binding_api/src/build_info.rs:115-119 | crates/rspack_binding_api/src/compilation/chunks.rs:31-35 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/rspack_plugin_dll/src/dll_entry/dll_entry_plugin.rs:38— crates/rspack_plugin_dll/src/dll_entry/dll_entry_plugin.rs:38-44 | crates/rspack_plugin_dynamic_entry/src/lib.rs:133-137 | crates/rspack_plugin_entry/src/lib.rs:53-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack_plugin_dll/src/dll_entry/dll_entry_plugin.rs:34` calls `name` and `crates/rspack_plugin_dynamic_entry/src/lib.rs:132` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2 locations) packages/rspack/src/NativeWatchFileSystem.ts:479— packages/rspack/src/NativeWatchFileSystem.ts:479 · packages/rspack/src/node/NodeWatchFileSystem.ts:308 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) packages/rspack/src/container/ModuleFederationPlugin.ts:101— packages/rspack/src/container/ModuleFederationPlugin.ts:101 · packages/rspack/src/container/ModuleFederationPlugin.ts:118 — 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 (16 lines × 2 locations) packages/rspack/src/loader-runner/index.ts:670— packages/rspack/src/loader-runner/index.ts:670 · packages/rspack/src/loader-runner/worker.ts:264 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:173— packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:173 · packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Unused dependency 'mini-css-extract-plugin' — Declared in tests/rspack-test/configCases/css/css-order-concatenate-modules/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 'mini-css-extract-plugin' — Declared in tests/rspack-test/configCases/css/css-order-reexport/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 'mini-css-extract-plugin' — Declared in tests/rspack-test/configCases/css/css-order2/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 'mini-css-extract-plugin' — Declared in tests/rspack-test/configCases/css/css-order3/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.
ModuleConcatenationPlugin::optimize_chunk_modules_impl (cyclomatic 55) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1048— ModuleConcatenationPlugin::optimize_chunk_modules_impl has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleConcatenationPlugin::compute_incoming_modules (cyclomatic 21) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:682— ModuleConcatenationPlugin::compute_incoming_modules has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleConcatenationPlugin::try_to_add (cyclomatic 17) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:855— ModuleConcatenationPlugin::try_to_add has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerActions::visit_mut_module_items (cognitive 191) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1294— ServerActions::visit_mut_module_items has cognitive complexity 191 (threshold 15). Drivers by points: if/else 41 (111 pts), match/switch 9 (38 pts), loops 9 (31 pts), boolean chains 11 (nesting depth added 121). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ServerActions::visit_mut_function (cognitive 19) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:864— ServerActions::visit_mut_function has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ServerActions::visit_mut_arrow_expr (cognitive 18) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1006— ServerActions::visit_mut_arrow_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
InnerGraphParserPlugin::infer_dependency_usage (cognitive 121) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:109— InnerGraphParserPlugin::infer_dependency_usage has cognitive complexity 121 (threshold 15). Drivers by points: if/else 20 (75 pts), match/switch 5 (24 pts), loops 7 (21 pts), boolean chains 1 (nesting depth added 88). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
InnerGraphParserPlugin::finalize_dependency_usage (cognitive 69) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:261— InnerGraphParserPlugin::finalize_dependency_usage has cognitive complexity 69 (threshold 15). Drivers by points: if/else 20 (51 pts), loops 7 (15 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InnerGraphParserPlugin::block_pre_module_declaration (cognitive 21) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:530— InnerGraphParserPlugin::block_pre_module_declaration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExternalModule::get_source (cognitive 115) crates/rspack_core/src/external_module.rs:716— ExternalModule::get_source has cognitive complexity 115 (threshold 15). Drivers by points: if/else 31 (83 pts), loops 3 (20 pts), boolean chains 7, match/switch 2 (5 pts) (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExternalModule::build (cognitive 20) crates/rspack_core/src/external_module.rs:1237— ExternalModule::build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExternalModule::code_generation (cognitive 18) crates/rspack_core/src/external_module.rs:1321— ExternalModule::code_generation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FlagDependencyUsagePluginProxy::process_referenced_module (cognitive 94) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:435— FlagDependencyUsagePluginProxy::process_referenced_module has cognitive complexity 94 (threshold 15). Drivers by points: if/else 24 (86 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FlagDependencyUsagePluginProxy::apply (cognitive 52) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:64— FlagDependencyUsagePluginProxy::apply has cognitive complexity 52 (threshold 15). Drivers by points: loops 18 (35 pts), if/else 9 (16 pts), boolean chains 1 (nesting depth added 24). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FlagDependencyUsagePluginProxy::process_module (cognitive 16) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:310— FlagDependencyUsagePluginProxy::process_module has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_loader_swc::rsc_transforms::react_server_components::collect_top_level_directives_and_imports (cognitive 75) crates/rspack_loader_swc/src/rsc_transforms/react_server_components.rs:245— rspack_loader_swc::rsc_transforms::react_server_components::collect_top_level_directives_and_imports has cognitive complexity 75 (threshold 15). Drivers by points: match/switch 11 (34 pts), if/else 10 (33 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 49). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_loader_swc::rsc_transforms::server_actions::retain_names_from_declared_idents (cognitive 23) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1964— rspack_loader_swc::rsc_transforms::server_actions::retain_names_from_declared_idents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 14). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_loader_swc::rsc_transforms::server_actions::detect_similar_strings (cognitive 19) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2158— rspack_loader_swc::rsc_transforms::server_actions::detect_similar_strings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts) (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ExportInfoData::get_used (cognitive 46) crates/rspack_core/src/exports/export_info_getter.rs:60— ExportInfoData::get_used has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 3 (11 pts), match/switch 1 (4 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExportInfoData::set_used_conditionally (cognitive 24) crates/rspack_core/src/exports/export_info_setter.rs:131— ExportInfoData::set_used_conditionally has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (7 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportInfoData::set_used (cognitive 17) crates/rspack_core/src/exports/export_info_setter.rs:94— ExportInfoData::set_used has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (7 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsdoctor::chunk_graph::collect_chunk_dependencies (cognitive 39) crates/rspack_plugin_rsdoctor/src/chunk_graph.rs:56— rspack_plugin_rsdoctor::chunk_graph::collect_chunk_dependencies has cognitive complexity 39 (threshold 15). Drivers by points: if/else 5 (22 pts), loops 5 (17 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsdoctor::plugin::optimize_chunk_modules (cognitive 33) crates/rspack_plugin_rsdoctor/src/plugin.rs:368— rspack_plugin_rsdoctor::plugin::optimize_chunk_modules has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 8 (10 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rsdoctor::module_graph::get_esm_export_imported_specifier_target_exports (cognitive 16) crates/rspack_plugin_rsdoctor/src/module_graph.rs:397— rspack_plugin_rsdoctor::module_graph::get_esm_export_imported_specifier_target_exports has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceMapDevToolPlugin::collect_tasks (cognitive 37) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:588— SourceMapDevToolPlugin::collect_tasks has cognitive complexity 37 (threshold 15). Drivers by points: loops 6 (13 pts), match/switch 6 (12 pts), if/else 3 (10 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceMapDevToolPlugin::create_mapped_asset (cognitive 30) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:998— SourceMapDevToolPlugin::create_mapped_asset has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 5 (10 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceMapDevToolPlugin::use_new_cache (cognitive 20) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:446— SourceMapDevToolPlugin::use_new_cache has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextModule::get_lazy_source (cognitive 29) crates/rspack_core/src/context_module.rs:800— ContextModule::get_lazy_source has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ContextModule::get_glob_source (cognitive 20) crates/rspack_core/src/context_module.rs:657— ContextModule::get_glob_source has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ContextModule::get_source_string (cognitive 20) crates/rspack_core/src/context_module.rs:745— ContextModule::get_source_string has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_css::plugin::impl_plugin_for_css_plugin::runtime_requirements_in_tree (cognitive 25) crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:402— rspack_plugin_css::plugin::impl_plugin_for_css_plugin::runtime_requirements_in_tree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 8 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_css::css_syntax::decode_css_escapes (cognitive 22) crates/rspack_plugin_css/src/css_syntax.rs:13— rspack_plugin_css::css_syntax::decode_css_escapes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_css::css_syntax::parse_escape (cognitive 22) crates/rspack_plugin_css/src/css_syntax.rs:95— rspack_plugin_css::css_syntax::parse_escape has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssModuleParser::handle_composes (cognitive 24) crates/rspack_plugin_css/src/parser_and_generator/parser.rs:1223— CssModuleParser::handle_composes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssModuleParser::ensure_local_definition (cognitive 21) crates/rspack_plugin_css/src/parser_and_generator/parser.rs:1133— CssModuleParser::ensure_local_definition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssModuleParser::handle_dependency (cognitive 16) crates/rspack_plugin_css/src/parser_and_generator/parser.rs:504— CssModuleParser::handle_dependency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, match/switch 1 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rspack_watcher::ignored::glob_to_regexp (cognitive 23) crates/rspack_watcher/src/ignored.rs:63— rspack_watcher::ignored::glob_to_regexp has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_watcher::executor::create_execute_aggregate_task (cognitive 19) crates/rspack_watcher/src/executor.rs:313— rspack_watcher::executor::create_execute_aggregate_task has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_watcher::executor::create_execute_task (cognitive 17) crates/rspack_watcher/src/executor.rs:275— rspack_watcher::executor::create_execute_task has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (7 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_loader_runner::runner::run_loaders_impl (cognitive 21) crates/rspack_loader_runner/src/runner.rs:257— rspack_loader_runner::runner::run_loaders_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_loader_runner::chain::plan_loader_chains (cognitive 20) crates/rspack_loader_runner/src/chain.rs:160— rspack_loader_runner::chain::plan_loader_chains has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_loader_runner::scheme::get_scheme (cognitive 17) crates/rspack_loader_runner/src/scheme.rs:89— rspack_loader_runner::scheme::get_scheme has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×3
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×3
Change coupling clique: context_module.rs, external_module.rs, normal_module.rs, raw_module.rs, self_module.rs, runtime_module.rs, delegated_module.rs, css_module.rs, module.rs, container_entry_module.rs, fallback_module.rs, remote_module.rs, consume_shared_module.rs, provide_shared_module.rs crates/rspack_core/src/context_module.rs— 14 files — `crates/rspack_core/src/context_module.rs`, `crates/rspack_core/src/external_module.rs`, `crates/rspack_core/src/normal_module.rs`, `crates/rspack_core/src/raw_module.rs`, `crates/rspack_core/src/self_module.rs`, `crates/rspack_macros/src/runtime_module.rs`, `crates/rspack_plugin_dll/src/dll_reference/delegated_module.rs`, `crates/rspack_plugin_extract_css/src/css_module.rs`, `crates/rspack_plugin_lazy_compilation/src/module.rs`, `crates/rspack_plugin_mf/src/container/container_entry_module.rs`, `crates/rspack_plugin_mf/src/container/fallback_module.rs`, `crates/rspack_plugin_mf/src/container/remote_module.rs`, `crates/rspack_plugin_mf/src/sharing/consume_shared_module.rs`, `crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 91 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling clique: add.rs, process_dependencies.rs, entry.rs crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/add.rs— 3 files — `crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/add.rs`, `crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/process_dependencies.rs`, `crates/rspack_core/src/compilation/build_module_graph/module_executor/entry.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling clique: IgnorePlugin.ts, RsdoctorPlugin.ts, SubresourceIntegrityPlugin.ts, options.ts packages/rspack/src/builtin-plugin/IgnorePlugin.ts— 4 files — `packages/rspack/src/builtin-plugin/IgnorePlugin.ts`, `packages/rspack/src/builtin-plugin/RsdoctorPlugin.ts`, `packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts`, `packages/rspack/src/builtin-plugin/html-plugin/options.ts` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change-coupling hub: binding.d.ts → rspack.wasi-browser.js, async_dependency_block.rs, chunk.rs, chunk_graph.rs, entries.rs, dependency.rs, context.rs, mod.rs, raw_banner.rs, raw_copy.rs, raw_devtool.rs, mod.rs, raw_external.rs, raw_optimization.rs, raw_output.rs, mod.rs, compiler_options.rs, mod.rs, externals.rs, struct.rs, lib.rs, cache_group.rs crates/node_binding/binding.d.ts— `crates/node_binding/binding.d.ts` changes together with 22 other files — `crates/node_binding/rspack.wasi-browser.js`, `crates/rspack_binding_api/src/async_dependency_block.rs`, `crates/rspack_binding_api/src/chunk.rs`, `crates/rspack_binding_api/src/chunk_graph.rs`, `crates/rspack_binding_api/src/compilation/entries.rs`, `crates/rspack_binding_api/src/dependency.rs`, `crates/rspack_binding_api/src/plugins/js_loader/context.rs`, `crates/rspack_binding_api/src/raw_options/mod.rs`, `crates/rspack_binding_api/src/raw_options/raw_builtins/raw_banner.rs`, `crates/rspack_binding_api/src/raw_options/raw_builtins/raw_copy.rs`, `crates/rspack_binding_api/src/raw_options/raw_devtool.rs`, `crates/rspack_binding_api/src/raw_options/raw_experiments/mod.rs`, `crates/rspack_binding_api/src/raw_options/raw_external.rs`, `crates/rspack_binding_api/src/raw_options/raw_optimization.rs`, `crates/rspack_binding_api/src/raw_options/raw_output.rs`, `crates/rspack_binding_api/src/raw_options/raw_split_chunks/mod.rs`, `crates/rspack_core/src/options/compiler_options.rs`, `crates/rspack_core/src/options/experiments/mod.rs`, `crates/rspack_core/src/options/externals.rs`, `crates/rspack_core/src/stats/struct.rs`, `crates/rspack_napi/src/lib.rs`, `crates/rspack_plugin_split_chunks/src/options/cache_group.rs` — none of which declares a dependency on it: one file is the hub of 22 separate couplings, not 22 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 22.
Change-coupling hub: esm_export_imported_specifier_dependency.rs → common_js_self_reference_dependency.rs, esm_compatibility_dependency.rs, esm_export_expression_dependency.rs, esm_export_specifier_dependency.rs crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs— `crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs` changes together with 4 other files — `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_self_reference_dependency.rs`, `crates/rspack_plugin_javascript/src/dependency/esm/esm_compatibility_dependency.rs`, `crates/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs`, `crates/rspack_plugin_javascript/src/dependency/esm/esm_export_specifier_dependency.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: wasm_plugin.rs → lib.rs, impl_plugin_for_css_plugin.rs, impl_plugin_for_js_plugin.rs crates/rspack_plugin_wasm/src/wasm_plugin.rs— `crates/rspack_plugin_wasm/src/wasm_plugin.rs` changes together with 3 other files — `crates/rspack_plugin_asset/src/lib.rs`, `crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs`, `crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×3
Edited copies of one member (3 members, 11+ corresponding lines) crates/rspack_dojang/src/context.rs:802— crates/rspack_dojang/src/context.rs:802-812 | crates/rspack_dojang/src/context.rs:814-824 | crates/rspack_dojang/src/context.rs:826-836 — 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.
Edited copies of one member (3 members, 11+ corresponding lines) crates/rspack_binding_api/src/raw_options/raw_devtool.rs:38— crates/rspack_binding_api/src/raw_options/raw_devtool.rs:38-48 | crates/rspack_binding_api/src/raw_options/raw_split_chunks/raw_split_chunk_chunks.rs:16-29 | crates/rspack_binding_api/src/raw_options/raw_split_chunks/raw_split_chunk_name.rs:158-168 — 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.
Edited copies of one member (3 members, 11+ corresponding lines) crates/rspack_binding_api/src/fs_node/write.rs:80— crates/rspack_binding_api/src/fs_node/write.rs:80-95 | crates/rspack_binding_api/src/fs_node/write.rs:98-115 | crates/rspack_binding_api/src/fs_node/write.rs:117-127 — 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 copy of a member (29 corresponding lines) · ×3
Edited copy of a member (29 corresponding lines) crates/rspack_core/src/external_module.rs:198— crates/rspack_core/src/external_module.rs:198-226 | crates/rspack_plugin_javascript/src/plugin/api_plugin.rs:42-75 — 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/rspack_plugin_mf/src/container/remote_module.rs:54— crates/rspack_plugin_mf/src/container/remote_module.rs:54-82 | crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs:62-92 — 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/rspack_plugin_javascript/src/utils/mangle_exports.rs:7— crates/rspack_plugin_javascript/src/utils/mangle_exports.rs:7-35 | crates/rspack_plugin_javascript/src/utils/mangle_exports.rs:37-71 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×3
Edited copies of one member (3 members, 12+ corresponding lines) crates/rspack_fs/src/native_fs.rs:157— crates/rspack_fs/src/native_fs.rs:157-169 | crates/rspack_fs/src/native_fs.rs:171-182 | crates/rspack_fs/src/native_fs.rs:221-233 — 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.
Edited copies of one member (3 members, 12+ corresponding lines) crates/css-module-lexer/src/dependencies.rs:1245— crates/css-module-lexer/src/dependencies.rs:1245-1268 | crates/css-module-lexer/src/dependencies.rs:1292-1321 | crates/css-module-lexer/src/dependencies.rs:1353-1364 — 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.
Edited copies of one member (3 members, 12+ corresponding lines) crates/rspack_plugin_dll/src/dll_reference/delegated_plugin.rs:46— crates/rspack_plugin_dll/src/dll_reference/delegated_plugin.rs:46-60 | crates/rspack_plugin_mf/src/container/container_reference_plugin.rs:138-149 | crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs:485-503 — 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.
Duplicated block (24 lines × 2) crates/rspack_plugin_externals/src/http_externals_plugin.rs:49— crates/rspack_plugin_externals/src/http_externals_plugin.rs:49-72 | crates/rspack_plugin_externals/src/http_externals_plugin.rs:87-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_externals/src/http_externals_plugin.rs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:83— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:83-106 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:701-724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `parser` to `&mut JavascriptParser` in one and `&mut JavascriptParser<'p>` 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 (24 lines × 2) crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:699— crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:699-722 | crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:749-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:699` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–22 lines × 2) crates/rspack_binding_api/src/compilation/mod.rs:931— crates/rspack_binding_api/src/compilation/mod.rs:931-952 | crates/rspack_binding_api/src/compilation/mod.rs:1035-1055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/compilation/mod.rs:931` it does not close everything it opens, so those 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/rspack_binding_api/src/compilation/mod.rs:1032` calls `within_compiler_context_sync`, `clone` and `crates/rspack_binding_api/src/compilation/mod.rs:928` 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 (21–22 lines × 2) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:696— crates/rspack_plugin_esm_library/src/optimize_chunks.rs:696-716 | crates/rspack_plugin_esm_library/src/optimize_chunks.rs:759-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_esm_library/src/optimize_chunks.rs:696` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:404— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:404-424 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:450-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:404` 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/rspack_hash/src/lib.rs:258— crates/rspack_hash/src/lib.rs:258-277 | crates/rspack_hash/src/lib.rs:282-301 — both copies are in the same file, so extract the 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1089— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1089-1108 | crates/rspack_plugin_javascript/src/dependency/esm/esm_import_dependency.rs:320-339 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1089` 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/rspack_core/src/compilation/create_hash/mod.rs:170— crates/rspack_core/src/compilation/create_hash/mod.rs:170-189 | crates/rspack_core/src/compilation/create_hash/mod.rs:345-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compilation/create_hash/mod.rs:170` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) crates/rspack_core/src/stats/mod.rs:967— crates/rspack_core/src/stats/mod.rs:967-984 | crates/rspack_core/src/stats/mod.rs:1050-1067 — both copies are in the same file, so extract the block into 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/rspack_plugin_runtime/src/helpers.rs:145— crates/rspack_plugin_runtime/src/helpers.rs:145-162 | crates/rspack_plugin_runtime/src/helpers.rs:173-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_runtime/src/helpers.rs:191` calls `get_runtime_chunk` and `crates/rspack_plugin_runtime/src/helpers.rs:162` 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 (18 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:385— crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:385-402 | crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:402-419 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:113— crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:113-123 | crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:166-178 — before extracting anything, compare `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:123` calls `get_path` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:178` 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–13 lines × 2) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:648— crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:648-658 | crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:717-729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:648` it does not close everything it opens, so those 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–13 lines × 2) crates/rspack_plugin_swc_js_minimizer/src/lib.rs:463— crates/rspack_plugin_swc_js_minimizer/src/lib.rs:463-473 | crates/rspack_plugin_swc_js_minimizer/src/lib.rs:493-505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_swc_js_minimizer/src/lib.rs:463` 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 (10 lines × 3) crates/rspack/src/builder/target.rs:254— crates/rspack/src/builder/target.rs:254-263 | crates/rspack/src/builder/target.rs:357-366 | crates/rspack/src/builder/target.rs:412-421 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:460— crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:460-469 | crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:198-207 | crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_self_reference_dependency.rs:167-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:460` it does not close everything it opens, so those 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/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:195` calls `get_exports_argument`, `get_module_argument` and `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:458` 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/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:188— crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:188-197 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:183-192 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:190-199 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:188` it does not close everything it opens, so those 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:193` calls `insert`, `get_runtime_requirements_with_external_install_chunk` and `crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:198` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) crates/rspack_binding_api/src/module.rs:165— crates/rspack_binding_api/src/module.rs:165-172 | crates/rspack_napi/src/utils.rs:11-19 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_binding_api/src/module.rs:165` it does not close everything it opens, so those 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/rspack_binding_api/src/module.rs:173` calls `from_raw`, `raw`, `coerce_to_string` and `crates/rspack_napi/src/utils.rs:20` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) crates/rspack_cacheable_macros/src/cacheable/impl_with.rs:34— crates/rspack_cacheable_macros/src/cacheable/impl_with.rs:34-41 | crates/rspack_cacheable_macros/src/cacheable_dyn/impl_trait.rs:14-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_cacheable_macros/src/cacheable/impl_with.rs:34` 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 (8–9 lines × 2) crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs:175— crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs:175-182 | crates/rspack_plugin_rsc/src/rsc_entry_module.rs:359-367 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_mf/src/sharing/provide_shared_module.rs:175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crates/rspack_binding_api/src/build_info.rs:160— crates/rspack_binding_api/src/build_info.rs:160-167 | crates/rspack_binding_api/src/build_info.rs:185-192 | crates/rspack_binding_api/src/build_info.rs:210-217 | crates/rspack_binding_api/src/build_info.rs:235-242 — 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/rspack_binding_api/src/build_info.rs:160` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1325— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1325-1332 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1339-1346 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1353-1360 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1374-1381 — 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crates/rspack_napi/src/js_values/one_shot_value_ref.rs:66— crates/rspack_napi/src/js_values/one_shot_value_ref.rs:66-73 | crates/rspack_napi/src/js_values/one_shot_value_ref.rs:77-84 | crates/rspack_napi/src/js_values/threadsafe_one_shot_value_ref.rs:165-172 | crates/rspack_napi/src/js_values/threadsafe_one_shot_value_ref.rs:176-183 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) crates/rspack/src/builder/browserslist_target.rs:125— crates/rspack/src/builder/browserslist_target.rs:125-131 | crates/rspack/src/builder/browserslist_target.rs:166-172 | crates/rspack/src/builder/browserslist_target.rs:223-229 | crates/rspack/src/builder/browserslist_target.rs:244-250 — 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/rspack/src/builder/browserslist_target.rs:125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack/src/builder/browserslist_target.rs:251` calls `Some` and `crates/rspack/src/builder/browserslist_target.rs:132` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) crates/rspack_binding_api/src/chunk.rs:98— crates/rspack_binding_api/src/chunk.rs:98-104 | crates/rspack_binding_api/src/chunk.rs:133-139 | crates/rspack_binding_api/src/chunk.rs:145-151 | crates/rspack_binding_api/src/chunk.rs:210-216 — 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/rspack_binding_api/src/chunk.rs:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:47— crates/rspack_plugin_esm_library/src/optimize_chunks.rs:47-53 | crates/rspack_plugin_esm_library/src/optimize_chunks.rs:578-584 | crates/rspack_plugin_rslib/src/dyn_import_external.rs:139-145 | crates/rspack_plugin_rslib/src/worker_external.rs:35-41 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_esm_library/src/optimize_chunks.rs:47` it does not close everything it opens, so those exact lines 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/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:179— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:179-185 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:210-216 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:256-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 3) crates/rspack_plugin_rstest/src/parser_plugin.rs:247— crates/rspack_plugin_rstest/src/parser_plugin.rs:247-253 | crates/rspack_plugin_rstest/src/parser_plugin.rs:302-308 | crates/rspack_plugin_rstest/src/parser_plugin.rs:630-636 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_plugin_rstest/src/parser_plugin.rs:247` it does not close everything it opens, so those exact lines 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/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:283— crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:283-289 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:254-260 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:265-272 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:273` calls `contains` and `crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:289` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) crates/rspack_macros/src/rspack_hash.rs:146— crates/rspack_macros/src/rspack_hash.rs:146-152 | crates/rspack_macros/src/rspack_hash.rs:172-178 | crates/rspack_macros/src/rspack_hash.rs:221-226 | crates/rspack_macros/src/rspack_hash.rs:253-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 `crates/rspack_macros/src/rspack_hash.rs:146` it begins part-way through the construct above it, so those exact lines 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/rspack_plugin_library/src/amd_library_plugin.rs:80— crates/rspack_plugin_library/src/amd_library_plugin.rs:80-85 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:63-68 | crates/rspack_plugin_library/src/system_library_plugin.rs:68-73 | crates/rspack_plugin_library/src/umd_library_plugin.rs:88-93 — before extracting anything, compare `crates/rspack_plugin_library/src/amd_library_plugin.rs` and `crates/rspack_plugin_library/src/jsonp_library_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 4) crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:157— crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:157-163 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:191-197 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:183-188 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:190-195 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:87— crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:87-92 | crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:172-177 | crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:82-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:94` calls `request_range` and `crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:178` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) crates/rspack_cacheable/src/with/as_preset/lightningcss.rs:34— crates/rspack_cacheable/src/with/as_preset/lightningcss.rs:34-39 | crates/rspack_cacheable/src/with/as_preset/serde_json.rs:35-40 | crates/rspack_cacheable/src/with/as_preset/serde_json.rs:75-80 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `field` to `&Browsers` in one and `&Value` 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 × 3) crates/rspack_binding_api/src/dependency.rs:127— crates/rspack_binding_api/src/dependency.rs:127-132 | crates/rspack_binding_api/src/dependency.rs:136-141 | crates/rspack_binding_api/src/dependency.rs:144-149 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Sync-over-async blocking packages/rspack-cli/src/utils/loadConfig.ts:216— `fs.existsSync` in `loadExtendedConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/rspack-cli/src/utils/loadConfig.ts:261— `fs.existsSync` in `loadRspackConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/rspack/src/builtin-plugin/html-plugin/plugin.ts:134— `fs.existsSync` in `templateFn` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Duplicated block (23 lines × 2 locations) packages/rspack/src/rspackOptionsApply.ts:360— packages/rspack/src/rspackOptionsApply.ts:360 · packages/rspack/src/rspackOptionsApply.ts:388 — 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 (23 lines × 2 locations) packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:240— packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:240 · packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:264 — 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 (23 lines × 2 locations) packages/rspack/src/taps/compilation.ts:459— packages/rspack/src/taps/compilation.ts:459 · packages/rspack/src/taps/javascriptModules.ts:16 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 2 locations) packages/create-rspack/template-vue-js/rspack.config.js:35— packages/create-rspack/template-vue-js/rspack.config.js:35 · packages/create-rspack/template-vue-ts/rspack.config.ts:37 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (19 lines × 2 locations) packages/rspack/src/Compilation.ts:495— packages/rspack/src/Compilation.ts:495 · packages/rspack/src/Compiler.ts:272 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 2 locations) packages/rspack/src/stats/StatsFactory.ts:113— packages/rspack/src/stats/StatsFactory.ts:113 · packages/rspack/src/stats/StatsFactory.ts:134 — 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.
ConcatenatedModule::code_generation (cyclomatic 77) crates/rspack_core/src/concatenated_module.rs:887— ConcatenatedModule::code_generation has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConcatenatedModule::get_final_binding (cyclomatic 32) crates/rspack_core/src/concatenated_module.rs:2499— ConcatenatedModule::get_final_binding has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ExternalModule::get_source (cyclomatic 39) crates/rspack_core/src/external_module.rs:716— ExternalModule::get_source has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExternalModule::build (cyclomatic 16) crates/rspack_core/src/external_module.rs:1237— ExternalModule::build has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleCodeTemplate::export_from_import (cyclomatic 35) crates/rspack_core/src/runtime_template.rs:1369— ModuleCodeTemplate::export_from_import has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleCodeTemplate::module_namespace_promise (cyclomatic 18) crates/rspack_core/src/runtime_template.rs:1598— ModuleCodeTemplate::module_namespace_promise has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InnerGraphParserPlugin::infer_dependency_usage (cyclomatic 34) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:109— InnerGraphParserPlugin::infer_dependency_usage has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InnerGraphParserPlugin::finalize_dependency_usage (cyclomatic 29) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:261— InnerGraphParserPlugin::finalize_dependency_usage has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileSystemInfo::validate_snapshot (cyclomatic 31) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:887— FileSystemInfo::validate_snapshot has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileSystemInfo::read_context (cyclomatic 24) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:721— FileSystemInfo::read_context has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImportParserPlugin::import_call (cyclomatic 31) crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:506— ImportParserPlugin::import_call has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImportParserPlugin::finish (cyclomatic 18) crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:805— ImportParserPlugin::finish has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Executer::compute_jump_table (cyclomatic 27) crates/rspack_dojang/src/exec.rs:45— Executer::compute_jump_table has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Executer::render (cyclomatic 18) crates/rspack_dojang/src/exec.rs:191— Executer::render has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_split_chunks::plugin::intersections::collect_intersections (cyclomatic 27) crates/rspack_plugin_split_chunks/src/plugin/intersections.rs:158— rspack_plugin_split_chunks::plugin::intersections::collect_intersections has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_split_chunks::plugin::max_size::deterministic_grouping (cyclomatic 20) crates/rspack_plugin_split_chunks/src/plugin/max_size.rs:279— rspack_plugin_split_chunks::plugin::max_size::deterministic_grouping has cyclomatic complexity 20 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
AssetParserAndGenerator::generate (cyclomatic 26) crates/rspack_plugin_asset/src/lib.rs:527— AssetParserAndGenerator::generate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AssetParserAndGenerator::source_types (cyclomatic 19) crates/rspack_plugin_asset/src/lib.rs:343— AssetParserAndGenerator::source_types has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FlagDependencyUsagePluginProxy::apply (cyclomatic 26) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:64— FlagDependencyUsagePluginProxy::apply has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FlagDependencyUsagePluginProxy::process_referenced_module (cyclomatic 24) crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs:435— FlagDependencyUsagePluginProxy::process_referenced_module has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CopyRspackPlugin::run_pattern (cyclomatic 25) crates/rspack_plugin_copy/src/lib.rs:394— CopyRspackPlugin::run_pattern has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CopyRspackPlugin::analyze_every_entry (cyclomatic 19) crates/rspack_plugin_copy/src/lib.rs:202— CopyRspackPlugin::analyze_every_entry has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ValueAtRuleStream::push (cyclomatic 23) crates/css-module-lexer/src/dependencies.rs:578— ValueAtRuleStream::push has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ValueAtRuleStream::push_parsed_item (cyclomatic 16) crates/css-module-lexer/src/dependencies.rs:766— ValueAtRuleStream::push_parsed_item has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AnimationReserved::check (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
ResolverGeneric::package_target_resolve (cyclomatic 22) crates/rspack_resolver/src/lib.rs:2159— ResolverGeneric::package_target_resolve has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolverGeneric::package_exports_resolve (cyclomatic 18) crates/rspack_resolver/src/lib.rs:1898— ResolverGeneric::package_exports_resolve has cyclomatic complexity 18 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Eval::run (cyclomatic 21) crates/rspack_dojang/src/context.rs:180— Eval::run has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Eval::new (cyclomatic 16) crates/rspack_dojang/src/eval.rs:28— Eval::new has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExportedEnumCollector::evaluate_bin (cyclomatic 21) crates/swc_plugin_ts_collector/src/enums.rs:154— ExportedEnumCollector::evaluate_bin has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ExportedEnumCollector::visit_program (cyclomatic 16) crates/swc_plugin_ts_collector/src/enums.rs:314— ExportedEnumCollector::visit_program has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_macros::string_enum::expand (cyclomatic 20) crates/rspack_macros/src/string_enum.rs:69— rspack_macros::string_enum::expand has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_macros::ast_object::expand_ast_object_derive (cyclomatic 18) crates/rspack_macros/src/ast_object.rs:8— rspack_macros::ast_object::expand_ast_object_derive has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_rslib::dyn_import_external::cutout_star_re_export_externals (cyclomatic 20) crates/rspack_plugin_rslib/src/dyn_import_external.rs:14— rspack_plugin_rslib::dyn_import_external::cutout_star_re_export_externals has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_rslib::isolated_dts::complete_isolated_dts_outputs (cyclomatic 16) crates/rspack_plugin_rslib/src/isolated_dts.rs:37— rspack_plugin_rslib::isolated_dts::complete_isolated_dts_outputs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommonJsImportsParserPlugin::declarator (cyclomatic 17) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2106— CommonJsImportsParserPlugin::declarator has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CommonJsImportsParserPlugin::call (cyclomatic 17) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:2530— CommonJsImportsParserPlugin::call has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImportPlugin::transform (cyclomatic 16) crates/swc_plugin_import/src/lib.rs:251— ImportPlugin::transform has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ImportPlugin::visit_mut_module (cyclomatic 16) crates/swc_plugin_import/src/lib.rs:376— ImportPlugin::visit_mut_module has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack::builder::target::merge_target_properties (cognitive 186) crates/rspack/src/builder/target.rs:191— rspack::builder::target::merge_target_properties has cognitive complexity 186 (threshold 15). Drivers by points: boolean chains 62, match/switch 31 (62 pts), if/else 31, loops 31 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack::builder::target::get_target_properties (cognitive 22) crates/rspack/src/builder/target.rs:250— rspack::builder::target::get_target_properties has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleCodeTemplate::export_from_import (cognitive 81) crates/rspack_core/src/runtime_template.rs:1369— ModuleCodeTemplate::export_from_import has cognitive complexity 81 (threshold 15). Drivers by points: if/else 30 (63 pts), match/switch 5 (13 pts), boolean chains 5 (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ModuleCodeTemplate::module_namespace_promise (cognitive 39) crates/rspack_core/src/runtime_template.rs:1598— ModuleCodeTemplate::module_namespace_promise has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 2, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stats::get_module (cognitive 76) crates/rspack_core/src/stats/mod.rs:1158— Stats::get_module has cognitive complexity 76 (threshold 15). Drivers by points: if/else 42 (58 pts), boolean chains 8, match/switch 3 (8 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stats::get_assets (cognitive 24) crates/rspack_core/src/stats/mod.rs:316— Stats::get_assets has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 6 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AMDDefineDependencyParserPlugin::process_call_define (cognitive 69) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:262— AMDDefineDependencyParserPlugin::process_call_define has cognitive complexity 69 (threshold 15). Drivers by points: if/else 37 (62 pts), loops 2 (4 pts), match/switch 2, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AMDDefineDependencyParserPlugin::process_array (cognitive 23) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:117— AMDDefineDependencyParserPlugin::process_array has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssetParserAndGenerator::generate (cognitive 66) crates/rspack_plugin_asset/src/lib.rs:527— AssetParserAndGenerator::generate has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28 (55 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 32). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AssetParserAndGenerator::source_types (cognitive 30) crates/rspack_plugin_asset/src/lib.rs:343— AssetParserAndGenerator::source_types has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 6, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixIssuers::clean_cycle_module (cognitive 64) crates/rspack_core/src/compilation/build_module_graph/graph_updater/cutout/fix_issuers.rs:402— FixIssuers::clean_cycle_module has cognitive complexity 64 (threshold 15). Drivers by points: if/else 9 (38 pts), loops 8 (21 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixIssuers::try_set_first_incoming (cognitive 22) crates/rspack_core/src/compilation/build_module_graph/graph_updater/cutout/fix_issuers.rs:259— FixIssuers::try_set_first_incoming has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemInfo::validate_snapshot (cognitive 61) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:887— FileSystemInfo::validate_snapshot has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 9 (18 pts), match/switch 2 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemInfo::read_context (cognitive 36) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:721— FileSystemInfo::read_context has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 4 (7 pts), loops 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_binding_api::source::apply_replacements (cognitive 55) crates/rspack_binding_api/src/source.rs:305— rspack_binding_api::source::apply_replacements has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 7 (15 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_binding_api::logging::run_dispatcher (cognitive 17) crates/rspack_binding_api/src/logging.rs:180— rspack_binding_api::logging::run_dispatcher has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Eval::run (cognitive 54) crates/rspack_dojang/src/context.rs:180— Eval::run has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 8 (27 pts), if/else 6 (18 pts), loops 3 (9 pts) (nesting depth added 37). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Eval::new (cognitive 37) crates/rspack_dojang/src/eval.rs:28— Eval::new has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 3 (10 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportPlugin::visit_mut_module (cognitive 53) crates/swc_plugin_import/src/lib.rs:376— ImportPlugin::visit_mut_module has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (35 pts), match/switch 2 (11 pts), loops 4 (7 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ImportPlugin::transform (cognitive 21) crates/swc_plugin_import/src/lib.rs:251— ImportPlugin::transform has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 4 (7 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CopyRspackPlugin::run_pattern (cognitive 50) crates/rspack_plugin_copy/src/lib.rs:394— CopyRspackPlugin::run_pattern has cognitive complexity 50 (threshold 15). Drivers by points: if/else 27 (43 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopyRspackPlugin::analyze_every_entry (cognitive 32) crates/rspack_plugin_copy/src/lib.rs:202— CopyRspackPlugin::analyze_every_entry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23 (25 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_util::node_path::normalize_string (cognitive 48) crates/rspack_util/src/node_path.rs:18— rspack_util::node_path::normalize_string has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (44 pts), boolean chains 3, loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_util::location::byte_line_column_to_offset (cognitive 16) crates/rspack_util/src/location.rs:6— rspack_util::location::byte_line_column_to_offset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportParserPlugin::import_call (cognitive 47) crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:506— ImportParserPlugin::import_call has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (37 pts), boolean chains 10 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportParserPlugin::finish (cognitive 26) crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs:805— ImportParserPlugin::finish has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssLoadingRuntimeModule::generate (cognitive 45) crates/rspack_plugin_css/src/runtime/mod.rs:263— CssLoadingRuntimeModule::generate has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssLoadingRuntimeModule::generate (cognitive 22) crates/rspack_plugin_extract_css/src/runtime.rs:255— CssLoadingRuntimeModule::generate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_macros::string_enum::expand (cognitive 43) crates/rspack_macros/src/string_enum.rs:69— rspack_macros::string_enum::expand has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_macros::ast_object::expand_ast_object_derive (cognitive 33) crates/rspack_macros/src/ast_object.rs:8— rspack_macros::ast_object::expand_ast_object_derive has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 3 (5 pts), loops 3 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssPlugin::get_modules_in_order (cognitive 43) crates/rspack_plugin_css/src/plugin/mod.rs:53— CssPlugin::get_modules_in_order has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssPlugin::render_ordered_css_sources (cognitive 17) crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:241— CssPlugin::render_ordered_css_sources has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Executer::compute_jump_table (cognitive 39) crates/rspack_dojang/src/exec.rs:45— Executer::compute_jump_table has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (7 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Executer::render (cognitive 34) crates/rspack_dojang/src/exec.rs:191— Executer::render has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 4 (11 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportMetaPlugin::meta_property (cognitive 39) crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:653— ImportMetaPlugin::meta_property has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ImportMetaPlugin::unhandled_expression_member_chain (cognitive 24) crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:875— ImportMetaPlugin::unhandled_expression_member_chain has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
xtask::release_check::run_inner (cognitive 37) xtask/src/release_check/mod.rs:13— xtask::release_check::run_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 2 (6 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
xtask::deny_ext::enforce_workspace_version (cognitive 36) xtask/src/deny_ext/mod.rs:23— xtask::deny_ext::enforce_workspace_version has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ValueAtRuleStream::push (cognitive 36) crates/css-module-lexer/src/dependencies.rs:578— ValueAtRuleStream::push has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValueAtRuleStream::push_parsed_item (cognitive 26) crates/css-module-lexer/src/dependencies.rs:766— ValueAtRuleStream::push_parsed_item has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginCssExtract::render_content_asset (cognitive 35) crates/rspack_plugin_extract_css/src/plugin.rs:345— PluginCssExtract::render_content_asset has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginCssExtract::sort_modules (cognitive 33) crates/rspack_plugin_extract_css/src/plugin.rs:139— PluginCssExtract::sort_modules has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RstestParserPlugin::process_mock (cognitive 33) crates/rspack_plugin_rstest/src/parser_plugin.rs:399— RstestParserPlugin::process_mock has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RstestParserPlugin::load_mock (cognitive 19) crates/rspack_plugin_rstest/src/parser_plugin.rs:624— RstestParserPlugin::load_mock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rspack_allocative_derive::derive_allocative::extract_attrs (cognitive 30) crates/rspack_allocative_derive/src/derive_allocative.rs:427— rspack_allocative_derive::derive_allocative::extract_attrs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_allocative_derive::derive_allocative::uses_enum_reflection (cognitive 17) crates/rspack_allocative_derive/src/derive_allocative.rs:172— rspack_allocative_derive::derive_allocative::uses_enum_reflection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ESMImportSpecifierDependencyTemplate::render_evaluated_in_operator (cognitive 30) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:527— ESMImportSpecifierDependencyTemplate::render_evaluated_in_operator has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ESMImportSpecifierDependencyTemplate::render (cognitive 23) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:639— ESMImportSpecifierDependencyTemplate::render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashHelper::dir_hash (cognitive 28) crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/hash_helper.rs:112— HashHelper::dir_hash has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HashHelper::dir_timestamp_hash (cognitive 28) crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/hash_helper.rs:163— HashHelper::dir_timestamp_hash has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncWasmParserAndGenerator::parse (cognitive 27) crates/rspack_plugin_wasm/src/parser_and_generator.rs:51— AsyncWasmParserAndGenerator::parse has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 4 (15 pts), loops 3 (9 pts), if/else 2 (3 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AsyncWasmParserAndGenerator::generate (cognitive 16) crates/rspack_plugin_wasm/src/parser_and_generator.rs:166— AsyncWasmParserAndGenerator::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssetData::compute_new_source (cognitive 23) crates/rspack_plugin_real_content_hash/src/lib.rs:431— AssetData::compute_new_source has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssetData::new (cognitive 21) crates/rspack_plugin_real_content_hash/src/lib.rs:347— AssetData::new has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextModuleFactory::resolve (cognitive 20) crates/rspack_core/src/context_module_factory.rs:221— ContextModuleFactory::resolve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 4 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ContextModuleFactory::after_resolve (cognitive 17) crates/rspack_core/src/context_module_factory.rs:426— ContextModuleFactory::after_resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×2
Edited copy of a member (63 corresponding lines) crates/css-module-lexer/src/dependencies.rs:2349— crates/css-module-lexer/src/dependencies.rs:2349-2424 | crates/css-module-lexer/src/dependencies.rs:2678-2740 — 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.
Edited copy of a member (63 corresponding lines) crates/rspack_core/src/context_module.rs:1012— crates/rspack_core/src/context_module.rs:1012-1074 | crates/rspack_core/src/context_module.rs:1080-1152 — 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 (45 corresponding lines) · ×2
Edited copy of a member (45 corresponding lines) crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:200— crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:200-244 | crates/rspack_plugin_javascript/src/utils/eval/eval_binary_expr.rs:251-295 — 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/rspack_core/src/legacy_cache/persistent/snapshot/strategy/hash_helper.rs:112— crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/hash_helper.rs:112-156 | crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/hash_helper.rs:163-225 — 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 (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:124— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:124-170 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:66-103 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1512— crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1512-1552 | crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1554-1591 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) crates/rspack_plugin_externals/src/http_externals_plugin.rs:48— crates/rspack_plugin_externals/src/http_externals_plugin.rs:48-84 | crates/rspack_plugin_externals/src/http_externals_plugin.rs:86-122 — 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/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:7— crates/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:7-43 | crates/rspack_loader_swc/src/rsc_transforms/to_server_entry.rs:45-83 — 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 (33 corresponding lines) · ×2
Edited copy of a member (33 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1646— crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs:1646-1686 | crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:387-419 — 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/css-module-lexer/src/dependencies.rs:4323— crates/css-module-lexer/src/dependencies.rs:4323-4356 | crates/css-module-lexer/src/dependencies.rs:4364-4396 — 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 (31 corresponding lines) · ×2
Edited copy of a member (31 corresponding lines) crates/rspack_plugin_rsdoctor/src/plugin.rs:537— crates/rspack_plugin_rsdoctor/src/plugin.rs:537-567 | crates/rspack_plugin_rsdoctor/src/plugin.rs:574-611 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/rspack_core/src/context_module.rs:1423— crates/rspack_core/src/context_module.rs:1423-1453 | crates/rspack_core/src/normal_module.rs:428-458 — 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, 20+ corresponding lines) · ×2
Edited copies of one member (3 members, 20+ corresponding lines) crates/rspack_binding_api/src/module_graph.rs:195— crates/rspack_binding_api/src/module_graph.rs:195-214 | crates/rspack_binding_api/src/module_graph.rs:224-243 | crates/rspack_binding_api/src/module_graph.rs:253-272 — 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.
Edited copies of one member (3 members, 20+ corresponding lines) crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:128— crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:128-147 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:92-117 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:96-121 — 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 (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:236— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:236-260 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:165-189 | crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:59-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:425— crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:425-447 | crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:456-486 | crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:495-525 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×2
Edited copy of a member (26 corresponding lines) crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:191— crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:191-216 | crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs:184-209 — 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/rspack_storage/src/filesystem/db/mod.rs:186— crates/rspack_storage/src/filesystem/db/mod.rs:186-212 | crates/rspack_storage/src/filesystem/db/mod.rs:219-244 — 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 copies of one member (3 members, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) crates/rspack_plugin_rslib/src/dyn_import_external.rs:251— crates/rspack_plugin_rslib/src/dyn_import_external.rs:251-266 | crates/rspack_plugin_rslib/src/url_external.rs:99-125 | crates/rspack_plugin_rslib/src/worker_external.rs:93-118 — 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/rspack_plugin_javascript/src/dependency/amd/amd_exports_dependency.rs:71— crates/rspack_plugin_javascript/src/dependency/amd/amd_exports_dependency.rs:71-86 | crates/rspack_plugin_javascript/src/dependency/context/import_meta_context_dependency.rs:183-198 | crates/rspack_plugin_javascript/src/dependency/context/require_context_dependency.rs:131-146 — 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, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) crates/rspack_cacheable/src/with/as_map.rs:48— crates/rspack_cacheable/src/with/as_map.rs:48-55 | crates/rspack_cacheable/src/with/as_tuple2.rs:23-30 | crates/rspack_core/src/options/resolve/alias_value_cacheable.rs:34-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/rspack_core/src/utils/identifier.rs:86— crates/rspack_core/src/utils/identifier.rs:86-96 | crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:55-62 | crates/rspack_sources/src/helpers.rs:576-586 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1501— crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs:1501-1509 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2250-2261 | crates/rspack_plugin_javascript/src/visitors/dependency/parser/walk.rs:2269-2277 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/rspack_macros/src/lib.rs:82— crates/rspack_macros/src/lib.rs:82-90 | crates/rspack_macros/src/lib.rs:93-101 | crates/rspack_macros/src/lib.rs:104-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) crates/rspack_plugin_library/src/export_property_library_plugin.rs:63— crates/rspack_plugin_library/src/export_property_library_plugin.rs:63-69 | crates/rspack_plugin_library/src/module_library_plugin.rs:49-55 | crates/rspack_plugin_runtime/src/module_chunk_format.rs:40-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs:407— crates/rspack_binding_api/src/plugins/js_hooks_plugin.rs:407-415 | crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:28-34 | crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:32-38 — 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.
Duplicated block (36 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:178— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:178-213 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:185-220 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (36 lines × 2) crates/rspack_core/src/artifacts/async_modules_artifact.rs:17— crates/rspack_core/src/artifacts/async_modules_artifact.rs:17-52 | crates/rspack_core/src/artifacts/imported_by_defer_modules_artifact.rs:17-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/artifacts/async_modules_artifact.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.
Duplicated block (30 lines × 2) crates/rspack_plugin_esm_library/src/link.rs:1958— crates/rspack_plugin_esm_library/src/link.rs:1958-1987 | crates/rspack_plugin_esm_library/src/link.rs:2007-2036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_esm_library/src/link.rs:1958` 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 (30 lines × 2) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:621— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:621-650 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:665-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27 lines × 2) crates/rspack_plugin_javascript/src/runtime_context.rs:379— crates/rspack_plugin_javascript/src/runtime_context.rs:379-405 | crates/rspack_plugin_javascript/src/runtime_context.rs:471-497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/runtime_context.rs:379` 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:298— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:298-324 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:309-335 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.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 (20–21 lines × 2) crates/rspack_plugin_split_chunks/src/plugin/chunk.rs:144— crates/rspack_plugin_split_chunks/src/plugin/chunk.rs:144-163 | crates/rspack_plugin_split_chunks/src/plugin/chunk.rs:174-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_split_chunks/src/plugin/chunk.rs:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–21 lines × 2) crates/css-module-lexer/src/dependencies.rs:2866— crates/css-module-lexer/src/dependencies.rs:2866-2885 | crates/css-module-lexer/src/dependencies.rs:3065-3085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2866` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16–17 lines × 2) crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:166— crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:166-182 | crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:270-285 — before extracting anything, compare `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs` and `crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_devtool/src/eval_dev_tool_module_plugin.rs:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) crates/rspack_plugin_mf/src/manifest/asset.rs:28— crates/rspack_plugin_mf/src/manifest/asset.rs:28-44 | crates/rspack_plugin_mf/src/manifest/asset.rs:75-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_mf/src/manifest/asset.rs:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/css-module-lexer/src/dependencies.rs:3248— crates/css-module-lexer/src/dependencies.rs:3248-3261 | crates/css-module-lexer/src/dependencies.rs:3404-3418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:3404` it begins part-way through the construct above it, so those 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) crates/rspack_plugin_mf/src/sharing/collect_shared_entry_plugin.rs:173— crates/rspack_plugin_mf/src/sharing/collect_shared_entry_plugin.rs:173-186 | crates/rspack_plugin_mf/src/sharing/shared_used_exports_optimizer_plugin.rs:108-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:208— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:208-218 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:140-149 — before extracting anything, compare `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs` and `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:208` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) crates/rspack_core/src/resolver/resolver_impl.rs:196— crates/rspack_core/src/resolver/resolver_impl.rs:196-206 | crates/rspack_core/src/resolver/resolver_impl.rs:227-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/resolver/resolver_impl.rs:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crates/rspack_core/src/binding/cell.rs:86— crates/rspack_core/src/binding/cell.rs:86-92 | crates/rspack_core/src/binding/cell.rs:139-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/binding/cell.rs:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) crates/rspack_plugin_asset/src/lib.rs:366— crates/rspack_plugin_asset/src/lib.rs:366-372 | crates/rspack_plugin_rslib/src/asset.rs:23-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_plugin_asset/src/lib.rs:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 3) crates/rspack_core/src/stats/mod.rs:1038— crates/rspack_core/src/stats/mod.rs:1038-1043 | crates/rspack_core/src/stats/mod.rs:1123-1128 | crates/rspack_core/src/stats/mod.rs:1836-1842 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_core/src/stats/mod.rs:1038` 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 (6–7 lines × 3) crates/rspack/src/builder/browserslist_target.rs:184— crates/rspack/src/builder/browserslist_target.rs:184-190 | crates/rspack/src/builder/browserslist_target.rs:202-208 | crates/rspack/src/builder/browserslist_target.rs:217-222 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack/src/builder/browserslist_target.rs:184` 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/rspack/src/builder/browserslist_target.rs:183` calls `MajorMinor` and `crates/rspack/src/builder/browserslist_target.rs:217` 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 (32 lines × 2 locations) packages/rspack/src/Compiler.ts:1115— packages/rspack/src/Compiler.ts:1115 · packages/rspack/src/Compiler.ts:1154 — 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 (32 lines × 2 locations) packages/rspack/src/FileSystemDependencies.ts:126— packages/rspack/src/FileSystemDependencies.ts:126 · packages/rspack/src/Modules.ts:45 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (26 lines × 2 locations) packages/rspack/src/FileSystem.ts:75— packages/rspack/src/FileSystem.ts:75 · packages/rspack/src/FileSystem.ts:176 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (26 lines × 2 locations) packages/rspack/src/browser/service.ts:1— packages/rspack/src/browser/service.ts:1 · packages/rspack/src/loader-runner/service.ts:125 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (22 lines × 2 locations) packages/rspack/src/loader-runner/index.ts:695— packages/rspack/src/loader-runner/index.ts:695 · packages/rspack/src/loader-runner/worker.ts:452 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (22 lines × 2 locations) packages/rspack/src/util/fs.ts:287— packages/rspack/src/util/fs.ts:287 · packages/rspack/src/util/fs.ts:465 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (19 lines × 4 locations) packages/rspack/src/NativeWatchFileSystem.ts:440— packages/rspack/src/NativeWatchFileSystem.ts:440 · packages/rspack/src/NativeWatchFileSystem.ts:460 · packages/rspack/src/node/NodeWatchFileSystem.ts:269 · packages/rspack/src/node/NodeWatchFileSystem.ts:289 — the 4 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 4 locations) packages/rspack/src/builtin-plugin/html-plugin/taps.ts:23— packages/rspack/src/builtin-plugin/html-plugin/taps.ts:23 · packages/rspack/src/builtin-plugin/html-plugin/taps.ts:45 · packages/rspack/src/builtin-plugin/html-plugin/taps.ts:67 · packages/rspack/src/builtin-plugin/html-plugin/taps.ts:110 — 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.
Boundary violation [package:relative-cross-package] crates/node_binding/scripts/build.mjs:5— crates/node_binding/scripts/build.mjs:5 reaches into another package with a relative path (../../../scripts/allocative-driver.mjs) — import the package by name instead.
Boundary violation [package:third-party-deep-import] packages/rspack/src/node/NodeEnvironmentPlugin.ts:12— packages/rspack/src/node/NodeEnvironmentPlugin.ts:12 imports enhanced-resolve/lib/CachedInputFileSystem, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Complex function resolveToUnqualified (cyclomatic 54, cognitive 161) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:10134— resolveToUnqualified has cyclomatic complexity 54 and cognitive complexity 161; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function resolveToUnqualified (cyclomatic 54, cognitive 161) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:10134— resolveToUnqualified has cyclomatic complexity 54 and cognitive complexity 161; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function arg (cyclomatic 40, cognitive 81) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:9545— arg has cyclomatic complexity 40 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function arg (cyclomatic 40, cognitive 81) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:9545— arg has cyclomatic complexity 40 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _resolveFilename (cyclomatic 30, cognitive 49) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:8772— _resolveFilename has cyclomatic complexity 30 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _resolveFilename (cyclomatic 30, cognitive 49) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:8772— _resolveFilename has cyclomatic complexity 30 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function open (cyclomatic 26, cognitive 37) · ×2
Complex function open (cyclomatic 26, cognitive 37) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:6865— open has cyclomatic complexity 26 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function open (cyclomatic 26, cognitive 37) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:6865— open has cyclomatic complexity 26 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function areStatsEqual (cyclomatic 26, cognitive 25) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:233— areStatsEqual has cyclomatic complexity 26 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function areStatsEqual (cyclomatic 26, cognitive 25) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:233— areStatsEqual has cyclomatic complexity 26 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 23, cognitive 26) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:4317— (anonymous) has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 23, cognitive 26) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:4317— (anonymous) has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ___sys_ioctl (cyclomatic 23, cognitive 17) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:7934— ___sys_ioctl has cyclomatic complexity 23 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ___sys_ioctl (cyclomatic 23, cognitive 17) tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:7934— ___sys_ioctl has cyclomatic complexity 23 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 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.
rspack::builder::target::merge_target_properties (cyclomatic 187) crates/rspack/src/builder/target.rs:191— rspack::builder::target::merge_target_properties has cyclomatic complexity 187 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
rspack_plugin_hmr::generate_hot_update (cyclomatic 113) crates/rspack_plugin_hmr/src/lib.rs:238— rspack_plugin_hmr::generate_hot_update has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RspackOptionsApply.process (cyclomatic 90) packages/rspack/src/rspackOptionsApply.ts:88— RspackOptionsApply.process has cyclomatic complexity 90 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ServerActions::visit_mut_module_items (cyclomatic 77) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1294— ServerActions::visit_mut_module_items has cyclomatic complexity 77 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
NormalModuleFactory::resolve_normal_module (cyclomatic 52) crates/rspack_core/src/normal_module_factory.rs:649— NormalModuleFactory::resolve_normal_module has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_css_chunking::optimize_chunks (cyclomatic 52) crates/rspack_plugin_css_chunking/src/lib.rs:73— rspack_plugin_css_chunking::optimize_chunks has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EventProcessor::process (cyclomatic 50) crates/rspack_watcher/src/trigger.rs:228— EventProcessor::process has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build.build (cyclomatic 47) crates/node_binding/scripts/build.mjs:37— build.build has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 2 of the 47 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 39, 168). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
worker.loaderImpl (cyclomatic 46) packages/rspack/src/loader-runner/worker.ts:70— worker.loaderImpl has cyclomatic complexity 46 (threshold 15). Of this number, 28 points are the body's own statements and 18 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InitializeEvaluating::evaluate_call_expression_member (cyclomatic 45) crates/rspack_plugin_javascript/src/parser_plugin/initialize_evaluating.rs:66— InitializeEvaluating::evaluate_call_expression_member has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.runLoaders (cyclomatic 45) packages/rspack/src/loader-runner/index.ts:248— index.runLoaders has cyclomatic complexity 45 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ChunkManifest::new (cyclomatic 43) crates/rspack_plugin_sri/src/manifest.rs:169— ChunkManifest::new has cyclomatic complexity 43 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Stats::get_module (cyclomatic 41) crates/rspack_core/src/stats/mod.rs:1158— Stats::get_module has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AMDDefineDependencyParserPlugin::process_call_define (cyclomatic 39) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:262— AMDDefineDependencyParserPlugin::process_call_define has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_loader_swc::rsc_transforms::react_server_components::collect_top_level_directives_and_imports (cyclomatic 38) crates/rspack_loader_swc/src/rsc_transforms/react_server_components.rs:245— rspack_loader_swc::rsc_transforms::react_server_components::collect_top_level_directives_and_imports has cyclomatic complexity 38 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_plugin_swc_js_minimizer::process_assets (cyclomatic 37) crates/rspack_plugin_swc_js_minimizer/src/lib.rs:223— rspack_plugin_swc_js_minimizer::process_assets has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultiCompiler.#runGraph (cyclomatic 36) packages/rspack/src/MultiCompiler.ts:321— MultiCompiler.#runGraph has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (processQueueWorker, nodeDone, nodeInvalidFromParent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cyclomatic 35) packages/rspack/src/runtime/moduleFederationDefaultRuntime.js:9— (anonymous) has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 119, a function literal at line 68, merge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ModuleGroup::update_candidate (cyclomatic 34) crates/rspack_plugin_split_chunks/src/module_group.rs:458— ModuleGroup::update_candidate has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smartGrouping.smartGrouping::runGrouping (cyclomatic 34) packages/rspack/src/util/smartGrouping.ts:71— smartGrouping.smartGrouping::runGrouping has cyclomatic complexity 34 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
CssModuleParser::handle_dependency (cyclomatic 33) crates/rspack_plugin_css/src/parser_and_generator/parser.rs:504— CssModuleParser::handle_dependency has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
plugin.HtmlRspackPluginImpl (cyclomatic 32) packages/rspack/src/builtin-plugin/html-plugin/plugin.ts:37— plugin.HtmlRspackPluginImpl has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServeCommand.apply (cyclomatic 31) packages/rspack-cli/src/commands/serve.ts:41— ServeCommand.apply has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 58, 177). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
rspack_watcher::ignored::glob_to_regexp (cyclomatic 30) crates/rspack_watcher/src/ignored.rs:63— rspack_watcher::ignored::glob_to_regexp has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
moduleFederationDefaultRuntime.default (cyclomatic 30) packages/rspack/src/runtime/moduleFederationDefaultRuntime.js:9— moduleFederationDefaultRuntime.default has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 119, a function literal at line 68, merge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ConcatenationBindingResolver::resolve_inner (cyclomatic 29) crates/rspack_core/src/concatenation_backend.rs:202— ConcatenationBindingResolver::resolve_inner has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HttpCache::fetch_content (cyclomatic 29) crates/rspack_plugin_schemes/src/http_uri/http_cache.rs:102— HttpCache::fetch_content has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StrategyHelper::validate (cyclomatic 28) crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/mod.rs:223— StrategyHelper::validate has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OptimizationOptionsBuilder::build (cyclomatic 27) crates/rspack/src/builder/mod.rs:3494— OptimizationOptionsBuilder::build has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_devtool::module_filename_helpers::template_replace (cyclomatic 27) crates/rspack_plugin_devtool/src/module_filename_helpers.rs:522— rspack_plugin_devtool::module_filename_helpers::template_replace has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExternalsPlugin.#getRawExternalItem (cyclomatic 27) packages/rspack/src/builtin-plugin/ExternalsPlugin.ts:74— ExternalsPlugin.#getRawExternalItem has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 182, 114, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
GetChunkFilenameRuntimeModule::generate (cyclomatic 26) crates/rspack_plugin_runtime/src/runtime_module/get_chunk_filename.rs:269— GetChunkFilenameRuntimeModule::generate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compilation.createCompilationHooksRegisters (cyclomatic 26) packages/rspack/src/taps/compilation.ts:31— compilation.createCompilationHooksRegisters has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 419, 216, 207, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ExecuteTask::main_run (cyclomatic 25) crates/rspack_core/src/compilation/build_module_graph/module_executor/execute.rs:185— ExecuteTask::main_run has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CssLoadingRuntimeModule::generate (cyclomatic 25) crates/rspack_plugin_css/src/runtime/mod.rs:263— CssLoadingRuntimeModule::generate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_limit_chunk_count::plan_merges (cyclomatic 25) crates/rspack_plugin_limit_chunk_count/src/lib.rs:150— rspack_plugin_limit_chunk_count::plan_merges has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Compilation.getLogger (cyclomatic 25) packages/rspack/src/Compilation.ts:892— Compilation.getLogger has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 901, 953, 949, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
rspack_binding_api::source::apply_replacements (cyclomatic 24) crates/rspack_binding_api/src/source.rs:305— rspack_binding_api::source::apply_replacements has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommonJsExportRequireDependency::get_star_reexports (cyclomatic 24) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:63— CommonJsExportRequireDependency::get_star_reexports has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeWatchFileSystem.watch (cyclomatic 24) packages/rspack/src/NativeWatchFileSystem.ts:160— NativeWatchFileSystem.watch has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 4 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ResolveOptions::fmt (cyclomatic 23) crates/rspack_resolver/src/options.rs:532— ResolveOptions::fmt has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RspackCLI.buildConfig::internalBuildConfig (cyclomatic 23) packages/rspack-cli/src/cli.ts:212— RspackCLI.buildConfig::internalBuildConfig has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompilerOptionsBuilder::build (cyclomatic 22) crates/rspack/src/builder/mod.rs:936— CompilerOptionsBuilder::build has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Cutout::cutout_artifact (cyclomatic 22) crates/rspack_core/src/compilation/build_module_graph/graph_updater/cutout/mod.rs:28— Cutout::cutout_artifact has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ExternalsPlugin::handle_external (cyclomatic 22) crates/rspack_plugin_externals/src/plugin.rs:37— ExternalsPlugin::handle_external has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NodeStuffPlugin::identifier (cyclomatic 22) crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:134— NodeStuffPlugin::identifier has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypeExportsCollector::visit_program (cyclomatic 22) crates/swc_plugin_ts_collector/src/type_exports.rs:29— TypeExportsCollector::visit_program has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwcLoader::loader_impl (cyclomatic 21) crates/rspack_loader_swc/src/lib.rs:58— SwcLoader::loader_impl has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_ensure_chunk_conditions::optimize_chunks (cyclomatic 21) crates/rspack_plugin_ensure_chunk_conditions/src/lib.rs:12— rspack_plugin_ensure_chunk_conditions::optimize_chunks has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HtmlPluginAssets::create_assets (cyclomatic 21) crates/rspack_plugin_html/src/asset.rs:40— HtmlPluginAssets::create_assets has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_merge_duplicate_chunks::optimize_chunks (cyclomatic 21) crates/rspack_plugin_merge_duplicate_chunks/src/lib.rs:15— rspack_plugin_merge_duplicate_chunks::optimize_chunks has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_remove_duplicate_modules::optimize_chunks (cyclomatic 21) crates/rspack_plugin_remove_duplicate_modules/src/lib.rs:135— rspack_plugin_remove_duplicate_modules::optimize_chunks has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RscServerPlugin::create_client_entries (cyclomatic 21) crates/rspack_plugin_rsc/src/server_plugin.rs:326— RscServerPlugin::create_client_entries has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OutputOptionsBuilder::build (cyclomatic 20) crates/rspack/src/builder/mod.rs:2698— OutputOptionsBuilder::build has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FixIssuers::clean_cycle_module (cyclomatic 20) crates/rspack_core/src/compilation/build_module_graph/graph_updater/cutout/fix_issuers.rs:402— FixIssuers::clean_cycle_module has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ContextModule::get_lazy_source (cyclomatic 20) crates/rspack_core/src/context_module.rs:800— ContextModule::get_lazy_source has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WatcherDirectoriesAnalyzer::analyze (cyclomatic 20) crates/rspack_watcher/src/analyzer/directories.rs:35— WatcherDirectoriesAnalyzer::analyze has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BlockItemCandidates::observe (cyclomatic 19) crates/css-module-lexer/src/parser.rs:217— BlockItemCandidates::observe has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
rspack_plugin_copy::process_assets (cyclomatic 19) crates/rspack_plugin_copy/src/lib.rs:733— rspack_plugin_copy::process_assets has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_css::plugin::impl_plugin_for_css_plugin::runtime_requirements_in_tree (cyclomatic 19) crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:402— rspack_plugin_css::plugin::impl_plugin_for_css_plugin::runtime_requirements_in_tree has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_rsdoctor::plugin::optimize_chunk_modules (cyclomatic 19) crates/rspack_plugin_rsdoctor/src/plugin.rs:368— rspack_plugin_rsdoctor::plugin::optimize_chunk_modules has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultiStats.toJson (cyclomatic 19) packages/rspack/src/MultiStats.ts:75— MultiStats.toJson has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
CssPlugin::get_modules_in_order (cyclomatic 18) crates/rspack_plugin_css/src/plugin/mod.rs:53— CssPlugin::get_modules_in_order has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SourceMapDevToolPlugin::collect_tasks (cyclomatic 18) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:588— SourceMapDevToolPlugin::collect_tasks has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ESMImportSpecifierDependencyTemplate::render_evaluated_in_operator (cyclomatic 18) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:527— ESMImportSpecifierDependencyTemplate::render_evaluated_in_operator has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RscClientPlugin::traverse_modules (cyclomatic 18) crates/rspack_plugin_rsc/src/client_plugin.rs:469— RscClientPlugin::traverse_modules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_rstest::import_dependency::module_namespace_promise_rstest (cyclomatic 18) crates/rspack_plugin_rstest/src/import_dependency.rs:184— rspack_plugin_rstest::import_dependency::module_namespace_promise_rstest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleChunkLoadingRuntimeModule::generate (cyclomatic 18) crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:267— ModuleChunkLoadingRuntimeModule::generate has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_util::node_path::normalize_string (cyclomatic 18) crates/rspack_util/src/node_path.rs:18— rspack_util::node_path::normalize_string has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
loadConfig.loadExtendedConfig (cyclomatic 18) packages/rspack-cli/src/utils/loadConfig.ts:112— loadConfig.loadExtendedConfig has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cleverMerge.mergeSingleValue (cyclomatic 18) packages/rspack/src/util/cleverMerge.ts:457— cleverMerge.mergeSingleValue has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
validateConfig.validateExternalUmd (cyclomatic 18) packages/rspack/src/util/validateConfig.ts:31— validateConfig.validateExternalUmd has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (checkExternalItem, checkExternalItemValue). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RuleSetLogicalConditions::try_match_sync (cyclomatic 17) crates/rspack_core/src/options/module.rs:1528— RuleSetLogicalConditions::try_match_sync has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
rspack_javascript_compiler::compiler::stringify::build_rspack_source_map (cyclomatic 17) crates/rspack_javascript_compiler/src/compiler/stringify.rs:167— rspack_javascript_compiler::compiler::stringify::build_rspack_source_map has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExportInfoDependency::get_property (cyclomatic 17) crates/rspack_plugin_javascript/src/dependency/export_info_dependency.rs:43— ExportInfoDependency::get_property has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
URLPlugin::new_expression (cyclomatic 17) crates/rspack_plugin_javascript/src/parser_plugin/url_plugin.rs:106— URLPlugin::new_expression has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_real_content_hash::inner_impl (cyclomatic 17) crates/rspack_plugin_real_content_hash/src/lib.rs:82— rspack_plugin_real_content_hash::inner_impl has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rspack_plugin_size_limits::after_emit (cyclomatic 17) crates/rspack_plugin_size_limits/src/lib.rs:134— rspack_plugin_size_limits::after_emit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
utils.runSyncOrAsync (cyclomatic 17) packages/rspack/src/loader-runner/utils.ts:49— utils.runSyncOrAsync has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndependentSharedPlugin.createIndependentCompiler (cyclomatic 17) packages/rspack/src/sharing/IndependentSharedPlugin.ts:352— IndependentSharedPlugin.createIndependentCompiler has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 476, 382, 400, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DeclarationCandidate::advance (cyclomatic 16) crates/css-module-lexer/src/parser.rs:94— DeclarationCandidate::advance has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IncrementalArtifacts::recover (cyclomatic 16) crates/rspack_core/src/artifacts/incremental_artifacts.rs:42— IncrementalArtifacts::recover has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_loader_runner::scheme::get_scheme (cyclomatic 16) crates/rspack_loader_runner/src/scheme.rs:89— rspack_loader_runner::scheme::get_scheme has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PluginCssExtract::render_content_asset (cyclomatic 16) crates/rspack_plugin_extract_css/src/plugin.rs:345— PluginCssExtract::render_content_asset has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RequireEnsureDependenciesBlockParserPlugin::call (cyclomatic 16) crates/rspack_plugin_javascript/src/parser_plugin/require_ensure_dependencies_block_parse_plugin.rs:72— RequireEnsureDependenciesBlockParserPlugin::call has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChunkModules::next (cyclomatic 16) crates/rspack_plugin_rsc/src/utils.rs:77— ChunkModules::next has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RstestPlugin::resolve_mock_request (cyclomatic 16) crates/rspack_plugin_rstest/src/plugin.rs:281— RstestPlugin::resolve_mock_request has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsonpChunkLoadingRuntimeModule::generate (cyclomatic 16) crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:277— JsonpChunkLoadingRuntimeModule::generate has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rspack_plugin_sri::asset::process_chunks (cyclomatic 16) crates/rspack_plugin_sri/src/asset.rs:40— rspack_plugin_sri::asset::process_chunks has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build.runBuild (cyclomatic 16) packages/rspack-cli/src/commands/build.ts:23— build.runBuild has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (errorHandler, errorHandler::getStatsOptions, a function literal at line 59, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Watching.#go (cyclomatic 16) packages/rspack/src/Watching.ts:284— Watching.#go has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 6 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
loader.pitch::handleExports (cyclomatic 16) packages/rspack/src/builtin-plugin/css-extract/loader.ts:163— loader.pitch::handleExports has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Skipped test: should have `process.env.WEBPACK_SERVE` set on serve mode packages/rspack-cli/tests/build/issue-6359/index.test.ts:15— Skipped — switched off by it.skip
HackComment crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:1596— // HACK: Sort configurations by length and start with the longest one — 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.
rspack_plugin_hmr::generate_hot_update (cognitive 273) crates/rspack_plugin_hmr/src/lib.rs:238— rspack_plugin_hmr::generate_hot_update has cognitive complexity 273 (threshold 15). Drivers by points: if/else 66 (179 pts), loops 35 (76 pts), boolean chains 15, match/switch 2 (3 pts) (nesting depth added 155). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_css_chunking::optimize_chunks (cognitive 134) crates/rspack_plugin_css_chunking/src/lib.rs:73— rspack_plugin_css_chunking::optimize_chunks has cognitive complexity 134 (threshold 15). Drivers by points: if/else 22 (74 pts), loops 16 (38 pts), match/switch 4 (16 pts), boolean chains 6 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.runLoaders (cognitive 106) packages/rspack/src/loader-runner/index.ts:248— index.runLoaders has cognitive complexity 106 (threshold 15). Drivers by points: if/else 33 (57 pts), boolean chains 26, ternaries 9 (11 pts), loops 5 (9 pts), match/switch 2, error handling 1 (nesting depth added 30). Of this number, 60 points are the body's own statements and 46 belong to 28 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
RspackOptionsApply.process (cognitive 103) packages/rspack/src/rspackOptionsApply.ts:88— RspackOptionsApply.process has cognitive complexity 103 (threshold 15). Drivers by points: if/else 49 (57 pts), ternaries 6 (20 pts), boolean chains 12, loops 4 (8 pts), match/switch 3 (6 pts) (nesting depth added 29). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
NormalModuleFactory::resolve_normal_module (cognitive 94) crates/rspack_core/src/normal_module_factory.rs:649— NormalModuleFactory::resolve_normal_module has cognitive complexity 94 (threshold 15). Drivers by points: if/else 40 (61 pts), boolean chains 14, match/switch 5 (13 pts), loops 6 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventProcessor::process (cognitive 85) crates/rspack_watcher/src/trigger.rs:228— EventProcessor::process has cognitive complexity 85 (threshold 15). Drivers by points: if/else 21 (54 pts), boolean chains 22, loops 4 (8 pts), match/switch 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 83) packages/rspack/src/runtime/moduleFederationDefaultRuntime.js:9— (anonymous) has cognitive complexity 83 (threshold 15). Drivers by points: if/else 15 (45 pts), ternaries 5 (16 pts), loops 6 (13 pts), other 5, boolean chains 4 (nesting depth added 48). Most of this is not in the body itself: 14 of the 83 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 119, a function literal at line 68, merge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
rspack_plugin_limit_chunk_count::plan_merges (cognitive 81) crates/rspack_plugin_limit_chunk_count/src/lib.rs:150— rspack_plugin_limit_chunk_count::plan_merges has cognitive complexity 81 (threshold 15). Drivers by points: if/else 14 (53 pts), loops 9 (27 pts), boolean chains 1 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChunkManifest::new (cognitive 81) crates/rspack_plugin_sri/src/manifest.rs:169— ChunkManifest::new has cognitive complexity 81 (threshold 15). Drivers by points: loops 27 (43 pts), if/else 14 (34 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 38). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ModuleGroup::update_candidate (cognitive 79) crates/rspack_plugin_split_chunks/src/module_group.rs:458— ModuleGroup::update_candidate has cognitive complexity 79 (threshold 15). Drivers by points: if/else 32 (68 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_swc_js_minimizer::process_assets (cognitive 79) crates/rspack_plugin_swc_js_minimizer/src/lib.rs:223— rspack_plugin_swc_js_minimizer::process_assets has cognitive complexity 79 (threshold 15). Drivers by points: if/else 32 (62 pts), match/switch 5 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smartGrouping.smartGrouping::runGrouping (cognitive 76) packages/rspack/src/util/smartGrouping.ts:71— smartGrouping.smartGrouping::runGrouping has cognitive complexity 76 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 8 (13 pts), boolean chains 10, ternaries 2 (5 pts) (nesting depth added 41). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_plugin_ensure_chunk_conditions::optimize_chunks (cognitive 74) crates/rspack_plugin_ensure_chunk_conditions/src/lib.rs:12— rspack_plugin_ensure_chunk_conditions::optimize_chunks has cognitive complexity 74 (threshold 15). Drivers by points: if/else 12 (52 pts), loops 10 (22 pts) (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
InitializeEvaluating::evaluate_call_expression_member (cognitive 69) crates/rspack_plugin_javascript/src/parser_plugin/initialize_evaluating.rs:66— InitializeEvaluating::evaluate_call_expression_member has cognitive complexity 69 (threshold 15). Drivers by points: if/else 27 (45 pts), boolean chains 14, match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.build (cognitive 67) crates/node_binding/scripts/build.mjs:37— build.build has cognitive complexity 67 (threshold 15). Drivers by points: if/else 31 (46 pts), ternaries 5 (12 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 23). Most of this is not in the body itself: 1 of the 67 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 39, 168). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
moduleFederationDefaultRuntime.default (cognitive 67) packages/rspack/src/runtime/moduleFederationDefaultRuntime.js:9— moduleFederationDefaultRuntime.default has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 6 (13 pts), ternaries 1 (5 pts), boolean chains 4 (nesting depth added 41). Most of this is not in the body itself: 9 of the 67 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 119, merge, a function literal at line 226, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ExternalsPlugin.#getRawExternalItem (cognitive 59) packages/rspack/src/builtin-plugin/ExternalsPlugin.ts:74— ExternalsPlugin.#getRawExternalItem has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (44 pts), ternaries 3 (10 pts), boolean chains 5 (nesting depth added 30). Most of this is not in the body itself: 10 of the 59 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 182, 114, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
rspack_plugin_merge_duplicate_chunks::optimize_chunks (cognitive 58) crates/rspack_plugin_merge_duplicate_chunks/src/lib.rs:15— rspack_plugin_merge_duplicate_chunks::optimize_chunks has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (45 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommonJsExportRequireDependency::get_star_reexports (cognitive 54) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:63— CommonJsExportRequireDependency::get_star_reexports has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cleverMerge.parseObject (cognitive 52) packages/rspack/src/util/cleverMerge.ts:107— cleverMerge.parseObject has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 4 (17 pts) (nesting depth added 36). Of this number, 51 points are the body's own statements and 1 belongs to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
worker.loaderImpl (cognitive 52) packages/rspack/src/loader-runner/worker.ts:70— worker.loaderImpl has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 11, loops 2 (4 pts), ternaries 2, match/switch 1 (nesting depth added 24). Of this number, 44 points are the body's own statements and 8 belong to 12 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkModules::next (cognitive 51) crates/rspack_plugin_rsc/src/utils.rs:77— ChunkModules::next has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 2 (8 pts), loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GetChunkFilenameRuntimeModule::generate (cognitive 51) crates/rspack_plugin_runtime/src/runtime_module/get_chunk_filename.rs:269— GetChunkFilenameRuntimeModule::generate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 7 (23 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeExportsCollector::visit_program (cognitive 51) crates/swc_plugin_ts_collector/src/type_exports.rs:29— TypeExportsCollector::visit_program has cognitive complexity 51 (threshold 15). Drivers by points: if/else 8 (27 pts), match/switch 5 (18 pts), loops 2 (6 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Compilation.getLogger (cognitive 50) packages/rspack/src/Compilation.ts:892— Compilation.getLogger has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (48 pts), boolean chains 1, ternaries 1 (nesting depth added 27). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 901, 953, 949, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
rspack_plugin_remove_duplicate_modules::optimize_chunks (cognitive 49) crates/rspack_plugin_remove_duplicate_modules/src/lib.rs:135— rspack_plugin_remove_duplicate_modules::optimize_chunks has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcatenationBindingResolver::resolve_inner (cognitive 47) crates/rspack_core/src/concatenation_backend.rs:202— ConcatenationBindingResolver::resolve_inner has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (34 pts), match/switch 6 (11 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StrategyHelper::validate (cognitive 47) crates/rspack_core/src/legacy_cache/persistent/snapshot/strategy/mod.rs:223— StrategyHelper::validate has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (46 pts), match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MultiCompiler.#runGraph (cognitive 46) packages/rspack/src/MultiCompiler.ts:321— MultiCompiler.#runGraph has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (29 pts), loops 9 (12 pts), boolean chains 5 (nesting depth added 12). Most of this is not in the body itself: 9 of the 46 points are its own statements and the rest belongs to 8 function items inside it that branch (processQueueWorker, nodeDone, nodeInvalidFromParent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
plugin.HtmlRspackPluginImpl (cognitive 44) packages/rspack/src/builtin-plugin/html-plugin/plugin.ts:37— plugin.HtmlRspackPluginImpl has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (24 pts), loops 5 (12 pts), ternaries 5 (7 pts), boolean chains 1 (nesting depth added 15). Of this number, 37 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RscClientPlugin::traverse_modules (cognitive 43) crates/rspack_plugin_rsc/src/client_plugin.rs:469— RscClientPlugin::traverse_modules has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 5 (11 pts), match/switch 3 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecuteTask::main_run (cognitive 42) crates/rspack_core/src/compilation/build_module_graph/module_executor/execute.rs:185— ExecuteTask::main_run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 6 (9 pts), boolean chains 5, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HttpCache::fetch_content (cognitive 40) crates/rspack_plugin_schemes/src/http_uri/http_cache.rs:102— HttpCache::fetch_content has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 7, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HtmlPluginAssets::create_assets (cognitive 39) crates/rspack_plugin_html/src/asset.rs:40— HtmlPluginAssets::create_assets has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 6, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
css_module_lexer::css_syntax::decode_css_keyword (cognitive 38) crates/css-module-lexer/src/css_syntax.rs:132— css_module_lexer::css_syntax::decode_css_keyword has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rspack_plugin_copy::process_assets (cognitive 38) crates/rspack_plugin_copy/src/lib.rs:733— rspack_plugin_copy::process_assets has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (7 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RscServerPlugin::create_client_entries (cognitive 38) crates/rspack_plugin_rsc/src/server_plugin.rs:326— RscServerPlugin::create_client_entries has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 9 (14 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShareRuntimeModule::generate (cognitive 37) crates/rspack_plugin_mf/src/sharing/share_runtime_module.rs:74— ShareRuntimeModule::generate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServeCommand.apply (cognitive 37) packages/rspack-cli/src/commands/serve.ts:41— ServeCommand.apply has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 7, ternaries 4, error handling 2, loops 1 (nesting depth added 10). None of this is in the body itself: all 37 points belong to 2 function literals inside it that branch (lines 58, 177). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WatcherDirectoriesAnalyzer::analyze (cognitive 36) crates/rspack_watcher/src/analyzer/directories.rs:35— WatcherDirectoriesAnalyzer::analyze has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ESMExportExpressionDependencyTemplate::render (cognitive 34) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs:157— ESMExportExpressionDependencyTemplate::render has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_rstest::import_dependency::module_namespace_promise_rstest (cognitive 33) crates/rspack_plugin_rstest/src/import_dependency.rs:184— rspack_plugin_rstest::import_dependency::module_namespace_promise_rstest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Compiler.getInfrastructureLogger (cognitive 33) packages/rspack/src/Compiler.ts:457— Compiler.getInfrastructureLogger has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (33 pts) (nesting depth added 18). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 482, 466, 478, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Cutout::cutout_artifact (cognitive 31) crates/rspack_core/src/compilation/build_module_graph/graph_updater/cutout/mod.rs:28— Cutout::cutout_artifact has cognitive complexity 31 (threshold 15). Drivers by points: loops 9 (16 pts), if/else 6 (11 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rspack_plugin_real_content_hash::inner_impl (cognitive 31) crates/rspack_plugin_real_content_hash/src/lib.rs:82— rspack_plugin_real_content_hash::inner_impl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 7 (12 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cleverMerge.mergeSingleValue (cognitive 31) packages/rspack/src/util/cleverMerge.ts:457— cleverMerge.mergeSingleValue has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 2 (8 pts), if/else 2 (5 pts), match/switch 2 (3 pts) (nesting depth added 20). Of this number, 28 points are the body's own statements and 3 belong to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_javascript_compiler::compiler::stringify::build_rspack_source_map (cognitive 30) crates/rspack_javascript_compiler/src/compiler/stringify.rs:167— rspack_javascript_compiler::compiler::stringify::build_rspack_source_map has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_dll::lib_manifest_plugin::emit (cognitive 30) crates/rspack_plugin_dll/src/lib_manifest_plugin.rs:53— rspack_plugin_dll::lib_manifest_plugin::emit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (7 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompilerOptionsBuilder::build (cognitive 29) crates/rspack/src/builder/mod.rs:936— CompilerOptionsBuilder::build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FlagDependencyExportsState::apply (cognitive 29) crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:35— FlagDependencyExportsState::apply has cognitive complexity 29 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 4 (10 pts), boolean chains 1 (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rspack_plugin_size_limits::after_emit (cognitive 29) crates/rspack_plugin_size_limits/src/lib.rs:134— rspack_plugin_size_limits::after_emit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportedEnumCollector::visit_program (cognitive 29) crates/swc_plugin_ts_collector/src/enums.rs:314— ExportedEnumCollector::visit_program has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
loadConfig.loadExtendedConfig (cognitive 29) packages/rspack-cli/src/utils/loadConfig.ts:112— loadConfig.loadExtendedConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2 (6 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeWatchFileSystem.watch (cognitive 29) packages/rspack/src/NativeWatchFileSystem.ts:160— NativeWatchFileSystem.watch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12, loops 4 (8 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 224, info, a function literal at line 266, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
JavaScriptTransformer::input_source_map (cognitive 28) crates/rspack_javascript_compiler/src/compiler/transform.rs:529— JavaScriptTransformer::input_source_map has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 8 (12 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExternalsPlugin::handle_external (cognitive 28) crates/rspack_plugin_externals/src/plugin.rs:37— ExternalsPlugin::handle_external has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 5). Of this number, 25 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_json::create_object_for_exports_info (cognitive 28) crates/rspack_plugin_json/src/lib.rs:278— rspack_plugin_json::create_object_for_exports_info has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleChunkLoadingRuntimeModule::generate (cognitive 28) crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:267— ModuleChunkLoadingRuntimeModule::generate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
compilation.createCompilationHooksRegisters (cognitive 28) packages/rspack/src/taps/compilation.ts:31— compilation.createCompilationHooksRegisters has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 5, boolean chains 3, ternaries 3, error handling 1 (nesting depth added 2). None of this is in the body itself: all 28 points belong to 8 function literals inside it that branch (lines 419, 216, 140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SwcLoader::loader_impl (cognitive 27) crates/rspack_loader_swc/src/lib.rs:58— SwcLoader::loader_impl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_module_info_header::print_exports_info_to_source (cognitive 27) crates/rspack_plugin_module_info_header/src/lib.rs:30— rspack_plugin_module_info_header::print_exports_info_to_source has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (8 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiCompiler.validateDependencies (cognitive 27) packages/rspack/src/MultiCompiler.ts:247— MultiCompiler.validateDependencies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 13). Of this number, 23 points are the body's own statements and 4 belong to 2 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_dojang::eval::get_tokens_belong_to_accessor (cognitive 26) crates/rspack_dojang/src/eval.rs:211— rspack_dojang::eval::get_tokens_belong_to_accessor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (10 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsumeSharedPlugin::get_required_version (cognitive 26) crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs:210— ConsumeSharedPlugin::get_required_version has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StdoutTracer::sync_trace (cognitive 26) crates/rspack_tracing/src/stdout.rs:107— StdoutTracer::sync_trace has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (8 pts), match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fs.rmrf (cognitive 26) packages/rspack/src/util/fs.ts:590— fs.rmrf has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 14). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 603, 595, 616). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MultiStats.toJson (cognitive 26) packages/rspack/src/MultiStats.ts:75— MultiStats.toJson has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 6, boolean chains 5, ternaries 1 (nesting depth added 8). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
validateConfig.validateExternalUmd (cognitive 26) packages/rspack/src/util/validateConfig.ts:31— validateConfig.validateExternalUmd has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 7). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (checkExternalItem, checkExternalItemValue). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
OutputOptionsBuilder::build (cognitive 25) crates/rspack/src/builder/mod.rs:2698— OutputOptionsBuilder::build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, loops 3, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CollectSharedEntryPlugin::infer_version (cognitive 25) crates/rspack_plugin_mf/src/sharing/collect_shared_entry_plugin.rs:48— CollectSharedEntryPlugin::infer_version has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser::parse_tag (cognitive 24) crates/rspack_dojang/src/expr.rs:189— Parser::parse_tag has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 6 (9 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LightningCssLoader::loader_impl (cognitive 24) crates/rspack_loader_lightningcss/src/lib.rs:100— LightningCssLoader::loader_impl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_napi::utils::unknown_to_json_value (cognitive 24) crates/rspack_napi/src/utils.rs:28— rspack_napi::utils::unknown_to_json_value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScopeInfoDB::set_symbol (cognitive 24) crates/rspack_plugin_javascript/src/visitors/scope_info/semantic.rs:261— ScopeInfoDB::set_symbol has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cleverMerge.mergeEntries (cognitive 24) packages/rspack/src/util/cleverMerge.ts:327— cleverMerge.mergeEntries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 11). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
NodeOptionBuilder::build (cognitive 23) crates/rspack/src/builder/mod.rs:1625— NodeOptionBuilder::build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ConcatenationContext::prepare (cognitive 23) crates/rspack_core/src/concatenation_backend.rs:845— ConcatenationContext::prepare has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (11 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BasicEvaluatedExpression::as_string (cognitive 23) crates/rspack_plugin_javascript/src/utils/eval/mod.rs:304— BasicEvaluatedExpression::as_string has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsumeSharedRuntimeModule::generate (cognitive 23) crates/rspack_plugin_mf/src/sharing/consume_shared_runtime_module.rs:103— ConsumeSharedRuntimeModule::generate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 4 (6 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProgressPlugin::default_handler (cognitive 23) crates/rspack_plugin_progress/src/lib.rs:202— ProgressPlugin::default_handler has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RscEntryModule::build (cognitive 23) crates/rspack_plugin_rsc/src/rsc_entry_module.rs:238— RscEntryModule::build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubresourceIntegrityPlugin.apply (cognitive 23) packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts:257— SubresourceIntegrityPlugin.apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 268, bindingHtmlHooks, a function literal at line 296). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TokenStream::fast_forward_selector_if_buffer_empty (cognitive 22) crates/css-module-lexer/src/lexer.rs:2536— TokenStream::fast_forward_selector_if_buffer_empty has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommonJsExportsDependencyTemplate::render (cognitive 22) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:168— CommonJsExportsDependencyTemplate::render has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (22 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeStuffPlugin::identifier (cognitive 22) crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:134— NodeStuffPlugin::identifier has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResolveOptions::fmt (cognitive 22) crates/rspack_resolver/src/options.rs:532— ResolveOptions::fmt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
loadLoader.loadLoader (cognitive 22) packages/rspack/src/loader-runner/loadLoader.ts:33— loadLoader.loadLoader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
utils.runSyncOrAsync (cognitive 22) packages/rspack/src/loader-runner/utils.ts:49— utils.runSyncOrAsync has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, error handling 2 (nesting depth added 8). Of this number, 18 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cleverMerge.serializeObject (cognitive 22) packages/rspack/src/util/cleverMerge.ts:177— cleverMerge.serializeObject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
rspack_plugin_externals::plugin::factorize (cognitive 21) crates/rspack_plugin_externals/src/plugin.rs:203— rspack_plugin_externals::plugin::factorize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RstestPlugin::resolve_mock_request (cognitive 21) crates/rspack_plugin_rstest/src/plugin.rs:281— RstestPlugin::resolve_mock_request has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RspackCLI.buildConfig::internalBuildConfig (cognitive 21) packages/rspack-cli/src/cli.ts:212— RspackCLI.buildConfig::internalBuildConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
loader.pitch::handleExports (cognitive 21) packages/rspack/src/builtin-plugin/css-extract/loader.ts:163— loader.pitch::handleExports has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (2 pts), ternaries 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Compilation::par_rename_assets (cognitive 20) crates/rspack_core/src/compilation/mod.rs:922— Compilation::par_rename_assets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequireEnsureDependenciesBlockParserPlugin::call (cognitive 20) crates/rspack_plugin_javascript/src/parser_plugin/require_ensure_dependencies_block_parse_plugin.rs:72— RequireEnsureDependenciesBlockParserPlugin::call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
URLPlugin::new_expression (cognitive 20) crates/rspack_plugin_javascript/src/parser_plugin/url_plugin.rs:106— URLPlugin::new_expression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SideEffectsFlagPlugin::get_owning_side_effects (cognitive 20) crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs:124— SideEffectsFlagPlugin::get_owning_side_effects has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_module_replacement::context_replacement::cmf_after_resolve (cognitive 20) crates/rspack_plugin_module_replacement/src/context_replacement.rs:73— rspack_plugin_module_replacement::context_replacement::cmf_after_resolve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachedPathImpl::package_json (cognitive 20) crates/rspack_resolver/src/cache.rs:380— CachedPathImpl::package_json has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack.rspack (cognitive 20) packages/rspack/src/rspack.ts:112— rspack.rspack has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 5). Of this number, 17 points are the body's own statements and 3 belong to 2 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Modules::visit_item_mod (cognitive 19) crates/rspack_allocative_driver/src/source_tree.rs:128— Modules::visit_item_mod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimeRequirementsDependencyTemplate::render (cognitive 19) crates/rspack_core/src/dependency/runtime_requirements_dependency.rs:211— RuntimeRequirementsDependencyTemplate::render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CacheContext::load_snapshot (cognitive 19) crates/rspack_core/src/legacy_cache/persistent/context.rs:195— CacheContext::load_snapshot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileCacheStrategy::after_all_stored_impl (cognitive 19) crates/rspack_core/src/new_cache/file_cache_strategy.rs:325— FileCacheStrategy::after_all_stored_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectiveVisitor::visit_stmt (cognitive 19) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:2340— DirectiveVisitor::visit_stmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
WalkData::setup_record (cognitive 19) crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/walk_data.rs:237— WalkData::setup_record has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 19 points belong to 5 function items inside it that branch (apply_define, walk_code, apply_define_key, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
JsonpChunkLoadingRuntimeModule::generate (cognitive 19) crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:277— JsonpChunkLoadingRuntimeModule::generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Algo::try_compile_to_end_with_fast_path (cognitive 19) crates/rspack_regex/src/algo.rs:131— Algo::try_compile_to_end_with_fast_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Bucket::need_update_packs (cognitive 19) crates/rspack_storage/src/filesystem/db/bucket/mod.rs:173— Bucket::need_update_packs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Executor::wait_for_execute (cognitive 19) crates/rspack_watcher/src/executor.rs:156— Executor::wait_for_execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (5 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.runBuild (cognitive 19) packages/rspack-cli/src/commands/build.ts:23— build.runBuild has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (errorHandler, errorHandler::getStatsOptions, a function literal at line 59, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.getSwcLoaderOptions (cognitive 19) packages/rspack/src/builtin-loader/swc/index.ts:40— index.getSwcLoaderOptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
findBaseCommit (cognitive 19) .github/actions/binary-limit/binary-limit-script.mjs:108— findBaseCommit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockItemCandidates::observe (cognitive 18) crates/css-module-lexer/src/parser.rs:217— BlockItemCandidates::observe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ExportsInfoData::set_unknown_exports_provided (cognitive 18) crates/rspack_core/src/exports/exports_info_setter.rs:43— ExportsInfoData::set_unknown_exports_provided has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RspackLoaderRunnerPlugin::process_resource (cognitive 18) crates/rspack_core/src/loader/rspack_loader.rs:37— RspackLoaderRunnerPlugin::process_resource has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 4 (8 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ModuleGraph::revoke_dependency (cognitive 18) crates/rspack_core/src/module_graph/mod.rs:285— ModuleGraph::revoke_dependency has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssModuleGenerator::render_css_dependencies (cognitive 18) crates/rspack_plugin_css/src/parser_and_generator/generator.rs:386— CssModuleGenerator::render_css_dependencies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack_plugin_dynamic_entry::make (cognitive 18) crates/rspack_plugin_dynamic_entry/src/lib.rs:56— rspack_plugin_dynamic_entry::make has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RequireContextDependencyParserPlugin::call (cognitive 18) crates/rspack_plugin_javascript/src/parser_plugin/require_context_dependency_parser_plugin.rs:23— RequireContextDependencyParserPlugin::call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Combinator::prepare_direct_groups (cognitive 18) crates/rspack_plugin_split_chunks/src/plugin/module_group.rs:433— Combinator::prepare_direct_groups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fs.mkdirp (cognitive 18) packages/rspack/src/util/fs.ts:664— fs.mkdirp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 669, 682, 677). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
OptimizationOptionsBuilder::build (cognitive 17) crates/rspack/src/builder/mod.rs:3494— OptimizationOptionsBuilder::build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileSystemDependencies::values (cognitive 17) crates/rspack_binding_api/src/compilation/dependencies.rs:204— FileSystemDependencies::values has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RawSplitChunksOptions::normalize (cognitive 17) crates/rspack_binding_api/src/raw_options/raw_split_chunks/mod.rs:123— RawSplitChunksOptions::normalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModuleTracker::finish_module (cognitive 17) crates/rspack_core/src/compilation/build_module_graph/module_executor/module_tracker.rs:60— ModuleTracker::finish_module has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OverlayIter::next (cognitive 17) crates/rspack_core/src/module_graph/rollback/overlay_map.rs:51— OverlayIter::next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NativeFileSystem::read_dir_sync (cognitive 17) crates/rspack_fs/src/native_fs.rs:239— NativeFileSystem::read_dir_sync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::scan (cognitive 17) crates/rspack_watcher/src/scanner.rs:35— Scanner::scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack.wasi-browser.__attachCleanupErrors (cognitive 17) crates/node_binding/rspack.wasi-browser.js:181— rspack.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rspack.wasi-browser.__drainWasmEnvCleanup (cognitive 17) crates/node_binding/rspack.wasi-browser.js:716— rspack.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerReferencePlugin.raw (cognitive 17) packages/rspack/src/container/ContainerReferencePlugin.ts:75— ContainerReferencePlugin.raw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check (cognitive 17) packages/rspack/hot/dev-server.js:15— check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), error handling 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 18, 47). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DeclarationCandidate::advance (cognitive 16) crates/css-module-lexer/src/parser.rs:94— DeclarationCandidate::advance has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleSetLogicalConditions::try_match_sync (cognitive 16) crates/rspack_core/src/options/module.rs:1528— RuleSetLogicalConditions::try_match_sync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), match/switch 3 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Context::get_value (cognitive 16) crates/rspack_dojang/src/context.rs:53— Context::get_value has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RealDependencyLocation::from_byte_location (cognitive 16) crates/rspack_location/src/lib.rs:45— RealDependencyLocation::from_byte_location has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rspack_plugin_circular_dependencies::circular_dependency_rspack_plugin::optimize_modules (cognitive 16) crates/rspack_plugin_circular_dependencies/src/circular_dependency_rspack_plugin.rs:365— rspack_plugin_circular_dependencies::circular_dependency_rspack_plugin::optimize_modules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AMDRequireDependenciesBlockParserPlugin::process_array (cognitive 16) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:60— AMDRequireDependenciesBlockParserPlugin::process_array has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Group::pop_nodes (cognitive 16) crates/rspack_plugin_split_chunks/src/plugin/max_size.rs:56— Group::pop_nodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Watching.#go (cognitive 16) packages/rspack/src/Watching.ts:284— Watching.#go has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 343, run, a function literal at line 332, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Compiler.run (cognitive 16) packages/rspack/src/Compiler.ts:559— Compiler.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 8 function items inside it that branch (finalCallback, onCompiled, a function literal at line 604, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ModuleFederationPlugin.getRemoteInfos (cognitive 16) packages/rspack/src/container/ModuleFederationPlugin.ts:175— ModuleFederationPlugin.getRemoteInfos has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (nesting depth added 3). Of this number, 9 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CssExtractRspackPlugin.normalizeOptions (cognitive 16) packages/rspack/src/builtin-plugin/css-extract/index.ts:78— CssExtractRspackPlugin.normalizeOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubresourceIntegrityPlugin.processTag (cognitive 16) packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts:186— SubresourceIntegrityPlugin.processTag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Near-duplicate member pair (80 shared lines) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:381— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:381-539 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:546-682 — These two members are variants of one another: 80 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (79 shared lines) crates/rspack_core/src/stats/mod.rs:966— crates/rspack_core/src/stats/mod.rs:966-1047 | crates/rspack_core/src/stats/mod.rs:1049-1132 — These two members are variants of one another: 79 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (73 shared lines) crates/rspack_binding_api/src/compilation/mod.rs:908— crates/rspack_binding_api/src/compilation/mod.rs:908-1002 | crates/rspack_binding_api/src/compilation/mod.rs:1012-1105 — These two members are variants of one another: 73 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (69 shared lines) crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:251— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:251-391 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:262-393 — 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.
Near-duplicate member pair (63 shared lines) crates/css-module-lexer/src/dependencies.rs:2845— crates/css-module-lexer/src/dependencies.rs:2845-2957 | crates/css-module-lexer/src/dependencies.rs:3044-3168 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (44 shared lines) crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:542— crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:542-602 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:609-666 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:285— crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:285-346 | crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs:360-415 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/rspack_plugin_library/src/amd_library_plugin.rs:94— crates/rspack_plugin_library/src/amd_library_plugin.rs:94-170 | crates/rspack_plugin_library/src/assign_library_plugin.rs:149-186 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:77-109 | crates/rspack_plugin_library/src/umd_library_plugin.rs:377-396 | crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs:42-79 | crates/rspack_plugin_runtime/src/runtime_module/utils.rs:113-142 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:150— crates/rspack_plugin_runtime/src/runtime_module/import_scripts_chunk_loading.rs:150-184 | crates/rspack_plugin_runtime/src/runtime_module/jsonp_chunk_loading.rs:183-230 | crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:182-224 | crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:177-213 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:184-220 — 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 (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) crates/rspack_plugin_library/src/assign_library_plugin.rs:449— crates/rspack_plugin_library/src/assign_library_plugin.rs:449-503 | crates/rspack_plugin_library/src/export_property_library_plugin.rs:120-178 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:391— crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:391-446 | crates/rspack_core/src/new_cache/snapshot/file_system_info.rs:455-510 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:544— crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:544-626 | crates/rspack_plugin_extract_css/src/plugin.rs:677-746 — 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 (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:178— crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs:178-229 | crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs:111-157 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) crates/rspack_core/src/chunk.rs:887— crates/rspack_core/src/chunk.rs:887-953 | crates/rspack_core/src/stats/utils.rs:191-241 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) crates/rspack_dojang/src/eval.rs:279— crates/rspack_dojang/src/eval.rs:279-337 | crates/rspack_dojang/src/eval.rs:339-407 — 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) crates/rspack_plugin_runtime/src/import_scripts_chunk_loading.rs:49— crates/rspack_plugin_runtime/src/import_scripts_chunk_loading.rs:49-109 | crates/rspack_plugin_runtime/src/jsonp_chunk_loading.rs:48-109 — 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) crates/rspack_plugin_esm_library/src/link.rs:81— crates/rspack_plugin_esm_library/src/link.rs:81-120 | crates/rspack_plugin_esm_library/src/link.rs:146-186 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) crates/rspack_plugin_runtime/src/runtime_module/get_chunk_update_filename.rs:55— crates/rspack_plugin_runtime/src/runtime_module/get_chunk_update_filename.rs:55-100 | crates/rspack_plugin_runtime/src/runtime_module/get_main_filename.rs:60-106 — 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 (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:224— crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:224-293 | crates/rspack_binding_api/src/raw_options/raw_module/mod.rs:738-797 — 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) crates/rspack_ids/src/id_helpers.rs:473— crates/rspack_ids/src/id_helpers.rs:473-514 | crates/rspack_ids/src/id_helpers.rs:540-580 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 17+ corresponding lines) · ×1
Edited copies of one member (7 members, 17+ corresponding lines) crates/rspack_dojang/src/context.rs:672— crates/rspack_dojang/src/context.rs:672-688 | crates/rspack_dojang/src/context.rs:690-706 | crates/rspack_dojang/src/context.rs:708-724 | crates/rspack_dojang/src/context.rs:726-742 | crates/rspack_dojang/src/context.rs:744-761 | crates/rspack_dojang/src/context.rs:763-780 | crates/rspack_dojang/src/context.rs:782-800 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 39+ corresponding lines) · ×1
Edited copies of one member (3 members, 39+ corresponding lines) crates/rspack_core/src/chunk.rs:411— crates/rspack_core/src/chunk.rs:411-450 | crates/rspack_core/src/chunk.rs:455-495 | crates/rspack_core/src/chunk.rs:500-538 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:913— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:913-948 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:980-1016 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:199— crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:199-228 | crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:235-262 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) crates/rspack_core/src/normal_module_factory.rs:48— crates/rspack_core/src/normal_module_factory.rs:48-72 | crates/rspack_core/src/normal_module_factory.rs:76-100 — 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 copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) crates/rspack_resolver/src/lib.rs:167— crates/rspack_resolver/src/lib.rs:167-184 | crates/rspack_resolver/src/lib.rs:188-205 | crates/rspack_resolver/src/lib.rs:209-226 — 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 (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) crates/rspack_binding_api/src/compilation/code_generation_results.rs:110— crates/rspack_binding_api/src/compilation/code_generation_results.rs:110-122 | crates/rspack_binding_api/src/exports_info.rs:40-53 | crates/rspack_binding_api/src/exports_info.rs:56-69 | crates/rspack_binding_api/src/exports_info.rs:72-85 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) crates/rspack_binding_api/src/module_graph_connection.rs:79— crates/rspack_binding_api/src/module_graph_connection.rs:79-91 | crates/rspack_binding_api/src/module_graph_connection.rs:94-106 | crates/rspack_binding_api/src/module_graph_connection.rs:109-125 — 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· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/import_meta_path.rs:163— crates/rspack_plugin_javascript/src/parser_plugin/import_meta_path.rs:163-186 | crates/rspack_plugin_javascript/src/parser_plugin/node_stuff_plugin.rs:60-82 — 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 (4 members, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) crates/rspack_binding_api/src/fs_node/write.rs:332— crates/rspack_binding_api/src/fs_node/write.rs:332-350 | crates/rspack_binding_api/src/fs_node/write.rs:352-370 | crates/rspack_binding_api/src/fs_node/write.rs:371-389 | crates/rspack_binding_api/src/fs_node/write.rs:436-454 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) crates/rspack_core/src/module_graph/mod.rs:1100— crates/rspack_core/src/module_graph/mod.rs:1100-1118 | crates/rspack_core/src/module_graph/mod.rs:1123-1141 | crates/rspack_core/src/module_graph/mod.rs:1150-1171 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) crates/rspack_binding_api/src/html.rs:243— crates/rspack_binding_api/src/html.rs:243-260 | crates/rspack_binding_api/src/html.rs:264-281 | crates/rspack_binding_api/src/html.rs:295-312 | crates/rspack_binding_api/src/html.rs:316-333 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:43— crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:43-66 | crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:47-69 | crates/rspack_plugin_runtime/src/module_chunk_format.rs:56-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 15+ corresponding lines) · ×1
Edited copies of one member (6 members, 15+ corresponding lines) crates/rspack_binding_api/src/fs_node/write.rs:193— crates/rspack_binding_api/src/fs_node/write.rs:193-207 | crates/rspack_binding_api/src/fs_node/write.rs:216-230 | crates/rspack_binding_api/src/fs_node/write.rs:233-247 | crates/rspack_binding_api/src/fs_node/write.rs:250-264 | crates/rspack_binding_api/src/fs_node/write.rs:267-281 | crates/rspack_binding_api/src/fs_node/write.rs:288-302 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) crates/rspack_binding_api/src/compilation/dependencies.rs:32— crates/rspack_binding_api/src/compilation/dependencies.rs:32-42 | crates/rspack_binding_api/src/compilation/dependencies.rs:47-57 | crates/rspack_binding_api/src/file_system_dependency_strings.rs:19-31 | crates/rspack_binding_api/src/lib.rs:171-183 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) crates/rspack_core/src/runtime_template.rs:526— crates/rspack_core/src/runtime_template.rs:526-542 | crates/rspack_core/src/runtime_template.rs:549-567 | crates/rspack_core/src/runtime_template.rs:574-592 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 18+ corresponding lines) · ×1
Edited copies of one member (7 members, 18+ corresponding lines) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:209— crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_require_dependency.rs:209-228 | crates/rspack_plugin_javascript/src/dependency/commonjs/require_resolve_dependency.rs:145-162 | crates/rspack_plugin_javascript/src/dependency/esm/import_meta_resolve_dependency.rs:102-121 | crates/rspack_plugin_javascript/src/dependency/hmr/import_meta_hot_accept.rs:92-111 | crates/rspack_plugin_javascript/src/dependency/hmr/import_meta_hot_decline.rs:92-111 | crates/rspack_plugin_javascript/src/dependency/hmr/module_hot_accept.rs:92-109 | crates/rspack_plugin_javascript/src/dependency/hmr/module_hot_decline.rs:92-109 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×1
Edited copies of one member (5 members, 9+ corresponding lines) crates/rspack_core/src/binding/cell.rs:209— crates/rspack_core/src/binding/cell.rs:209-217 | crates/rspack_core/src/binding/cell.rs:227-235 | crates/rspack_core/src/binding/cell.rs:245-253 | crates/rspack_core/src/binding/cell.rs:263-272 | crates/rspack_core/src/binding/cell.rs:282-291 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 14+ corresponding lines) · ×1
Edited copies of one member (7 members, 14+ corresponding lines) crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:56— crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:56-69 | crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:75-88 | crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:94-109 | crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:115-128 | crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:134-147 | crates/rspack_core/src/artifacts/module_graph_cache_artifact.rs:153-166 | crates/rspack_core/src/transient_cache/module_static_cache.rs:34-47 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) crates/rspack_core/src/raw_module.rs:136— crates/rspack_core/src/raw_module.rs:136-141 | crates/rspack_plugin_dll/src/dll_entry/dll_module.rs:135-142 | crates/rspack_plugin_dll/src/dll_reference/delegated_module.rs:198-205 | crates/rspack_plugin_mf/src/sharing/consume_shared_module.rs:296-301 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) crates/rspack_binding_api/src/chunk.rs:107— crates/rspack_binding_api/src/chunk.rs:107-114 | crates/rspack_binding_api/src/chunk.rs:117-126 | crates/rspack_binding_api/src/chunk.rs:154-166 | crates/rspack_binding_api/src/chunk.rs:182-194 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) crates/rspack_core/src/options/module.rs:1649— crates/rspack_core/src/options/module.rs:1649-1659 | crates/rspack_core/src/options/module.rs:1664-1674 | crates/rspack_core/src/utils/module_rules.rs:42-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) crates/rspack_plugin_mf/src/container/container_plugin.rs:167— crates/rspack_plugin_mf/src/container/container_plugin.rs:167-179 | crates/rspack_plugin_mf/src/sharing/provide_shared_plugin.rs:337-345 | crates/rspack_plugin_mf/src/sharing/shared_container_plugin.rs:104-112 | crates/rspack_plugin_rsc/src/client_plugin.rs:597-610 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:185— crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_export_require_dependency.rs:185-188 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:140-143 | crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:111-114 — 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 copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs:193— crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs:193-196 | crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:141-144 — 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.
Duplicated block (47 lines × 2) crates/rspack_plugin_library/src/assign_library_plugin.rs:450— crates/rspack_plugin_library/src/assign_library_plugin.rs:450-496 | crates/rspack_plugin_library/src/export_property_library_plugin.rs:121-167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_library/src/assign_library_plugin.rs:450` it does not close everything it opens, so those 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 `compilation` to `&Compilation` in one and `&mut Compilation` 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 (37–38 lines × 2) crates/rspack_core/src/context_module.rs:1112— crates/rspack_core/src/context_module.rs:1112-1149 | crates/rspack_core/src/context_module.rs:1223-1259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/context_module.rs:1112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (49–51 lines × 2) crates/rspack_core/src/stats/mod.rs:999— crates/rspack_core/src/stats/mod.rs:999-1047 | crates/rspack_core/src/stats/mod.rs:1082-1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/stats/mod.rs:999` 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 (31 lines × 2) crates/rspack_binding_api/src/compilation/mod.rs:972— crates/rspack_binding_api/src/compilation/mod.rs:972-1002 | crates/rspack_binding_api/src/compilation/mod.rs:1075-1105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/compilation/mod.rs:972` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:512— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:512-539 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:655-682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:512` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:135— crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:135-161 | crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:118-144 | crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs:107-133 — before extracting anything, compare `crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs` and `crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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–26 lines × 2) crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:900— crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:900-923 | crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:1050-1075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_loader_swc/src/rsc_transforms/server_actions.rs:900` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–24 lines × 2) crates/rspack_core/src/compiler/mod.rs:259— crates/rspack_core/src/compiler/mod.rs:259-279 | crates/rspack_core/src/compiler/rebuild.rs:27-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/compiler/mod.rs:259` 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 (23–24 lines × 2) crates/rspack_core/src/context_module.rs:1026— crates/rspack_core/src/context_module.rs:1026-1049 | crates/rspack_core/src/context_module.rs:1213-1235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/context_module.rs:1026` 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 (23 lines × 2) crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:668— crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:668-690 | crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:740-762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:668` 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–21 lines × 2) crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:149— crates/rspack_plugin_devtool/src/eval_source_map_dev_tool_plugin.rs:149-164 | crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs:122-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `compilation` to `&mut Compilation` in one and `&Compilation` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19–21 lines × 2) crates/rspack_tracing_perfetto/src/lib.rs:215— crates/rspack_tracing_perfetto/src/lib.rs:215-235 | crates/rspack_tracing_perfetto/src/lib.rs:318-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) crates/rspack_core/src/context_module.rs:1081— crates/rspack_core/src/context_module.rs:1081-1100 | crates/rspack_core/src/context_module.rs:1204-1221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_core/src/context_module.rs:1222` calls `returning_function` and `crates/rspack_core/src/context_module.rs:1100` 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 (19–20 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:354— crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:354-372 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:355-374 — before extracting anything, compare `crates/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs` and `crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/rspack_plugin_runtime/src/runtime_module/readfile_chunk_loading.rs:354` it does not close everything it opens, so those exact lines 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 × 3) crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:515— crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:515-533 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:557-575 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:624-642 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:515` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:555` calls `span`, `arguments` and `crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:623` 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 (25 lines × 2) crates/css-module-lexer/src/dependencies.rs:2366— crates/css-module-lexer/src/dependencies.rs:2366-2390 | crates/css-module-lexer/src/dependencies.rs:2679-2703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:2366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 5) crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:516— crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:516-531 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:558-573 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:585-601 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:625-640 | crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:649-665 — 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/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs:585` it begins part-way through the construct above it, so those 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 × 4) crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:292— crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs:292-307 | crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs:136-151 | crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs:119-134 | crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs:108-123 — before extracting anything, compare `crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs` and `crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–16 lines × 2) crates/rspack_napi/src/threadsafe_function.rs:174— crates/rspack_napi/src/threadsafe_function.rs:174-187 | crates/rspack_napi/src/threadsafe_function.rs:216-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/rspack_napi/src/threadsafe_function.rs:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:48— crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:48-63 | crates/rspack_plugin_runtime/src/module_chunk_format.rs:57-72 — before extracting anything, compare `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs` and `crates/rspack_plugin_runtime/src/module_chunk_format.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/rspack_plugin_runtime/src/common_js_chunk_format.rs:65` calls `insert` and `crates/rspack_plugin_runtime/src/module_chunk_format.rs:74` 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–15 lines × 2) crates/rspack_plugin_javascript/src/magic_comment.rs:508— crates/rspack_plugin_javascript/src/magic_comment.rs:508-520 | crates/rspack_plugin_javascript/src/magic_comment.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/rspack_plugin_javascript/src/magic_comment.rs:508` 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–14 lines × 3) crates/rspack_plugin_esm_library/src/optimize_chunks.rs:646— crates/rspack_plugin_esm_library/src/optimize_chunks.rs:646-659 | crates/rspack_plugin_esm_library/src/optimize_chunks.rs:701-713 | crates/rspack_plugin_esm_library/src/optimize_chunks.rs:765-777 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:232— crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:232-244 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:332-344 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:480-492 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:232` 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–13 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:201— crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:201-212 | crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:214-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/rspack_plugin_javascript/src/parser_plugin/define_plugin/parser.rs:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 4) crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:230— crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:230-241 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:330-341 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:406-417 | crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:478-489 — 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/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:419` calls `walk_arguments`, `nodes`, `arguments` and `crates/rspack_plugin_javascript/src/parser_plugin/esm_import_dependency_parser_plugin.rs:243` 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–12 lines × 3) crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1321— crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1321-1332 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1335-1346 | crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1347-1352 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs:1321` 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 (10–11 lines × 6) crates/rspack_plugin_library/src/amd_library_plugin.rs:143— crates/rspack_plugin_library/src/amd_library_plugin.rs:143-152 | crates/rspack_plugin_library/src/assign_library_plugin.rs:160-170 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:92-101 | crates/rspack_plugin_library/src/umd_library_plugin.rs:385-395 | crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs:62-71 | crates/rspack_plugin_runtime/src/runtime_module/utils.rs:126-135 — before extracting anything, compare `crates/rspack_plugin_library/src/amd_library_plugin.rs` and `crates/rspack_plugin_library/src/jsonp_library_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_library/src/amd_library_plugin.rs:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `compilation` to `&mut Compilation` in one and `&Compilation` 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 × 3) crates/rspack_core/src/stats/mod.rs:1021— crates/rspack_core/src/stats/mod.rs:1021-1034 | crates/rspack_core/src/stats/mod.rs:1106-1119 | crates/rspack_core/src/stats/mod.rs:1819-1832 — all 3 copies are in the same file, so extract the block into one function there and call 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/rspack_core/src/stats/mod.rs:1021` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) crates/css-module-lexer/src/dependencies.rs:1293— crates/css-module-lexer/src/dependencies.rs:1293-1303 | crates/css-module-lexer/src/dependencies.rs:1354-1362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/css-module-lexer/src/dependencies.rs:1293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 4) crates/rspack_binding_api/src/build_info.rs:149— crates/rspack_binding_api/src/build_info.rs:149-158 | crates/rspack_binding_api/src/build_info.rs:174-183 | crates/rspack_binding_api/src/build_info.rs:199-208 | crates/rspack_binding_api/src/build_info.rs:224-233 — 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/rspack_binding_api/src/build_info.rs:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–10 lines × 2) crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:307— crates/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:307-316 | crates/rspack_plugin_runtime/src/runtime_module/require_js_chunk_loading.rs:279-285 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_plugin_runtime/src/runtime_module/module_chunk_loading.rs:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 2) crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:474— crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:474-480 | crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:510-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_plugin_javascript/src/parser_plugin/inner_graph/plugin.rs:510` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–8 lines × 4) crates/rspack_binding_api/src/async_dependency_block.rs:147— crates/rspack_binding_api/src/async_dependency_block.rs:147-150 | crates/rspack_binding_api/src/chunk.rs:384-391 | crates/rspack_binding_api/src/chunk_group.rs:227-234 | crates/rspack_binding_api/src/module_graph_connection.rs:228-235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_binding_api/src/async_dependency_block.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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/rspack_binding_api/src/chunk.rs:384` calls `entry` and `crates/rspack_binding_api/src/async_dependency_block.rs:147` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 12) crates/rspack/src/builder/browserslist_target.rs:112— crates/rspack/src/builder/browserslist_target.rs:112-118 | crates/rspack/src/builder/browserslist_target.rs:133-139 | crates/rspack/src/builder/browserslist_target.rs:153-159 | crates/rspack/src/builder/browserslist_target.rs:174-180 | crates/rspack/src/builder/browserslist_target.rs:192-198 | crates/rspack/src/builder/browserslist_target.rs:210-216 | crates/rspack/src/builder/browserslist_target.rs:231-237 | crates/rspack/src/builder/browserslist_target.rs:254-260 | crates/rspack/src/builder/browserslist_target.rs:272-278 | crates/rspack/src/builder/browserslist_target.rs:290-296 | crates/rspack/src/builder/browserslist_target.rs:311-317 | crates/rspack/src/builder/browserslist_target.rs:332-338 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack/src/builder/browserslist_target.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/rspack/src/builder/browserslist_target.rs:251` calls `Some` and `crates/rspack/src/builder/browserslist_target.rs:131` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 2) crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1022— crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1022-1027 | crates/rspack_plugin_split_chunks/src/plugin/chunk.rs:138-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs:1022` it does not close everything it opens, so those 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 (42 lines × 2) crates/rspack_core/src/artifacts/cgc_runtime_requirements_artifact.rs:17— crates/rspack_core/src/artifacts/cgc_runtime_requirements_artifact.rs:17-58 | crates/rspack_core/src/artifacts/chunk_render_artifact.rs:17-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_core/src/artifacts/cgc_runtime_requirements_artifact.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.
Duplicated block (38 lines × 2) crates/rspack_core/src/artifacts/dependencies_diagnostics_artifact.rs:16— crates/rspack_core/src/artifacts/dependencies_diagnostics_artifact.rs:16-63 | crates/rspack_core/src/artifacts/module_ids_artifact.rs:17-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/rspack_core/src/artifacts/dependencies_diagnostics_artifact.rs:16` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 6) crates/rspack_core/src/context_module.rs:1599— crates/rspack_core/src/context_module.rs:1599-1603 | crates/rspack_plugin_mf/src/container/container_entry_module.rs:455-459 | crates/rspack_plugin_mf/src/container/fallback_module.rs:197-201 | crates/rspack_plugin_mf/src/container/remote_module.rs:225-229 | crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs:236-240 | crates/rspack_plugin_rsc/src/rsc_entry_module.rs:393-397 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_core/src/context_module.rs:1599` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:54— crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs:54-62 | crates/rspack_plugin_html/src/plugin.rs:47-55 | crates/rspack_plugin_real_content_hash/src/lib.rs:44-52 | crates/rspack_plugin_rsdoctor/src/plugin.rs:223-231 | crates/rspack_plugin_runtime/src/runtime_plugin.rs:91-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (8 lines × 5) crates/rspack_plugin_library/src/amd_library_plugin.rs:218— crates/rspack_plugin_library/src/amd_library_plugin.rs:218-225 | crates/rspack_plugin_library/src/jsonp_library_plugin.rs:149-156 | crates/rspack_plugin_library/src/system_library_plugin.rs:218-225 | crates/rspack_plugin_library/src/umd_library_plugin.rs:362-369 | crates/rspack_plugin_runtime/src/array_push_callback_chunk_format.rs:231-238 — before extracting anything, compare `crates/rspack_plugin_library/src/amd_library_plugin.rs` and `crates/rspack_plugin_library/src/jsonp_library_plugin.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 5) crates/rspack_plugin_runtime/src/bundler_info.rs:96— crates/rspack_plugin_runtime/src/bundler_info.rs:96-106 | crates/rspack_plugin_runtime/src/common_js_chunk_loading.rs:178-188 | crates/rspack_plugin_runtime/src/import_scripts_chunk_loading.rs:116-126 | crates/rspack_plugin_runtime/src/jsonp_chunk_loading.rs:116-126 | crates/rspack_plugin_runtime/src/module_chunk_loading.rs:162-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (6 lines × 5) crates/rspack_binding_api/src/async_dependency_block.rs:132— crates/rspack_binding_api/src/async_dependency_block.rs:132-137 | crates/rspack_binding_api/src/chunk.rs:349-354 | crates/rspack_binding_api/src/chunk_group.rs:211-216 | crates/rspack_binding_api/src/dependency.rs:201-206 | crates/rspack_binding_api/src/module_graph_connection.rs:212-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `compilation_id` to `rspack_core::CompilationId` in one and `CompilationId` 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/rspack_ids/src/compact_hashed_module_ids_plugin.rs:58— crates/rspack_ids/src/compact_hashed_module_ids_plugin.rs:58-66 | crates/rspack_ids/src/deterministic_module_ids_plugin.rs:72-80 | crates/rspack_ids/src/hashed_module_ids_plugin.rs:63-71 | crates/rspack_ids/src/natural_module_ids_plugin.rs:25-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rspack_ids/src/compact_hashed_module_ids_plugin.rs:58` 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.
Duplication concentrated across 9 sibling directories (5 clone groups) packages/rspack/src/browser/service.ts:1— 5 duplicated blocks under packages/rspack/src/ have copies in at least two of the sibling directories browser, builtin-plugin, config, loader-runner, logging, stats (+3 more sibling(s) not listed) — 3 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (65 matched lines × 2 locations) · ×1
Duplicated block with local edits (65 matched lines × 2 locations) packages/rspack/src/stats/StatsFactory.ts:209— packages/rspack/src/stats/StatsFactory.ts:209 · packages/rspack/src/stats/StatsPrinter.ts:152 — the two spans are one implementation copied and then locally edited — 361 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (52 lines × 2 locations) packages/rspack/src/Compilation.ts:947— packages/rspack/src/Compilation.ts:947 · packages/rspack/src/Compiler.ts:476 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (51 lines × 2 locations) packages/rspack/src/loader-runner/index.ts:458— packages/rspack/src/loader-runner/index.ts:458 · packages/rspack/src/loader-runner/worker.ts:400 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (38 lines × 2 locations) packages/rspack/src/util/fs.ts:383— packages/rspack/src/util/fs.ts:383 · packages/rspack/src/util/fs.ts:424 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication· Duplicated block with local edits (33 matched lines × 2 locations) · ×1
Duplicated block with local edits (33 matched lines × 2 locations) packages/rspack/hot/lazy-compilation-node.js:35— packages/rspack/hot/lazy-compilation-node.js:35 · packages/rspack/hot/lazy-compilation-web.js:32 — the two spans are one implementation copied and then locally edited — 166 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (33 lines × 2 locations) packages/rspack/src/Module.ts:51— packages/rspack/src/Module.ts:51 · packages/rspack/src/Module.ts:120 — 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 (30 lines × 2 locations) packages/rspack-cli/src/commands/preview.ts:47— packages/rspack-cli/src/commands/preview.ts:47 · packages/rspack-cli/src/commands/serve.ts:61 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (28 lines × 2 locations) packages/rspack/src/Stats.ts:87— packages/rspack/src/Stats.ts:87 · packages/rspack/src/Stats.ts:134 — 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 (25 lines × 2 locations) packages/create-rspack/template-react-js/src/App.jsx:5— packages/create-rspack/template-react-js/src/App.jsx:5 · packages/create-rspack/template-react-ts/src/App.tsx:5 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (24 lines × 2 locations) packages/rspack/src/config/defaults.ts:948— packages/rspack/src/config/defaults.ts:948 · packages/rspack/src/config/defaults.ts:975 — 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 (21 matched lines × 2 locations) · ×1
Duplicated block with local edits (21 matched lines × 2 locations) packages/rspack/src/logging/createConsoleLogger.ts:41— packages/rspack/src/logging/createConsoleLogger.ts:41 · packages/rspack/src/stats/DefaultStatsPresetPlugin.ts:260 — the two spans are one implementation copied and then locally edited — 95 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (20 matched lines × 2 locations) · ×1
Duplicated block with local edits (20 matched lines × 2 locations) packages/rspack/src/Compiler.ts:586— packages/rspack/src/Compiler.ts:586 · packages/rspack/src/Watching.ts:341 — the two spans are one implementation copied and then locally edited — 117 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (20 lines × 2 locations) packages/rspack/src/taps/normalModuleFactory.ts:13— packages/rspack/src/taps/normalModuleFactory.ts:13 · packages/rspack/src/taps/normalModuleFactory.ts: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 (18 lines × 2 locations) packages/rspack/src/loader-runner/index.ts:992— packages/rspack/src/loader-runner/index.ts:992 · packages/rspack/src/loader-runner/index.ts:1011 — 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 (17 lines × 2 locations) packages/rspack/src/config/target.ts:260— packages/rspack/src/config/target.ts:260 · packages/rspack/src/config/target.ts:337 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) packages/rspack/src/sharing/IndependentSharedPlugin.ts:170— packages/rspack/src/sharing/IndependentSharedPlugin.ts:170 · packages/rspack/src/sharing/SharePlugin.ts:73 — the two spans are one implementation copied and then locally edited — 66 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Complex function getGraphemeBreakProperty (cyclomatic 2120, cognitive 1507) tests/rspack-test/normalCases/parsing/evaluate-binary/deep.js:267— getGraphemeBreakProperty has cyclomatic complexity 2120 and cognitive complexity 1507; 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 process (cyclomatic 90, cognitive 101) · ×1
Complex function process (cyclomatic 90, cognitive 101) packages/rspack/src/rspackOptionsApply.ts:88— process has cyclomatic complexity 90 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _createToolbarTable (cyclomatic 82, cognitive 142) tests/rspack-test/configCases/inner-graph/issue-11678/module.js:436— _createToolbarTable has cyclomatic complexity 82 and cognitive complexity 142; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 51, cognitive 69) packages/rspack/src/logging/createConsoleLogger.ts:85— (anonymous) has cyclomatic complexity 51 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _ (cyclomatic 45, cognitive 104) packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:673— _ has cyclomatic complexity 45 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function build (cyclomatic 43, cognitive 53) tests/rspack-test/compilerCases/hmr-in-flight-chunks/test.config.mjs:93— build has cyclomatic complexity 43 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function shouldBreak (cyclomatic 43, cognitive 42) tests/rspack-test/normalCases/parsing/evaluate-binary/deep.js:80— shouldBreak has cyclomatic complexity 43 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runLoaders (cyclomatic 39, cognitive 70) packages/rspack/src/loader-runner/index.ts:248— runLoaders has cyclomatic complexity 39 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 39, cognitive 50) crates/node_binding/scripts/build.mjs:39— (anonymous) has cyclomatic complexity 39 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _showFormButtons (cyclomatic 39, cognitive 49) tests/rspack-test/configCases/inner-graph/issue-11678/module.js:2703— _showFormButtons has cyclomatic complexity 39 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function build (cyclomatic 37, cognitive 98) tests/rspack-test/compilerCases/hmr-removed-runtime-cache/test.config.mjs:45— build has cyclomatic complexity 37 and cognitive complexity 98; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 37, cognitive 42) packages/rspack-cli/src/commands/serve.ts:58— (anonymous) has cyclomatic complexity 37 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 36, cognitive 35) tests/rspack-test/configCases/chunks/available-modules/rspack.config.ts:25— (anonymous) has cyclomatic complexity 36 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 34, cognitive 76) packages/rspack/src/util/smartGrouping.ts:73— (anonymous) has cyclomatic complexity 34 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function compilation.summary! (cyclomatic 34, cognitive 29) packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:80— compilation.summary! has cyclomatic complexity 34 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 30, cognitive 29) packages/rspack/src/config/adapter.ts:357— (anonymous) has cyclomatic complexity 30 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function checkSourceMap (cyclomatic 28, cognitive 54) packages/rspack-test-tools/src/helper/util/checkSourceMap.js:6— checkSourceMap has cyclomatic complexity 28 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toMatchFileSnapshotSync (cyclomatic 28, cognitive 35) packages/rspack-test-tools/src/helper/expect/to-match-file-snapshot.ts:80— toMatchFileSnapshotSync has cyclomatic complexity 28 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function build (cyclomatic 25, cognitive 43) tests/rspack-test/compilerCases/hmr-stale-module-cache/test.config.mjs:47— build has cyclomatic complexity 25 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 24, cognitive 64) packages/rspack/src/config/target.ts:515— (anonymous) has cyclomatic complexity 24 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function checkArrayExpectation (cyclomatic 23, cognitive 61) packages/rspack-test-tools/src/helper/legacy/checkArrayExpectation.js:78— checkArrayExpectation has cyclomatic complexity 23 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 23, cognitive 40) tests/rspack-test/configCases/hooks/original-source/rspack.config.ts:46— (anonymous) has cyclomatic complexity 23 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 23, cognitive 38) packages/rspack/src/builtin-plugin/html-plugin/plugin.ts:37— (anonymous) has cyclomatic complexity 23 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function internalBuildConfig (cyclomatic 23, cognitive 27) packages/rspack-cli/src/cli.ts:212— internalBuildConfig has cyclomatic complexity 23 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 22, cognitive 54) packages/rspack/src/stats/statsFactoryUtils.ts:470— (anonymous) has cyclomatic complexity 22 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function rename (cyclomatic 22, cognitive 22) tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:6590— rename has cyclomatic complexity 22 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· packages/rspack/src/config/types.ts · ×1
packages/rspack/src/config/types.ts: 3093 lines of code packages/rspack/src/config/types.ts:1— packages/rspack/src/config/types.ts has 3093 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/rspack/src/stats/DefaultStatsFactoryPlugin.ts · ×1
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts: 1539 lines of code packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:1— packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts has 1539 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· crates/node_binding/rspack.wasi-browser.js · ×1
crates/node_binding/rspack.wasi-browser.js: 1494 lines of code crates/node_binding/rspack.wasi-browser.js:1— crates/node_binding/rspack.wasi-browser.js has 1494 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/rspack/src/config/defaults.ts · ×1
packages/rspack/src/config/defaults.ts: 1346 lines of code packages/rspack/src/config/defaults.ts:1— packages/rspack/src/config/defaults.ts has 1346 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/rspack/src/stats/DefaultStatsPrinterPlugin.ts · ×1
packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts: 1319 lines of code packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts:1— packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts has 1319 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/rspack/src/Compilation.ts · ×1
packages/rspack/src/Compilation.ts: 1267 lines of code packages/rspack/src/Compilation.ts:1— packages/rspack/src/Compilation.ts has 1267 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/rspack/src/loader-runner/index.ts · ×1
packages/rspack/src/loader-runner/index.ts: 1180 lines of code packages/rspack/src/loader-runner/index.ts:1— packages/rspack/src/loader-runner/index.ts has 1180 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/rspack/src/Compiler.ts · ×1
packages/rspack/src/Compiler.ts: 1114 lines of code packages/rspack/src/Compiler.ts:1— packages/rspack/src/Compiler.ts has 1114 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/rspack/src/config/adapter.ts · ×1
packages/rspack/src/config/adapter.ts: 922 lines of code packages/rspack/src/config/adapter.ts:1— packages/rspack/src/config/adapter.ts has 922 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/rspack/src/util/fs.ts · ×1
packages/rspack/src/util/fs.ts: 721 lines of code packages/rspack/src/util/fs.ts:1— packages/rspack/src/util/fs.ts has 721 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/rspack/src/loader-runner/worker.ts · ×1
packages/rspack/src/loader-runner/worker.ts: 711 lines of code packages/rspack/src/loader-runner/worker.ts:1— packages/rspack/src/loader-runner/worker.ts has 711 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/rspack/src/config/normalization.ts · ×1
packages/rspack/src/config/normalization.ts: 700 lines of code packages/rspack/src/config/normalization.ts:1— packages/rspack/src/config/normalization.ts has 700 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/rspack/src/stats/statsFactoryUtils.ts · ×1
packages/rspack/src/stats/statsFactoryUtils.ts: 675 lines of code packages/rspack/src/stats/statsFactoryUtils.ts:1— packages/rspack/src/stats/statsFactoryUtils.ts has 675 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/rspack/src/RuntimeGlobals.ts · ×1
packages/rspack/src/RuntimeGlobals.ts: 649 lines of code packages/rspack/src/RuntimeGlobals.ts:1— packages/rspack/src/RuntimeGlobals.ts has 649 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/rspack/src/config/adapterRuleUse.ts · ×1
packages/rspack/src/config/adapterRuleUse.ts: 622 lines of code packages/rspack/src/config/adapterRuleUse.ts:1— packages/rspack/src/config/adapterRuleUse.ts has 622 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/rspack-test-tools/src/runner/node/index.ts · ×1
packages/rspack-test-tools/src/runner/node/index.ts: 570 lines of code packages/rspack-test-tools/src/runner/node/index.ts:1— packages/rspack-test-tools/src/runner/node/index.ts has 570 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/rspack/src/MultiCompiler.ts · ×1
packages/rspack/src/MultiCompiler.ts: 569 lines of code packages/rspack/src/MultiCompiler.ts:1— packages/rspack/src/MultiCompiler.ts has 569 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/rspack/src/config/target.ts · ×1
packages/rspack/src/config/target.ts: 547 lines of code packages/rspack/src/config/target.ts:1— packages/rspack/src/config/target.ts has 547 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/rspack/src/taps/compilation.ts · ×1
packages/rspack/src/taps/compilation.ts: 499 lines of code packages/rspack/src/taps/compilation.ts:1— packages/rspack/src/taps/compilation.ts has 499 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/rspack/src/NativeWatchFileSystem.ts · ×1
packages/rspack/src/NativeWatchFileSystem.ts: 498 lines of code packages/rspack/src/NativeWatchFileSystem.ts:1— packages/rspack/src/NativeWatchFileSystem.ts has 498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/rspack/src/Watching.ts · ×1
packages/rspack/src/Watching.ts: 495 lines of code packages/rspack/src/Watching.ts:1— packages/rspack/src/Watching.ts has 495 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/rspack-test-tools/src/case/watch.ts · ×1
packages/rspack-test-tools/src/case/watch.ts: 485 lines of code packages/rspack-test-tools/src/case/watch.ts:1— packages/rspack-test-tools/src/case/watch.ts has 485 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/rspack/src/util/cleverMerge.ts · ×1
packages/rspack/src/util/cleverMerge.ts: 480 lines of code packages/rspack/src/util/cleverMerge.ts:1— packages/rspack/src/util/cleverMerge.ts has 480 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/rspack-test-tools/src/case/cache.ts · ×1
packages/rspack-test-tools/src/case/cache.ts: 472 lines of code packages/rspack-test-tools/src/case/cache.ts:1— packages/rspack-test-tools/src/case/cache.ts has 472 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/rspack/src/exports.ts · ×1
packages/rspack/src/exports.ts: 453 lines of code packages/rspack/src/exports.ts:1— packages/rspack/src/exports.ts has 453 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/rspack/src/sharing/IndependentSharedPlugin.ts · ×1
packages/rspack/src/sharing/IndependentSharedPlugin.ts: 452 lines of code packages/rspack/src/sharing/IndependentSharedPlugin.ts:1— packages/rspack/src/sharing/IndependentSharedPlugin.ts has 452 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/rspack/src/rspackOptionsApply.ts · ×1
packages/rspack/src/rspackOptionsApply.ts: 450 lines of code packages/rspack/src/rspackOptionsApply.ts:1— packages/rspack/src/rspackOptionsApply.ts has 450 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/rspack-test-tools/src/runner/web/index.ts · ×1
packages/rspack-test-tools/src/runner/web/index.ts: 436 lines of code packages/rspack-test-tools/src/runner/web/index.ts:1— packages/rspack-test-tools/src/runner/web/index.ts has 436 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/rspack/src/loader-runner/service.ts · ×1
packages/rspack/src/loader-runner/service.ts: 420 lines of code packages/rspack/src/loader-runner/service.ts:1— packages/rspack/src/loader-runner/service.ts has 420 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/rspack-test-tools/src/case/hot-step.ts · ×1
packages/rspack-test-tools/src/case/hot-step.ts: 418 lines of code packages/rspack-test-tools/src/case/hot-step.ts:1— packages/rspack-test-tools/src/case/hot-step.ts has 418 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/rspack/src/container/ModuleFederationPlugin.ts · ×1
packages/rspack/src/container/ModuleFederationPlugin.ts: 417 lines of code packages/rspack/src/container/ModuleFederationPlugin.ts:1— packages/rspack/src/container/ModuleFederationPlugin.ts has 417 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/rspack/src/stats/StatsFactory.ts · ×1
packages/rspack/src/stats/StatsFactory.ts: 401 lines of code packages/rspack/src/stats/StatsFactory.ts:1— packages/rspack/src/stats/StatsFactory.ts has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Benchmark script nothing runs (~97 LoC) website/theme/components/Landingpage/Benchmark/index.tsx— This script imports the product ('../../../i18n'), so it is an authored benchmark, not measurement input — but nothing invokes it: no package.json script, no CI workflow or build recipe, no REDACTED, no other file under website/theme/components/Landingpage/Benchmark/, and no in-repo reference to its name at all. It runs only if someone remembers to type `node website/theme/components/Landingpage/Benchmark/index.tsx`, and it silently rots against the API it measures. Wire it into a script or workflow the way its wired siblings are, or delete it.
Weak hash algorithm crates/rspack_hash/src/lib.rs:215— 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: defaultHttpClientForBrowser packages/rspack/src/builtin-plugin/HttpUriPlugin.ts:142— `defaultHttpClientForBrowser` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Orphaned file crates/rspack/src/builder/devtool.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/rspack_storage/src/filesystem/db/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/rspack_storage/src/filesystem/db/bucket/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/rspack_plugin_size_limits/src/lib.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/rspack_core/src/compilation/build_module_graph/module_executor/module_tracker.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/rspack_storage/src/filesystem/db/transaction/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/rspack_storage/src/filesystem/scope_fs.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/rspack_cacheable/src/with/as_map.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/rspack_cacheable/src/utils/portable_string.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/rspack_cacheable_macros/src/cacheable_dyn/impl_trait.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/rspack_cacheable/src/dyn/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/rspack_storage/src/filesystem/db/transaction/lock/state.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/rspack_storage/src/filesystem/db/bucket/pack/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/rspack_storage/src/filesystem/db/bucket/meta.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/rspack_cacheable/src/with/as_vec.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/rspack_cacheable/src/with/as_inner.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/rspack_binding_api/src/raw_options/raw_builtins/raw_dll.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/rspack_binding_api/src/virtual_modules/trie_store.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/rspack_napi/src/callback.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/rspack_plugin_dll/src/dll_reference/delegated_plugin.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/rspack_binding_api/src/virtual_modules/fs.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/rspack_plugin_mf/src/manifest/data.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/rspack_napi_macros/src/tagged_union.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/rspack_ids/src/hashed_module_ids_plugin.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 packages/rspack/src/sharing/SharedContainerPlugin.ts: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.
Duplicated predicate packages/rspack/src/loader-runner/index.ts:1086— `(await runSyncOrAsync(fn, loaderContext, args)) || []` appears character-identically in 2 files — packages/rspack/src/loader-runner/index.ts, packages/rspack/src/loader-runner/worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack-cli/src/commands/preview.ts:74— `(error as Error)?.message || String(error)` appears character-identically in 2 files — packages/rspack-cli/src/commands/preview.ts, packages/rspack-cli/src/commands/serve.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack-cli/src/utils/loadConfig.ts:48— `Boolean(value) && typeof value === 'object' && !Array.isArray(value)` appears character-identically in 2 files — packages/rspack-cli/src/utils/loadConfig.ts, packages/rspack/src/container/ModuleFederationManifestPlugin.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 website/components/CommunityCompatibleTable.tsx:398— `b.status - a.status || a.name.localeCompare(b.name)` appears character-identically in 2 files — website/components/CommunityCompatibleTable.tsx, website/components/PluginSupportStatusTable.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/loader-runner/index.ts:503— `entry.options && typeof entry.options === 'object'` appears character-identically in 2 files — packages/rspack/src/loader-runner/index.ts, packages/rspack/src/loader-runner/worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/builtin-plugin/css-extract/index.ts:97— `hasChunkHash || hasContentHash || hasName || hasId` appears character-identically in 2 files — packages/rspack/src/builtin-plugin/css-extract/index.ts, packages/rspack/src/config/defaults.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/container/ModuleFederationManifestPlugin.ts:249— `item === key || !isRequiredVersion(item)` appears character-identically in 5 files — packages/rspack/src/container/ModuleFederationManifestPlugin.ts, packages/rspack/src/container/ModuleFederationPlugin.ts, packages/rspack/src/sharing/ConsumeSharedPlugin.ts, packages/rspack/src/sharing/IndependentSharedPlugin.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/container/ContainerReferencePlugin.ts:58— `item.shareScope || options.shareScope || 'default'` appears character-identically in 2 files — packages/rspack/src/container/ContainerReferencePlugin.ts, packages/rspack/src/container/ModuleFederationPlugin.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/sharing/ConsumeSharedPlugin.ts:76— `item.shareScope || shareScope || 'default'` appears character-identically in 2 files — packages/rspack/src/sharing/ConsumeSharedPlugin.ts, packages/rspack/src/sharing/ProvideSharedPlugin.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/loader-runner/index.ts:471— `loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource` appears character-identically in 2 files — packages/rspack/src/loader-runner/index.ts, packages/rspack/src/loader-runner/worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/loader-runner/index.ts:238— `loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index]` appears character-identically in 2 files — packages/rspack/src/loader-runner/index.ts, packages/rspack/src/loader-runner/worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/loader-runner/index.ts:713— `options === null || options === undefined` appears character-identically in 2 files — packages/rspack/src/loader-runner/index.ts, packages/rspack/src/loader-runner/worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/loader-runner/index.ts:700— `options.startsWith('{') && options.endsWith('}')` appears character-identically in 2 files — packages/rspack/src/loader-runner/index.ts, packages/rspack/src/loader-runner/worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/NativeWatchFileSystem.ts:207— `typeof callbackUndelayed !== 'function' && callbackUndelayed` appears character-identically in 2 files — packages/rspack/src/NativeWatchFileSystem.ts, packages/rspack/src/node/NodeWatchFileSystem.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:248— `url.protocol === 'http:' || url.protocol === 'https:'` appears character-identically in 2 files — packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts, packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/rspack/src/Compilation.ts:505— `value === undefined && typeof prop === 'string'` appears character-identically in 2 files — packages/rspack/src/Compilation.ts, packages/rspack/src/Compiler.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 crates/rspack_plugin_javascript/src/dependency/context/import_context_dependency.rs:61— `!from_magic_comment && referenced_specifiers.is_empty()` appears character-identically in 4 files — crates/rspack_plugin_javascript/src/dependency/context/import_context_dependency.rs, crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs, crates/rspack_plugin_javascript/src/dependency/esm/import_eager_dependency.rs, crates/rspack_plugin_javascript/src/dependency/esm/import_weak_dependency.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/rspack_plugin_lightning_css_minimizer/src/lib.rs:113— `!is_matched || original.get_info().minimized.unwrap_or(false)` appears character-identically in 2 files — crates/rspack_plugin_lightning_css_minimizer/src/lib.rs, crates/rspack_plugin_swc_js_minimizer/src/lib.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/rspack_plugin_rslib/src/url_external.rs:27— `!request.starts_with("./") && !request.starts_with("../")` appears character-identically in 2 files — crates/rspack_plugin_rslib/src/url_external.rs, crates/rspack_plugin_rslib/src/worker_external.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/rspack_plugin_javascript/src/plugin/mod.rs:445— `allow_inline_startup && !chunk_ids.is_empty()` appears character-identically in 2 files — crates/rspack_plugin_javascript/src/plugin/mod.rs, crates/rspack_plugin_javascript/src/plugin/runtime_context.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/rspack_plugin_javascript/src/plugin/mod.rs:779— `allow_inline_startup && !js_entry_modules.is_empty()` appears character-identically in 2 files — crates/rspack_plugin_javascript/src/plugin/mod.rs, crates/rspack_plugin_javascript/src/plugin/runtime_context.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/rspack_plugin_javascript/src/plugin/mod.rs:301— `allow_inline_startup && intercept_module_execution` appears character-identically in 2 files — crates/rspack_plugin_javascript/src/plugin/mod.rs, crates/rspack_plugin_javascript/src/plugin/runtime_context.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/rspack_plugin_javascript/src/plugin/mod.rs:293— `allow_inline_startup && module_factories` appears character-identically in 2 files — crates/rspack_plugin_javascript/src/plugin/mod.rs, crates/rspack_plugin_javascript/src/plugin/runtime_context.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/rspack_plugin_esm_library/src/link.rs:1594— `dep.downcast_ref::<ESMExportImportedSpecifierDependency>() && dep.name.is_none()` appears character-identically in 2 files — crates/rspack_plugin_esm_library/src/link.rs, crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.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/rspack_plugin_javascript/src/plugin/mod.rs:612— `entry_runtime_requirements && entry_runtime_requirements.contains(RuntimeGlobals::EXPORTS)` appears character-identically in 2 files — crates/rspack_plugin_javascript/src/plugin/mod.rs, crates/rspack_plugin_javascript/src/plugin/runtime_context.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.
Interpolated log message defeats structured logging crates/rspack_watcher/src/disk_watcher.rs:40— `error!` at line 40 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: `error!(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/rspack_watcher/src/disk_watcher.rs:83— `warn!` at line 83 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: `warn!(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/rspack_watcher/src/ignored.rs:181— `error!` at line 181 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: `error!(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/rspack_resolver/src/lib.rs:1087— `debug!` at line 1087 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/rspack_resolver/src/lib.rs:1122— `debug!` at line 1122 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:294— `trace!` at line 294 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:523— `trace!` at line 523 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:535— `debug!` at line 535 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:561— `debug!` at line 561 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/rspack_plugin_split_chunks/src/plugin/max_size.rs:573— `warn!` at line 573 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: `warn!(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/rspack_plugin_split_chunks/src/plugin/max_size.rs:631— `debug!` at line 631 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/rspack_plugin_split_chunks/src/plugin/min_size.rs:74— `trace!` at line 74 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/rspack_plugin_split_chunks/src/plugin/min_size.rs:247— `debug!` at line 247 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/rspack_plugin_split_chunks/src/plugin/min_size.rs:289— `debug!` at line 289 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/rspack_plugin_split_chunks/src/plugin/mod.rs:59— `debug!` at line 59 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/rspack_plugin_split_chunks/src/plugin/mod.rs:83— `debug!` at line 83 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/rspack_plugin_split_chunks/src/plugin/mod.rs:304— `trace!` at line 304 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/rspack_plugin_split_chunks/src/plugin/mod.rs:314— `trace!` at line 314 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/rspack_plugin_split_chunks/src/plugin/mod.rs:330— `trace!` at line 330 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/rspack_plugin_split_chunks/src/plugin/mod.rs:450— `trace!` at line 450 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/rspack_plugin_split_chunks/src/plugin/mod.rs:494— `trace!` at line 494 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/rspack_plugin_split_chunks/src/plugin/mod.rs:518— `trace!` at line 518 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1456— `trace!` at line 1456 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1462— `trace!` at line 1462 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/rspack_plugin_split_chunks/src/plugin/module_group.rs:1463— `trace!` at line 1463 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.
P2 · Observability· Console output used as the logging channel · ×28
Console output used as the logging channel packages/rspack/src/NativeWatchFileSystem.ts:325— `packages/rspack/src/NativeWatchFileSystem.ts` reports through `console.*` at line 325 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/checkNodeVersion.ts:15— `packages/rspack/src/checkNodeVersion.ts` reports through `console.*` at line 15 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/util/asyncLib.ts:66— `packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 66 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/util/asyncLib.ts:67— `packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 67 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/util/asyncLib.ts:82— `packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 82 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/util/asyncLib.ts:83— `packages/rspack/src/util/asyncLib.ts` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/sharing/IndependentSharedPlugin.ts:73— `packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 73 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/sharing/IndependentSharedPlugin.ts:106— `packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 106 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/sharing/IndependentSharedPlugin.ts:322— `packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 322 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/sharing/IndependentSharedPlugin.ts:349— `packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 349 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/sharing/IndependentSharedPlugin.ts:478— `packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 478 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/sharing/IndependentSharedPlugin.ts:490— `packages/rspack/src/sharing/IndependentSharedPlugin.ts` reports through `console.*` at line 490 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:101— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 101 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:103— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:109— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 109 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:113— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:117— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:121— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 121 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:133— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 133 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:144— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 144 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:161— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 161 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/logging/createConsoleLogger.ts:192— `packages/rspack/src/logging/createConsoleLogger.ts` reports through `console.*` at line 192 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/loader-runner/utils.ts:116— `packages/rspack/src/loader-runner/utils.ts` reports through `console.*` at line 116 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/src/loader-runner/utils.ts:117— `packages/rspack/src/loader-runner/utils.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/rspack/hot/lazy-compilation-node.js:99— `packages/rspack/hot/lazy-compilation-node.js` reports through `console.*` at line 99 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
redundant comment packages/rspack-cli/src/commands/preview.ts:86— "find the possible devServer config" repeats the code it sits on: 4 of its 5 words (find, dev, server, config) are already in `const singleConfig =`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack-cli/src/utils/loadConfig.ts:245— "Set config paths" repeats the code it sits on: 3 of its 3 words (set, config, paths) are already in `pathMap.set(resultConfig, configPaths);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack-cli/src/utils/options.ts:70— "normalize options.env" repeats the code it sits on: 3 of its 3 words (normalize, options, env) are already in `const env = Array.isArray(options.env) ? normalizeEnvToObject(options) : {};`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack/hot/lazy-compilation-web.js:28— "text/plain Content-Type is simple request header" repeats the code it sits on: 6 of its 7 words (text, plain, content, type, request, header) are already in `xhr.setRequestHeader('Content-Type', 'text/plain');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts:366— "Handle script tags with src attribute" repeats the code it sits on: 4 of its 5 words (script, tags, src, attribute) are already in `if (tag.tagName === 'script' && typeof tag.attributes.src === 'string')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack/src/trace/index.ts:162— "start an chrome async event" repeats the code it sits on: 4 of its 4 words (start, chrome, async, event) are already in `static startAsync(events: PartialChromeEvent)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack/src/util/cleverMerge.ts:341— "= first.base + second.byProperty" repeats the code it sits on: 4 of its 4 words (first, base, second, property) are already in `return {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/rspack/src/util/fs.ts:29— "get info about files" repeats the code it sits on: 3 of its 3 words (get, info, files) are already in `getFileTimeInfoEntries?(): TimeInfoEntries;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment tests/e2e/cases/hooks/asset-emitted/index.test.ts:13— "update js file" repeats the code it sits on: 3 of its 3 words (update, js, file) are already in `fileAction.updateFile('src/index.js', (content) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment tests/e2e/cases/hooks/asset-emitted/index.test.ts:56— "update js file" repeats the code it sits on: 3 of its 3 words (update, js, file) are already in `fileAction.updateFile('src/index.js', () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment tests/rspack-test/exampleCases/harmony-interop/example2.js:3— "require a harmony module" repeats the code it sits on: 3 of its 3 words (require, harmony, module) are already in `var module = require("./harmony");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment tests/rspack-test/exampleCases/module-worker/example.js:23— "CHAT with shared worker ///" repeats the code it sits on: 3 of its 3 words (chat, shared, worker) are already in `const chatWorker = new SharedWorker(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment tests/rspack-test/exampleCases/worker/example.js:23— "CHAT with shared worker ///" repeats the code it sits on: 3 of its 3 words (chat, shared, worker) are already in `const chatWorker = new SharedWorker(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment tests/rspack-test/normalCases/parsing/evaluate-binary/deep2.js:800— 34 comments in this file only repeat the code they sit on (lines 800, 804, 814, 841, 859, 871, 1037, 1043, 1050, 1295, 1303, 1365, 1466, 1483, 1496, 1500, 1591, 1682, 1778, 1784, 1787, 1790, 1793, 1796, 1799, 1803, 1934, 1944, 1947, 1961, 2024, 2090, 2111, 2223), for example "Base group name". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 12 significant file(s) lose their only recent owner: crates/rspack_allocative/src/flamegraph.rs, crates/rspack_allocative_derive/src/derive_allocative.rs, crates/rspack_allocative_driver/src/lib.rs, crates/rspack_allocative/src/impls/std/sync.rs, crates/rspack_allocative/src/impls/std/unsorted.rs, crates/rspack_macros/src/string_enum.rs, crates/css-module-lexer/src/css_syntax.rs, crates/rspack_allocative_driver/src/main.rs (+4 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 10 significant file(s) lose their only recent owner: crates/rspack_binding_api/src/file_system_dependency_strings.rs, crates/rspack_plugin_rsc/src/reference_manifest.rs, crates/rspack_binding_api/src/compiler_scoped_tsfn.rs, crates/rspack_binding_api/src/plugins/rsc.rs, crates/rspack_plugin_rsc/src/coordinator.rs, crates/rspack_binding_api/src/js_helpers.rs, crates/rspack_plugin_rsc/src/plugin_state.rs, packages/rspack/src/builtin-plugin/rsc/Coordinator.ts (+2 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 8 significant file(s) lose their only recent owner: crates/rspack_plugin_javascript/src/runtime_context.rs, crates/rspack_plugin_javascript/src/visitors/scope_info/semantic.rs, crates/rspack_plugin_javascript/src/parser_plugin/side_effects_analysis.rs, crates/rspack_resolver/src/package_json/simd.rs, crates/rspack_paths/src/path_list.rs, crates/rspack_core/src/exports/export_info_setter.rs, crates/rspack_core/src/exports/exports_info_setter.rs, crates/rspack_plugin_sri/src/integrity.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/rspack_core/src/module_graph/rollback/overlay_map.rs, crates/rspack_core/src/compilation/pass.rs, crates/rspack_core/src/compilation/run_passes.rs, crates/rspack_core/src/module_graph/internal.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: crates/rspack_storage/src/filesystem/db/bucket/mod.rs, crates/rspack_cacheable/src/with/custom.rs, crates/rspack_parallel/src/iterator_consumer/try_future.rs. Pair on, review, or document these before any departure.
Documentation: no build, run or usage example README.md:1— the repository holds project manifests and neither `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 crates/node_binding/README.md:1— `node_binding` is a published package (`package.json` without `"private": true`) and neither `crates/node_binding/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/rspack/README.md:1— `rspack` is a published package (`package.json` without `"private": true`) and neither `packages/rspack/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/rspack-browser/README.md:1— `rspack-browser` is a published package (`package.json` without `"private": true`) and neither `packages/rspack-browser/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/rspack-test-tools/README.md:1— `rspack-test-tools` is a published package (`package.json` without `"private": true`) and neither `packages/rspack-test-tools/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.
R7 · Dead Code· Unused module-local declaration 'fileURLToPath' · ×3
Unused module-local declaration 'fileURLToPath' tests/rspack-test/configCases/module/node-globals/cjs/file.js:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'fileURLToPath' tests/rspack-test/configCases/output-module/node-globals/cjs/file.js:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'fileURLToPath' tests/rspack-test/configCases/output-module/node-shims-in-concatenated-module/file.js:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Silent fallback default in catch tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:4243— `patchFs` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tests/rspack-test/configCases/rstest/mock/globals-false/importActual.js:15— `getGlobalActual` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tests/rspack-test/diagnosticsCases/config/pnp-disable/.pnp.cjs:4243— `patchFs` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
R7 · Dead Code· Unused module-local declaration 'test' · ×2
Unused module-local declaration 'test' tests/rspack-test/builtinCases/samples/concatenate-modules/index.js:8— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'test' tests/rspack-test/configCases/plugins/minify-disabled-on-empty-array/index.js:6— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'component' · ×2
Unused module-local declaration 'component' tests/rspack-test/configCases/builtin-swc-loader/preact-refresh/index.jsx:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'component' tests/rspack-test/configCases/builtin-swc-loader/react-refresh/index.jsx:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'App' · ×2
Unused module-local declaration 'App' tests/rspack-test/configCases/builtin-swc-loader/react-compiler-panic-threshold/index.jsx:3— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'App' tests/rspack-test/configCases/builtin-swc-loader/react-compiler-paren-target/index.tsx:3— 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.
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 (44 single-owned of 863 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; 863 of the 1556 production source files in this repository met that bar). They are anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (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/rspack_plugin_circular_dependencies/src/circular_dependency_rspack_plugin.rs, crates/rspack_core/src/resolver/resolver_cache.rs, crates/rspack_resolver/src/tsconfig.rs, crates/rspack_resolver/src/context.rs, packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts, packages/rspack/src/builtin-plugin/EsmLibraryPlugin.ts, packages/create-rspack/src/index.ts.
No ADRs found packages/rspack-cli/package.json:22— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `packages/rspack-cli/package.json` makes this repository a deployable product (line 22).
D21 · Naming Consistency· `expectExternalMappingURL` spells `URL` where 20 names in the project spell it `Url` · ×1
`expectExternalMappingURL` spells `URL` where 20 names in the project spell it `Url` tests/rspack-test/configCases/css/source-map-export-types/index.js:194— 20 of 21 names in project monorepo spell the token `Url` (20 of 21; unit: names in project monorepo containing `Url`). Peers: index.sourceUrl (tests/rspack-test/configCases/builtin-swc-loader/input-source-map-cheap-module/index.js:11); index.sourceUrl (tests/rspack-test/configCases/builtin-swc-loader/input-source-map-module/index.js:11); module.setIdToUrl (tests/rspack-test/configCases/inner-graph/issue-11678/module.js:1765); .pnp.throwImportNotDefined(packageJSONUrl) (tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:9162); .pnp.throwInvalidSubpath(packageJSONUrl) (tests/rspack-test/configCases/resolve/pnp-enable/.pnp.cjs:9169). Rename to `expectExternalMappingUrl`. [rule N6]
D21 · Naming Consistency· `moduleURL` spells `URL` where 17 names in the project spell it `Url` · ×1
`moduleURL` spells `URL` where 17 names in the project spell it `Url` packages/rspack-test-tools/src/helper/node-case.ts:26— 17 of 18 names in project monorepo spell the token `Url` (17 of 18; unit: names in project monorepo containing `Url`). Peers: BrowserHttpImportPluginOptions.dependencyUrl (packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:24); BrowserHttpImportEsmPlugin.resolveWithUrlIssuer (packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:106); BrowserHttpImportEsmPlugin.parameterize(requestUrl) (packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:128); BrowserHttpImportEsmPlugin.toHttpUrl (packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:245); middleware.getFullServerUrl (packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts:31). Rename to `moduleUrl`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 4 of 111 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. The most over is `crates/rspack_core` (64149 LoC, 770 module-visible types across 67 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 53 of 863 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (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; 863 of the 1556 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: crates/rspack/src/builder/devtool.rs, crates/rspack_storage/src/filesystem/db/mod.rs, crates/rspack_storage/src/filesystem/db/bucket/mod.rs, crates/rspack_plugin_size_limits/src/lib.rs, crates/rspack_core/src/compilation/build_module_graph/module_executor/module_tracker.rs, crates/rspack_storage/src/filesystem/db/transaction/mod.rs, crates/rspack_storage/src/filesystem/scope_fs.rs, crates/rspack_cacheable/src/with/as_map.rs (and 45 more). 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.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 43/46 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/rspack_allocative_driver`, `packages/create-rspack`, `xtask`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code· Unused export 'BrowserHttpImportEsmPlugin' · ×1
Unused export 'BrowserHttpImportEsmPlugin' packages/rspack/src/browser/BrowserHttpImportEsmPlugin.ts:45— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/rspack/src/browser/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/rspack/src/browser/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'BrowserRequirePlugin' · ×1
Unused export 'BrowserRequirePlugin' packages/rspack/src/browser/BrowserRequirePlugin.ts:42— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/rspack/src/browser/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/rspack/src/browser/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused module-local declaration 'MyApp' · ×1
Unused module-local declaration 'MyApp' tests/rspack-test/configCases/builtin-swc-loader/react-compiler/index.jsx:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'setTimeout' · ×1
Unused module-local declaration 'setTimeout' tests/rspack-test/configCases/concatenate-modules/issue-13022/a.js:2— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'X' · ×1
Unused module-local declaration 'X' tests/rspack-test/configCases/concatenate-modules/rename-10168/C.js:3— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'Y' · ×1
Unused module-local declaration 'Y' tests/rspack-test/configCases/concatenate-modules/rename-10168/C.js:4— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'fileName_1' · ×1
Unused module-local declaration 'fileName_1' tests/rspack-test/configCases/inner-graph/issue-12669/module.js:2— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'cls2' · ×1
Unused module-local declaration 'cls2' tests/rspack-test/configCases/inner-graph/issue-17565/module.js:15— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'cls4' · ×1
Unused module-local declaration 'cls4' tests/rspack-test/configCases/inner-graph/issue-17565/module.js:26— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'cls6' · ×1
Unused module-local declaration 'cls6' tests/rspack-test/configCases/inner-graph/issue-17565/module.js:39— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'cls8' · ×1
Unused module-local declaration 'cls8' tests/rspack-test/configCases/inner-graph/issue-17565/module.js:52— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'i' · ×1
Unused module-local declaration 'i' tests/rspack-test/configCases/library/issue-18932/index.js:5— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration '__dirname' · ×1
Unused module-local declaration '__dirname' tests/rspack-test/configCases/node/filename-and-dirname/index.js:7— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration '__filename' · ×1
Unused module-local declaration '__filename' tests/rspack-test/configCases/node/filename-and-dirname/index.js:8— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'TOP_OF_FILE' · ×1
Unused module-local declaration 'TOP_OF_FILE' tests/rspack-test/configCases/rstest/mock/doMock.js:1— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
No security response headers detected website/docs/public/_headers:1— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `_headers` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 3/77 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) override strict null checking — ~6.7 `!` null assertions per 1k TypeScript source lines — 326 assertion(s) across the 48644 source line(s) of the 319 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/rspack/src/FileSystem.ts (38), packages/rspack/src/loader-runner/index.ts (37), packages/rspack/src/taps/compilation.ts (32). 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.
Outdated: inventory — `inventory` is locked at 0.3.17 but 0.3.25 is the current stable release on crates.io, and it already satisfies the `"0.3.17"` requirement declared in crates/rspack_cacheable/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p inventory` and commit the updated REDACTED.
Outdated: json-strip-comments — `json-strip-comments` is locked at 3.1.2 but 3.1.3 is the current stable release on crates.io, and it already satisfies the `"3.1.2"` requirement declared in crates/rspack_resolver/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p json-strip-comments` and commit the updated REDACTED.
Outdated: mimalloc — `mimalloc` is locked at 0.1.48 but 0.1.52 is the current stable release on crates.io, and it already satisfies the `"0.1.48"` requirement declared in crates/rspack_allocator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mimalloc` and commit the updated REDACTED.
Outdated: napi — `napi` is locked at 3.15.0 but 3.16.2 is the current stable release on crates.io, and it already satisfies the `"3.15.0"` requirement declared in crates/rspack_allocative/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-derive — `napi-derive` is locked at 3.6.13 but 3.7.1 is the current stable release on crates.io, and it already satisfies the `"3.6.13"` requirement declared in crates/node_binding/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: owo-colors — `owo-colors` is locked at 4.1.0 but 4.4.0 is the current stable release on crates.io, and it already satisfies the `"4.0.0"` requirement declared in crates/rspack_error/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p owo-colors` and commit the updated REDACTED.
Outdated: smallvec — `smallvec` is locked at 1.15.2 but 1.16.5 is the current stable release on crates.io, and it already satisfies the `"1.15.2"` requirement declared in crates/css-module-lexer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated REDACTED.
Outdated: swc_ecma_minifier — `swc_ecma_minifier` is locked at 64.0.5 but 64.0.6 is the current stable release on crates.io, and it already satisfies the `"64.0.5"` requirement declared in crates/rspack_allocative/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p swc_ecma_minifier` and commit the updated REDACTED.
Outdated: textwrap — `textwrap` is locked at 0.16.1 but 0.16.4 is the current stable release on crates.io, and it already satisfies the `"0.16.1"` requirement declared in crates/rspack_error/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p textwrap` and commit the updated REDACTED.
Outdated: unicase — `unicase` is locked at 2.9.0 but 2.10.0 is the current stable release on crates.io, and it already satisfies the `"2.9.0"` requirement declared in crates/rspack_util/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicase` and commit the updated REDACTED.
doc comments repeat the names packages/rspack-cli/src/utils/options.ts:120— 0 of 7 documented parameters and 0 of 9 summaries in `@rspack/cli` only repeat the member or parameter name (e.g. "" for `value`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/rspack/hot/lazy-compilation-node.js:82— 64 of 232 documented parameters and 16 of 926 summaries in `@rspack/core` only repeat the member or parameter name (e.g. "options" for `options`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/rspack-test-tools/src/helper/legacy/findOutputFiles.js:7— 2 of 10 documented parameters and 0 of 7 summaries in `@rspack/test-tools` only repeat the member or parameter name (e.g. "options" for `options`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names tests/rspack-test/configCases/optimization/runtime-specific-used-exports2/helper.js:3— 4 of 6 documented parameters and 0 of 16 summaries in `@rspack/tests` only repeat the member or parameter name (e.g. "arr" for `arr`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names packages/rspack-cli/tests/utils/test-utils.ts:199— 0 of 17 documented parameters and 1 of 6 summaries in `packages/rspack-cli/tests` only repeat the member or parameter name (e.g. "runPromptWithAnswers" for `runPromptWithAnswers`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 26 file(s) — `crates/node_binding/napi-binding.d.ts`, `crates/rspack_plugin_esm_library/src/link.rs`, `packages/create-rspack/template-react-ts/rspack.config.ts`, `packages/create-rspack/template-vanilla-ts/rspack.config.ts`, `packages/create-rspack/template-vue-ts/rspack.config.ts`, … (+21 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1daba-7c75-7c20-8307-44b16b489bb9 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 67 · Warnings: 2222 · Recommendations: 230 · Info: 15 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 15:43 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.