Repository Analysis

web-infra-dev/rspack

Fast Rust-based bundler for the web with a modernized webpack API 🦀

0.6 Likely human-written View on GitHub
0.6
Adjusted Score
0.6
Raw Score
100%
Time Factor
2026-05-30
Last Push
12,726
Stars
Rust
Language
779,694
Lines of Code
18086
Files
354
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 15MEDIUM 8LOW 330

Pattern Findings

354 matches across 9 categories. Click a row to expand file-level details.

Over-Commented Block246 hits · 246 pts
SeverityFileLineSnippet
LOWdeny.toml1# This template contains all of the possible sections and their default values
LOWdeny.toml21# `target_family = "unix"` configuration, that only having windows targets in
LOWdeny.toml41#exclude = []
LOWdeny.toml61
LOWdeny.toml121
LOWdeny.toml141# If true, ignores workspace crates that aren't published, or are only
LOWdeny.toml161# The graph highlighting used when creating dotgraphs for crates
LOWdeny.toml181deny = [
LOWdeny.toml201# "hyper-rustls",
LOWlinting/rspack_collection_hasher/src/lib.rs21 ///
LOW…rspack_loader_swc/src/rsc_transforms/server_actions.rs221 // Prepend an extra byte to the ID, with the following format:
LOW…rspack_loader_swc/src/rsc_transforms/server_actions.rs241 // }
LOW…rspack_loader_swc/src/rsc_transforms/server_actions.rs2141// This implementation is fast and simple as it allows only one
LOW…/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs21///
LOW…/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs41///
LOW…/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs61/// }));
LOWcrates/rspack_plugin_schemes/src/http_uri/http_cache.rs181 .unwrap_or(location.clone()),
LOWcrates/rspack_plugin_html/src/config.rs141#[derive(Serialize, Debug)]
LOWcrates/rspack_plugin_css/src/plugin/mod.rs161 failed_module: has_failed.identifier(),
LOWcrates/rspack_plugin_esm_library/src/optimize_chunks.rs21/// already have fully executed before the child can resolve its imports — but
LOWcrates/rspack_plugin_esm_library/src/optimize_chunks.rs761 (strict_chunks, all_dyn_targets, namespace_targets)
LOWcrates/rspack_plugin_lightning_css_minimizer/src/lib.rs221 // enable when we have a better way to handle it. let warnings = warnings.read().expect("should lock");
LOWcrates/rspack_allocator/src/lib.rs1#[global_allocator]
LOWcrates/rspack_loader_runner/src/loader.rs21pub struct LoaderItem<Context: Send> {
LOWcrates/rspack_binding_api/src/lib.rs1#![recursion_limit = "256"]
LOWcrates/rspack_binding_api/src/lib.rs21//!
LOWcrates/rspack_binding_api/src/asset.rs41 pub minimized: Option<bool>,
LOWcrates/rspack_binding_api/src/module.rs61
LOWcrates/rspack_binding_api/src/rstest.rs21}
LOWcrates/rspack_binding_api/src/rstest.rs41 pub globals: Option<bool>,
LOW…ck_binding_api/src/raw_options/raw_split_chunks/mod.rs61#[derive(Debug)]
LOW…s/rspack_binding_api/src/raw_options/raw_module/mod.rs301 pub commonjs: Option<Either<bool, RawJavascriptParserCommonjsOptions>>,
LOW…s/rspack_binding_api/src/raw_options/raw_module/mod.rs321 pub type_reexports_presence: Option<String>,
LOW…k_binding_api/src/raw_options/raw_builtins/raw_copy.rs21
LOW…k_binding_api/src/raw_options/raw_builtins/raw_copy.rs41 #[debug(skip)]
LOW…k_binding_api/src/raw_options/raw_builtins/raw_copy.rs61 /// The automatic inference rules are as follows:
LOW…k_binding_api/src/raw_options/raw_builtins/raw_copy.rs81 pub glob_options: RawCopyGlobOptions,
LOW…k_binding_api/src/raw_options/raw_builtins/raw_copy.rs121}
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs21
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs41 ///
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs61 /// A list of exports fields in description files.
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs81 pub extension_alias: Option<FxHashMap<String, Vec<String>>>,
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs101 pub fully_specified: Option<bool>,
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs121 ///
LOW…ates/rspack_binding_api/src/rspack_resolver/options.rs141 /// On non-Windows systems these requests are resolved as an absolute path first.
LOWcrates/rspack_binding_api/src/compilation/entries.rs141 // unimplemented!()
LOWcrates/swc_plugin_import/src/legacy_case.rs41
LOWcrates/rspack_loader_lightningcss/src/lib.rs101 let stylesheet = StyleSheet::parse(&content_str, option.clone()).to_rspack_result()?;
LOWcrates/rspack_binding_builder_macros/src/lib.rs1//! Exports a few macros to help you create a custom plugin register with Rspack.
LOWcrates/rspack_binding_builder_macros/src/lib.rs21/// ## Usage
LOWcrates/rspack_binding_builder_macros/src/lib.rs41/// register_plugin!(
LOWcrates/rspack_binding_builder_macros/src/lib.rs61/// const { registerMyBannerPlugin } = require('your-custom-binding');
LOW…_dependencies/src/circular_dependency_rspack_plugin.rs221 /// counted as a cycle.
LOWcrates/rspack_error/src/error.rs21 /// Source code offset.
LOWcrates/rspack_error/src/error.rs41 /// The source code block will be displayed only if both source code and labels exist.
LOWcrates/rspack_parallel/src/lib.rs21///
LOWcrates/rspack_parallel/src/scope.rs21/// asynchronous structured concurrent code more easily.
LOWcrates/rspack_parallel/src/scope.rs41/// rspack_parallel::scope(|token| {
LOWcrates/rspack_parallel/src/scope.rs61/// for i in 0..list.len() {
LOWcrates/rspack_sources/src/concat_source.rs21///
186 more matches not shown…
Cross-Language Confusion (JS/TS)15 hits · 102 pts
SeverityFileLineSnippet
HIGH…ack-test/exampleCases/module-code-splitting/example.js5 print(counter.value);
HIGH…ack-test/exampleCases/module-code-splitting/example.js9 print(counter.value);
HIGH…ack-test/exampleCases/module-code-splitting/example.js11 print(counter.value);
HIGHtests/rspack-test/exampleCases/module/example.js3print(value);
HIGHtests/rspack-test/exampleCases/module/example.js7print(value);
HIGHtests/rspack-test/exampleCases/module/example.js9print(value);
HIGHpackages/rspack/src/stats/StatsPrinter.ts182 print(
HIGHpackages/rspack-test-tools/src/case/hook.ts101 print(val: sources.Source) {
HIGHpackages/rspack-test-tools/src/case/hook.ts110 print(val: Compiler | Compilation) {
HIGHpackages/rspack-test-tools/src/helper/serializers.ts12 print(received) {
HIGHpackages/rspack-test-tools/src/helper/serializers.ts21 print(received, next) {
HIGHpackages/rspack-test-tools/src/helper/serializers.ts30 print(received, next) {
HIGHpackages/rspack-test-tools/src/helper/serializers.ts40 print(received, next) {
HIGHpackages/rspack-test-tools/src/helper/serializers.ts49 print(received, next) {
HIGHpackages/rspack-test-tools/src/helper/expect/error.ts13 print(val: any) {
Hyper-Verbose Identifiers66 hits · 66 pts
SeverityFileLineSnippet
LOWcrates/rspack_plugin_library/src/umd_library_plugin.rs170 r#"function webpackLoadOptionalExternalModuleAmd({wrapper_arguments}) {{
LOWcrates/rspack_plugin_library/src/umd_library_plugin.rs283 "(function webpackUniversalModuleDefinition(root, factory) {\n",
LOWcrates/rspack_plugin_library/src/umd_library_plugin.rs427 expr = format!("(function webpackLoadOptionalExternalModule() {{ try {{ return {expr}; }} catch(e) {{}} }}())"
LOW…/treeShakingCases/namespace-access-var-decl-rhs/lib.js9export function getDocPermissionTextSendMe() {}
LOW…access-var-decl-rhs/__snapshots__/treeshaking.snap.txt46function getDocPermissionTextSendMe() {}
LOW…figCases/rule-set/simple-use-fn-array/rspack.config.js1function createFunctionArrayFromUseArray(useArray) {
LOW…st/configCases/amd/real-amd-libs/webpack-umd-output.js1(function webpackUniversalModuleDefinition(root, factory) {
LOW…/rspack-test/configCases/tree-shaking/new-url/index.js17function countSubstringOccurrences(string, substring) {
LOW…ack-test/configCases/inner-graph/issue-11678/module.js181function showSortManualButtonState() {
LOW…ack-test/configCases/inner-graph/issue-11678/module.js217async function onInsertFromTemplateDialog() {
LOW…ack-test/configCases/inner-graph/issue-11678/module.js1073async function doCreateAndShowTableWidget(
LOW…ack-test/configCases/inner-graph/issue-11678/module.js2486async function showAssignResourcesDialog(appendTo) {
LOW…-test/configCases/inner-graph/altaskitButton/module.js104 value: function componentWillReceiveProps(nextProps) {
LOW…ack-test/configCases/trusted-types/web-worker/index.js20function createWorkerWithChunkName() {
LOW…ack-test/configCases/trusted-types/web-worker/index.js34function createWorkerWithChunkNameInnner() {
LOW…/mangle-with-destructuring-assignment/rspack.config.js20 function getJsonCodeGeneratedSource(compiler) {
LOWtests/rspack-test/statsAPICases/numeric-chunk-ids.js13function expectNullableChunkIdArray(ids) {
LOWtests/rspack-test/exampleCases/wasm-complex/memory.js1async function getMemoryFromParentInWorker() {
LOW…/e2e/cases/lazy-compilation/cross-origin/index.test.ts15function createLazyCompilationServer(
LOWpackages/rspack/rslib.browser.config.ts160function copyRspackBrowserRuntimePlugin(): RsbuildPlugin {
LOWpackages/rspack/rslib.browser.config.ts247async function getModuleFederationRuntimeCode() {
LOWpackages/rspack/src/RuntimeGlobals.ts669export function createCompilerRuntimeGlobals(
LOWpackages/rspack/src/RuntimeModule.ts83export function createRenderedRuntimeModule(
LOWpackages/rspack/src/rspackOptionsApply.ts442function getModernModuleCjsExternalType(
LOWpackages/rspack/src/sharing/SharePlugin.ts75export function createProvideShareOptions(
LOWpackages/rspack/src/sharing/SharePlugin.ts94export function createConsumeShareOptions(
LOWpackages/rspack/src/sharing/ConsumeSharedPlugin.ts37export function normalizeConsumeShareOptions(
LOW…ages/rspack/src/builtin-plugin/SwcJsMinimizerPlugin.ts230function getRawExtractCommentsOptions(
LOWpackages/rspack/src/builtin-plugin/ExternalsPlugin.ts168function getRawExternalItemValueFormFnResult(result?: ExternalItemValue) {
LOWpackages/rspack/src/util/fake.ts5export function createFakeCompilationDependencies(
LOWpackages/rspack/src/config/adapterRuleUse.ts505function createRawModuleRuleUsesImpl(
LOWpackages/rspack/src/config/adapter.ts172function getRawResolveByDependency(
LOWpackages/rspack/src/config/adapter.ts459function getRawRuleSetLogicalConditions(
LOWpackages/rspack/src/config/adapter.ts483function getRawGeneratorOptionsMap(
LOWpackages/rspack/src/config/adapter.ts563function getRawJavascriptParserOptions(
LOWpackages/rspack/src/config/adapter.ts653function getRawCssParserOptionsForCss(
LOWpackages/rspack/src/config/adapter.ts752function getRawAssetGeneratorOptions(
LOWpackages/rspack/src/config/adapter.ts761function getRawAssetInlineGeneratorOptions(
LOWpackages/rspack/src/config/adapter.ts772function getRawAssetResourceGeneratorOptions(
LOWpackages/rspack/src/config/adapter.ts785function getRawAssetGeneratorDataUrl(dataUrl: AssetGeneratorDataUrl) {
LOWpackages/rspack/src/config/adapter.ts803function getRawCssGeneratorOptions(
LOWpackages/rspack/src/config/adapter.ts812function getRawCssAutoOrModuleGeneratorOptions(
LOWpackages/rspack/src/config/adapter.ts827function getRawJsonGeneratorOptions(
LOWpackages/rspack/src/container/ModuleFederationPlugin.ts169 function getExternalTypeFromExternal(external: string) {
LOW…rspack/src/builtin-loader/swc/collectTypeScriptInfo.ts19export function resolveCollectTypeScriptInfo(
LOWpackages/rspack/src/builtin-loader/swc/index.ts18function defaultTargetFromRspackTargets(targets: Record<string, string>) {
LOW…kages/rspack/src/builtin-loader/lightningcss/target.ts13export function defaultTargetsFromRspackTargets(
LOWpackages/rspack/src/loader-runner/service.ts112export function isWorkerResponseErrorMessage(
LOWpackages/rspack/src/loader-runner/worker.ts554function createWaitForPendingRequest(
LOWpackages/rspack-test-tools/src/test/debug.ts53function generateCaseMetaPathReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts63function generateCaseMetaTestConfigReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts74function generateReadConfigFileReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts89function generateFinalOptionsReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts100function generateCreateCompilerInstanceReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts113function generateCreateCompilerSetPropertiesReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts125function generateBuildMethodReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts154function generateBuildWarningReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts164function generateRunFindBundleReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/test/debug.ts176function generateRunGetRunnerReport(context: ITestContext) {
LOWpackages/rspack-test-tools/src/case/incremental.ts18function createHotIncrementalProcessor(
6 more matches not shown…
Verbosity Indicators14 hits · 28 pts
SeverityFileLineSnippet
LOWcrates/rspack_plugin_esm_library/src/optimize_chunks.rs653 // Step 1: Collect export names per module per chunk (for non-strict, non-external,
LOWcrates/rspack_plugin_esm_library/src/optimize_chunks.rs694 // Step 2: Find modules with conflicting export names (same name in multiple modules)
LOWcrates/rspack_plugin_esm_library/src/optimize_chunks.rs717 // Step 3: Only assign namespace names when needed (namespace used as a whole or has conflicts)
LOW…tes/rspack_plugin_rstest/src/mock_method_dependency.rs116 // Step 1: Add placeholder init fragment for hoistable methods
LOW…tes/rspack_plugin_rstest/src/mock_method_dependency.rs121 // Step 2: Hoist @rstest/core import to ensure it comes before all hoisted code
LOW…tes/rspack_plugin_rstest/src/mock_method_dependency.rs124 // Step 3: Transform the source code
LOW…ks/no-emit-on-errors-recover-consecutive/index.test.ts8 // Step 0: initial build succeeds
LOW…ks/no-emit-on-errors-recover-consecutive/index.test.ts11 // Step 1: introduce syntax error
LOW…ks/no-emit-on-errors-recover-consecutive/index.test.ts19 // Step 2: introduce a different syntax error
LOW…ks/no-emit-on-errors-recover-consecutive/index.test.ts27 // Step 3: fix the error → HMR should compare against step 0 (last good compilation)
LOW…2e/cases/hooks/no-emit-on-errors-recover/index.test.ts8 // Step 0: initial build succeeds
LOW…2e/cases/hooks/no-emit-on-errors-recover/index.test.ts11 // Step 1: introduce syntax error → compilation fails, emitOnErrors: false prevents emit
LOW…2e/cases/hooks/no-emit-on-errors-recover/index.test.ts20 // Step 2: fix the error → HMR should compare against step 0 (last good compilation)
LOW…spack/src/builtin-plugin/SubresourceIntegrityPlugin.ts209 // For absolute URLs, we need to check if they're under our publicPath
AI Slop Vocabulary4 hits · 11 pts
SeverityFileLineSnippet
MEDIUMcrates/rspack_sources/src/object_pool.rs8// 3. Cache friendly: 512 bytes can typically utilize CPU cache well
MEDIUMcrates/rspack/src/lib.rs3//! Rspack is a high performance JavaScript bundler written in Rust. It offers strong compatibility with the webpack eco
MEDIUMcrates/rspack_core/src/compiler/rebuild.rs113 // Make sure `thisCompilation` hook was called before any other hooks that leverage `JsCompilation`.
MEDIUM.github/workflows/reusable-release-npm.yml46 fail-fast: false # for better utilize ci runners
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALpackages/rspack-test-tools/src/runner/web/index.ts89 this.dom.window.document.head.appendChild(cssElement);
Decorative Section Separators4 hits · 8 pts
SeverityFileLineSnippet
MEDIUMtests/rspack-test/errorCases/error-missing-file.js16 "message": " × Module not found: Can't resolve './missing' in '<TEST_ROOT>/fixtures/errors' ╭─[4:0] 2 │ 3
MEDIUMtests/rspack-test/errorCases/error-missing-file.js25 "message": " × Module not found: Can't resolve './dir/missing2' in '<TEST_ROOT>/fixtures/errors' ╭─[12:9]
MEDIUMtests/rspack-test/errorCases/error-missing-file.js52 "message": " × Module not found: Can't resolve './missing' in '<TEST_ROOT>/fixtures/errors' ╭─[4:0] 2 │ 3
MEDIUMtests/rspack-test/errorCases/error-missing-file.js61 "message": " × Module not found: Can't resolve './dir/missing2' in '<TEST_ROOT>/fixtures/errors' ╭─[12:9]
Slop Phrases2 hits · 3 pts
SeverityFileLineSnippet
LOW.github/workflows/reusable-build-test.yml57 # If this is to change, make sure to upgrade the ubuntu version in GitHub Actions
LOW.github/workflows/reusable-build-test.yml72 # If this is to change, make sure to upgrade the ubuntu version in GitHub Actions
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippet
LOW…/treeShakingCases/webpack-inner-graph-switch/module.js21function doSomething(obj) {
LOW…s/rspack-test/normalCases/inner-graph/switch/module.js21function doSomething(obj) {