# Fallow — TypeScript Codebase Intelligence Analyzer in Rust > A Rust-native static analysis tool that finds unused code, duplicates, circular dependencies, and complexity hotspots in TypeScript and JavaScript projects. ## Install Save in your project root: # Fallow — TypeScript Codebase Intelligence Analyzer in Rust ## Quick Use ```bash npx fallow # or install globally npm install -g fallow ``` ```bash fallow analyze ./src ``` ## Introduction Fallow is a Rust-native codebase intelligence tool for TypeScript and JavaScript projects. It detects unused exports, duplicate code, circular dependencies, and complexity hotspots in sub-second time, helping teams keep large codebases clean and maintainable. ## What Fallow Does - Identifies unused exports, dead code, and unreferenced files across a TypeScript/JavaScript project - Detects copy-pasted code blocks and near-duplicate implementations - Maps circular dependency chains and visualizes module dependency graphs - Calculates complexity metrics to highlight hotspots that may need refactoring - Enforces architecture boundaries between modules or packages in a monorepo ## Architecture Overview Fallow uses the oxc parser (a fast Rust-based JavaScript/TypeScript parser) to build an AST from source files. It constructs a dependency graph by resolving imports and exports, then runs multiple analysis passes: reachability analysis for dead code detection, token-based similarity for duplication, cycle detection for circular dependencies, and metric aggregation for complexity scoring. The Rust implementation keeps full-project analysis under one second for most codebases. ## Self-Hosting & Configuration - Install via npm (`npx fallow` or `npm install -g fallow`) or download the Rust binary directly - Run `fallow analyze` in a project root to scan all TypeScript and JavaScript files - Configure analysis rules in a `fallow.config.json` or via CLI flags - Exclude paths or files with glob patterns in the configuration - Integrate into CI pipelines to enforce code quality thresholds on pull requests ## Key Features - Sub-second analysis speed on most projects thanks to the Rust implementation - Zero configuration needed for basic unused code and circular dependency detection - Framework-aware analysis understands Next.js, React, and common project structures - Architecture boundary enforcement prevents unwanted cross-module dependencies - JSON and human-readable output formats for CI integration and developer workflows ## Comparison with Similar Tools - **ESLint** — Rule-based linter for code style; Fallow focuses on structural analysis like dead code and duplication - **Knip** — JavaScript dead code finder; Fallow adds duplication detection and complexity analysis in a faster runtime - **Madge** — Circular dependency visualization; Fallow includes this plus dead code and duplication analysis - **SonarQube** — Enterprise code quality platform; Fallow is lighter and specialized for TypeScript - **depcheck** — Finds unused npm dependencies; Fallow analyzes source-level exports and imports ## FAQ **Q: Does it support plain JavaScript or only TypeScript?** A: Both. Fallow analyzes `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, and `.cjs` files. **Q: How fast is it on large codebases?** A: Most projects analyze in under one second. The Rust implementation and oxc parser make it significantly faster than Node.js-based alternatives. **Q: Can I use it in a monorepo?** A: Yes. Fallow supports monorepo structures and can enforce architecture boundaries between packages. **Q: Does it support auto-fixing issues?** A: Fallow reports findings but does not auto-remove code. Deletion is left to the developer to avoid unintended side effects. ## Sources - https://github.com/fallow-rs/fallow --- Source: https://tokrepo.com/en/workflows/asset-876c30b2 Author: AI Open Source