Repository Analysis

rolldown/rolldown

Fast Rust bundler for JavaScript/TypeScript with Rollup-compatible API.

1.2 Likely human-written View on GitHub
1.2
Adjusted Score
1.2
Raw Score
100%
Time Factor
2026-05-30
Last Push
13,555
Stars
Rust
Language
291,276
Lines of Code
7792
Files
313
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 2HIGH 2MEDIUM 3LOW 306

Pattern Findings

313 matches across 7 categories. Click a row to expand file-level details.

Over-Commented Block210 hits · 210 pts
SeverityFileLineSnippet
LOWtasks/generator/src/output/rust.rs81/// in generated code.
LOWtasks/generator/src/generators/mod.rs21 fn generate_many(&self, ctx: &Context) -> Result<Vec<Output>> {
LOWcrates/rolldown_watcher/src/watcher_state.rs1use crate::file_change_event::FileChangeEvent;
LOWcrates/rolldown/tests/rolldown/optimization/mod.rs1// Only Rust-based tests are declared here.
LOW…ion_order/pure_annotation_local_fn_reads_global/dep.js1// `getGlobalValue` is a local function whose body accesses a global variable.
LOWcrates/rolldown/tests/rolldown/issues/8863/noop.js1// Empty module that gets included when treeshake is disabled.
LOWcrates/rolldown/tests/rolldown/issues/9028/cycle-a.js1// cycle-a and cycle-b form a circular dependency.
LOW…e.exports_export/safely_merge_cjs_ns_reexport/entry.js1// Test case: re-export from CJS module with namespace alias
LOW…opics/deconflict/unreferenced_renamed_conflict/main.js1import { test } from './module_a.js';
LOW…lict/nested_scope_rename_counter/module_with_nested.js1// Function with parameters `a` and `a$1`.
LOW…/topics/deconflict/nested_scope_rename_counter/main.js1import { a } from './other.js';
LOW…e/const_value_inlining_bundle/print-shorthand-entry.js1import { foo, _bar } from './print-shorthand-constants'
LOW…n/tests/esbuild/dce/no_side_effects_comment/stmt-fn.js1//! These should all have "no side effects"
LOW…n/tests/esbuild/default/char_freq_ignore_comments/b.js1export default function(one, two, three, four) {
LOW…/esbuild/default/.legal_comments_many_end_of_file/a.js1console.log('in a') //! Copyright notice 1
LOW…/esbuild/default/.legal_comments_many_end_of_file/b.js1console.log('in b') //! Copyright notice 1
LOW…ldown/tests/esbuild/default/inject_import_ts/inject.js1// Unused imports are automatically removed in TypeScript files (this
LOW…tes/rolldown/tests/esbuild/default/source_map/data.txt1#2041
LOWcrates/rolldown/src/module_finalizers/mod.rs561 ///
LOWcrates/rolldown/src/types/linking_metadata.rs21 ///
LOWcrates/rolldown/src/types/linking_metadata.rs41 pub wrapper_stmt_info: Option<StmtInfoIdx>,
LOWcrates/rolldown/src/types/generator.rs81
LOW…/rolldown/src/stages/generate_stage/chunk_optimizer.rs601 dynamic_entry.iter().all(|idx| reached_dynamic_chunk.is_some_and(|set| set.contains(idx)));
LOW…s/rolldown/src/stages/generate_stage/code_splitting.rs621 for (chunk_idx, entry_external_module_map) in module_to_entry_level_external_rec_list_maps {
LOW…lldown/src/stages/generate_stage/on_demand_wrapping.rs41 /// };
LOW…src/stages/generate_stage/compute_cross_chunk_links.rs441 .map(|(name, export)| (name, export.symbol_ref))
LOWcrates/rolldown/src/stages/link_stage/sort_modules.rs21 /// - Since import statements are hoisted, `require(...)` is always placed after static `import` statements.
LOWcrates/rolldown/src/stages/link_stage/mod.rs81 /// True if any module has enum member values to inline. Computed once to avoid
LOW…down/src/stages/link_stage/bind_imports_and_exports.rs121impl LinkStage<'_> {
LOW…down/src/stages/link_stage/bind_imports_and_exports.rs381 /// ```js
LOW…down/src/stages/link_stage/bind_imports_and_exports.rs421 Module::External(_) => return,
LOW…down/src/stages/link_stage/bind_imports_and_exports.rs601 {
LOW…own/src/stages/link_stage/patch_module_dependencies.rs81 (module_idx, extended_dependencies, inherited_runtime)
LOW…c/stages/link_stage/tree_shaking/include_statements.rs41 /// 1. https://github.com/rolldown/rolldown/blob/8bc7dca5a09047b6b494e3fa7b6b7564aa465372/crates/rolldown/src/st
LOW…c/stages/link_stage/tree_shaking/include_statements.rs481 /// return mod;
LOW…c/stages/link_stage/tree_shaking/include_statements.rs961 // after inlining. This mirrors the `constant_symbol_map` bypass in `include_symbol`.
LOWcrates/rolldown/src/hmr/hmr_stage.rs301 self.render_hmr_patch_from_prerequisites(prerequisites, &new_added_modules).await?
LOWcrates/rolldown/src/hmr/hmr_ast_finalizer.rs41 /// `false` for HMR patches: the patch's whole point is to re-execute the body and
LOWcrates/rolldown/src/hmr/hmr_ast_finalizer.rs381 // SPAN,
LOWcrates/rolldown/src/hmr/hmr_ast_finalizer.rs401 // };
LOWcrates/rolldown/src/hmr/hmr_ast_finalizer.rs601
LOWcrates/rolldown/src/hmr/hmr_ast_finalizer.rs621 //
LOWcrates/rolldown/src/hmr/hmr_ast_finalizer.rs861
LOWcrates/rolldown/src/runtime/runtime-tail-node.js1// This is created by the rolldown. It's used to polyfill the global `require` function when you bundling code
LOWcrates/rolldown/src/bundle/bundle_handle.rs1use std::sync::{
LOWcrates/rolldown/src/bundle/bundle_handle.rs21/// # Why This Exists
LOWcrates/rolldown/src/utils/renamer.rs21 /// Key is the canonical name, value is the conflict index for generating unique names.
LOWcrates/rolldown/src/utils/renamer.rs101 /// already exists in a nested scope, which would cause the nested binding to
LOWcrates/rolldown/src/utils/renamer.rs121 /// console.log(foo$1); // Would capture the wrong value
LOWcrates/rolldown/src/utils/renamer.rs301 /// Rename nested bindings that would capture star import member references.
LOWcrates/rolldown/src/utils/renamer.rs361 /// has the same name as the renamed import, that nested binding must be renamed
LOWcrates/rolldown/src/utils/renamer.rs421 /// // cjs-module.js (detected as CommonJS)
LOWcrates/rolldown/src/utils/renamer.rs441 /// This handles two cases:
LOWcrates/rolldown/src/ecmascript/format/iife.rs1//! This is the render function for IIFE format.
LOW…ates/rolldown/src/ecmascript/format/utils/namespace.rs21///
LOW…ates/rolldown/src/ecmascript/format/utils/namespace.rs61///
LOWcrates/rolldown/src/ast_scanner/mod.rs61 const Jsx = 1 << 1;
LOWcrates/rolldown/src/ast_scanner/mod.rs101 /// `EcmaView`, since top-level await is rare.
LOWcrates/rolldown/src/ast_scanner/mod.rs581 );
LOW…s/rolldown/src/ast_scanner/side_effect_detector/mod.rs301 _ => expr.may_have_side_effects(self).into(),
150 more matches not shown…
Hyper-Verbose Identifiers78 hits · 78 pts
SeverityFileLineSnippet
LOW…own_plugin_hmr/src/runtime/runtime-extra-dev-common.js147 return function sendModuleRegisteredMessage(module) {
LOWcrates/rolldown/tests/rolldown/issues/6660/d.js1export async function loadEventStreamCapability() {
LOW…/deconflict/issue_6586_generated_name_conflict/main.js11function testGeneratedNameConflict(a$1) {
LOWdocs/apis/plugin-api/file-urls.md56function registerPaintWorkletPlugin() {
LOWdocs/.vitepress/markdown-hooks-graph.ts522export function createHooksGraphProcessor(): Processor {
LOWscripts/misc/setup-benchmark-input/util.js12export async function cloneRolldownBenchcasesIfNotExists() {
LOWscripts/meta/utils.js5export function assertRunningScriptFromRepoRoot() {
LOWscripts/src/esbuild-tests/gen-tests.ts189function collectFunctionLocalBindings(
LOWscripts/src/esbuild-tests/snap-diff/runner.ts237function getSummaryMarkdownAndStats(
LOWpackages/test-dev-server/tests/test-utils.ts184export async function waitForModuleRegistration(
LOWpackages/rolldown/build.ts262function getTsconfigCompilerOptionsForFile(file: string) {
LOW…rolldown/tests/stability/issue-3453/src/import-maps.js39function sortAndNormalizeSpecifierMap(originalMap, baseURL) {
LOW…rolldown/tests/stability/issue-3453/src/import-maps.js186function parseURLLikeImportSpecifier(specifier, baseURL) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file57.js84function getScoreForSearchIndexItem(item, query, words, fullQuery) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js1264function removeNonTranslationalTransform(visualElement) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js2212function makeNoneKeyframesAnimatable(
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js2499function requiresPregeneratedKeyframes(options) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js4535function variantLabelsAsDependency(prop) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js4581function createRendererMotionComponent(
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js4653function getProjectionFunctionality(props) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js4948function updateMotionValuesFromProps(element, next, prev) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js5410function createDOMMotionComponentProxy(componentFactory) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js5606function calcRelativeAxisConstraints(axis, min, max) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js5618function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js6968function cancelTreeOptimisedTransformAnimations(projectionNode) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js8312function shouldAnimatePositionOnly(animationType, snapshot, layout2) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js8450function fireSyntheticPointerEvent(name, handler) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js8853function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js9194function createMotionComponentFactory(preloadedFeatures, createVisualElement) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js10070function createWindowResizeHandler() {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js10827function createAnimationsFromSequence(
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js11089function createObjectVisualElement(subject) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js11619function useInstantLayoutTransition() {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js11656function disableInstantTransitions() {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js11684function handoffOptimizedAppearAnimation(elementId, valueName, frame2) {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js11716function resumeSuspendedAnimations() {
LOW…/rolldown/tests/stability/issue-3453/src/lib/file37.js11723function startOptimizedAppearAnimation(
LOWpackages/rolldown/src/builtin-plugin/constructors.ts17export function viteModulePreloadPolyfillPlugin(
LOWpackages/rolldown/src/builtin-plugin/constructors.ts31export function viteDynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin {
LOWpackages/rolldown/src/builtin-plugin/constructors.ts61export function viteBuildImportAnalysisPlugin(
LOWpackages/rolldown/src/builtin-plugin/constructors.ts78export function isolatedDeclarationPlugin(
LOWpackages/rolldown/src/builtin-plugin/constructors.ts119export function viteReactRefreshWrapperPlugin(
LOWpackages/rolldown/src/builtin-plugin/utils.ts27export function makeBuiltinPluginCallable(
LOWpackages/rolldown/src/plugin/bindingify-hook-filter.ts41function transformFilterMatcherToFilterExprs(
LOWpackages/rolldown/src/plugin/bindingify-hook-filter.ts217export function bindingifyResolveIdFilter(
LOWpackages/rolldown/src/plugin/bindingify-hook-filter.ts246export function bindingifyTransformFilter(
LOWpackages/rolldown/src/plugin/bindingify-hook-filter.ts265export function bindingifyRenderChunkFilter(
LOWpackages/rolldown/src/plugin/bindingify-build-hooks.ts147export function bindingifyResolveDynamicImport(
LOWpackages/rolldown/src/plugin/bindingify-output-hooks.ts166export function bindingifyAugmentChunkHash(
LOWpackages/rolldown/src/utils/transform-sourcemap.ts13export function normalizeTransformHookSourcemap(
LOW…ages/rolldown/src/utils/normalize-transform-options.ts16export function normalizeTransformOptions(inputOptions: InputOptions): NormalizedTransformOptions {
LOW…ckages/rolldown/src/utils/transform-rendered-module.ts4export function transformToRenderedModule(
LOWpackages/rolldown/src/utils/bindingify-input-options.ts134function bindingifyAttachDebugInfo(
LOWpackages/rolldown/src/utils/bindingify-input-options.ts321function bindingifyTreeshakeOptions(
LOWpackages/rolldown/src/utils/bindingify-input-options.ts374function bindingifyMakeAbsoluteExternalsRelative(
LOWpackages/rolldown/src/utils/bindingify-input-options.ts385export function bindingifyPreserveEntrySignatures(
LOWpackages/rolldown/src/utils/error.ts56export function aggregateBindingErrorsIntoJsError(rawErrors: BindingError[]): BundleError {
LOW…kages/rolldown/src/utils/transform-to-rollup-output.ts18export function transformToRollupSourceMap(map: string): SourceMap {
LOW…kages/rolldown/src/utils/transform-to-rollup-output.ts35function transformToRollupOutputChunk(bindingChunk: BindingOutputChunk): OutputChunk {
LOW…kages/rolldown/src/utils/transform-to-rollup-output.ts39function transformToMutableRollupOutputChunk(
18 more matches not shown…
Verbosity Indicators17 hits · 28 pts
SeverityFileLineSnippet
LOW…rolldown_plugin_bundle_analyzer/src/render_markdown.rs209 // Step 1: Collect static entry chunks with reachability sets
LOW…rolldown_plugin_bundle_analyzer/src/render_markdown.rs229 // Step 2: For each common chunk, find modules reachable by exactly one static entry
LOW…rolldown_plugin_bundle_analyzer/src/render_markdown.rs305 // Step 3: Render
LOWcrates/rolldown_watcher/src/watch_coordinator.rs142 // Step 3: Restart notification
LOWcrates/rolldown_watcher/src/watch_coordinator.rs145 // Step 4: Start event
LOWcrates/rolldown_watcher/src/watch_coordinator.rs148 // Step 5: Build each task that needs it
LOWcrates/rolldown_watcher/src/watch_coordinator.rs175 // Step 6: End event
LOWcrates/rolldown_watcher/src/watch_coordinator.rs178 // Step 7: Drain buffered events that arrived during the build
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs47 // Step 0: Move directive comments attached to 0 so that it's not removed when the directives are removed
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs65 // Step 1: Build initial semantic data and check for semantic errors.
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs156 // Step 2: Run define plugin.
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs167 // Step 3: Transform TypeScript and jsx.
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs212 // Step 4: Run inject plugin.
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs224 // Step 5: Run DCE.
LOWcrates/rolldown/src/utils/pre_process_ecma_ast.rs241 // Step 6: Modify AST for Rolldown.
LOWcrates/rolldown_binding/src/classic_bundler.rs18/// const bundle = await rollup({ input: 'src/index.js' }); // Step 1: Input options only
LOWcrates/rolldown_binding/src/classic_bundler.rs19/// await bundle.write({ dir: 'dist/esm', format: 'esm' }); // Step 2: Output options
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippet
CRITICALcrates/rolldown/src/module_finalizers/impl_visit_mut.rs453 if let Some(kind) = self.ctx.module.ecma_view.this_expr_replace_map.get(&this_expr.span) {
CRITICALcrates/rolldown/src/module_loader/module_loader.rs442 if self.shared_context.options.experimental.vite_mode.unwrap_or_default()
Synthetic Comment Markers2 hits · 10 pts
SeverityFileLineSnippet
HIGHAGENTS.md59- `packages/debug/src/generated/*` - Auto-generated code for devtools integration
HIGHtasks/generator/src/output/mod.rs23 "{comment_start} Auto-generated code, DO NOT EDIT DIRECTLY!\n\
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMcrates/rolldown/src/hmr/hmr_ast_finalizer.rs630 // TODO: hyf0 should switch to a more robust way to identify lazy proxy modules
MEDIUMcrates/rolldown/src/hmr/hmr_ast_finalizer.rs884 // TODO(hana): we should think about a more robust way to track the consolidated export type of a module in the fu
Slop Phrases2 hits · 4 pts
SeverityFileLineSnippet
MEDIUM…/build_diagnostic/events/illegal_identifier_as_name.rs17 r#"Given name "{}" is not a legal JS identifier. If you need this, you can try "output.extend: true"."#,
LOW.github/workflows/update-test-dependencies.yml326 # make sure to run this step before updating the version in urls.ts