### Fallow Coverage Setup Command Source: https://docs.fallow.tools/cli/coverage Initiates the guided first-run setup flow for Fallow coverage. This flow includes license checks, sidecar installation, and recipe generation. ```bash fallow coverage setup ``` -------------------------------- ### Example Output of Dry Run Installation Source: https://docs.fallow.tools/integrations/claude-hooks Shows the expected output format when previewing the installation of Claude Code hooks, detailing affected paths and changes. ```text fallow hooks install --target agent (install): .claude/settings.json updated (1 handler added, 1 preserved) .claude/hooks/fallow-gate.sh created AGENTS.md managed block inserted ``` -------------------------------- ### Fallow Coverage Setup with Yes and JSON Flags Source: https://docs.fallow.tools/cli/coverage Executes the setup flow non-interactively and outputs deterministic, agent-readable JSON instructions. This mode does not prompt or perform actions like installing packages. ```bash fallow coverage setup --yes --json ``` -------------------------------- ### Fallow Coverage Setup with Yes Flag Source: https://docs.fallow.tools/cli/coverage Automatically accepts all prompts during the setup process. Useful for local setup when automated continuation is desired. ```bash fallow coverage setup --yes ``` -------------------------------- ### Agent-Driven Coverage Setup (JSON Output) Source: https://docs.fallow.tools/cli/coverage This is the agent-driven entry point for coverage setup. The output is deterministic and side-effect-free. Add --explain for in-payload documentation. ```json { "schema_version": "1", "framework_detected": "plain_node", "package_manager": "bun", "runtime_targets": ["node", "browser"], "members": [ { "name": "fallow-cloud", "path": ".", "framework_detected": "plain_node", "runtime_targets": ["node"], "files_to_edit": [{"path": "src/index.ts", "reason": "..."}], "snippets": [{"label": "Node entrypoint", "path": "src/index.ts", "content": "..."}], "dockerfile_snippet": "ENV FALLOW_TRANSPORT=fs\nENV FALLOW_WRITE_TO_DIR=/tmp/fallow-coverage", "warnings": [] }, { "name": "fallow-dashboard", "path": "dashboard", "framework_detected": "vite", "runtime_targets": ["browser"], "files_to_edit": [{"path": "dashboard/src/main.ts", "reason": "..."}], "snippets": [{"label": "Vite browser entry", "path": "dashboard/src/main.ts", "content": "..."}], "dockerfile_snippet": null, "warnings": [] } ], "config_written": null, "commands": ["bun add @fallow-cli/beacon", "bun add -d @fallow-cli/fallow-cov"], "files_to_edit": [{"path": "src/index.ts", "reason": "..."}], "snippets": [{"label": "Node entrypoint", "path": "src/index.ts", "content": "..."}], "dockerfile_snippet": "ENV FALLOW_TRANSPORT=fs\nENV FALLOW_WRITE_TO_DIR=/tmp/fallow-coverage", "next_steps": [...], "warnings": [] } ``` -------------------------------- ### Install Fallow with Yarn Source: https://docs.fallow.tools/installation Install Fallow globally using Yarn. ```bash yarn global add fallow ``` -------------------------------- ### Full Fallow Configuration Example (.fallowrc.json) Source: https://docs.fallow.tools/configuration/overview This JSONC example demonstrates a comprehensive configuration for Fallow, including entry points, ignore patterns, rules, and more. It allows for detailed customization of project analysis. ```jsonc { "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "entry": ["src/workers/*.ts", "scripts/*.ts"], "ignorePatterns": ["**/*.generated.ts", "**/*.d.ts"], "ignoreDependencies": ["autoprefixer", "@types/node"], "ignoreExports": [ { "file": "src/public-api.ts", "exports": ["*"] } ], "ignoreExportsUsedInFile": true, "publicPackages": ["@myorg/sdk"], "dynamicallyLoaded": ["src/plugins/**/*.ts"], "rules": { "unused-files": "error", "unused-exports": "warn", "unused-types": "off", // Opt-in API hygiene check; default is "off" "private-type-leaks": "warn", "unresolved-imports": "error" }, "duplicates": { "mode": "mild", "minTokens": 50, "minLines": 5, "threshold": 10 }, "health": { "maxCyclomatic": 20, "maxCognitive": 15, "ignore": ["**/*.generated.ts"] }, "audit": { "gate": "new-only" }, "boundaries": { "preset": "bulletproof" }, "production": false } ``` -------------------------------- ### Install Fallow with pnpm Source: https://docs.fallow.tools/installation Install Fallow globally using pnpm. ```bash pnpm add -g fallow ``` -------------------------------- ### Start Fallow MCP Server with Custom Binary Path Source: https://docs.fallow.tools/integrations/mcp Start the `fallow-mcp` server while specifying a custom path to the Fallow binary using the `FALLOW_BIN` environment variable. ```bash FALLOW_BIN=/usr/local/bin/fallow fallow-mcp ``` -------------------------------- ### Fallow Coverage Setup with Yes, JSON, and Explain Flags Source: https://docs.fallow.tools/cli/coverage Generates JSON output for setup instructions, including a '_meta' block with detailed field definitions and warnings. This provides comprehensive information for agent-based processing. ```bash fallow coverage setup --yes --json --explain ``` -------------------------------- ### Install Fallow Source: https://docs.fallow.tools/analysis/file-types Install the Fallow package using npm. ```bash npm install fallow ``` -------------------------------- ### Run Fallow CLI without Installation Source: https://docs.fallow.tools/ Execute the Fallow CLI directly using npx without requiring a prior installation. This is the recommended starting point for initial runs as it requires no configuration. ```bash npx fallow ``` -------------------------------- ### Health Configuration Example Source: https://docs.fallow.tools/configuration/overview Example of how to configure health-related settings such as maximum cyclomatic complexity, cognitive complexity, and CRAP score. ```json { "health": { "maxCyclomatic": 20, "maxCognitive": 15, "maxCrap": 30, "crapRefactorBand": 5, "ignore": ["**/*.generated.ts", "src/legacy/**"], "suggestInlineSuppression": true } } ``` -------------------------------- ### Install Fallow Skills for Windsurf Source: https://docs.fallow.tools/integrations/agent-skills Clone the Fallow skills repository into the Windsurf skills directory. ```bash git clone https://github.com/fallow-rs/fallow-skills.git ~/.codeium/windsurf/skills/fallow-skills ``` -------------------------------- ### Install Fallow MCP Source: https://docs.fallow.tools/integrations/mcp Install the Fallow MCP server using Cargo or download a pre-built binary from GitHub Releases. ```bash cargo install fallow-mcp ``` -------------------------------- ### Install Fallow Skills for Gemini CLI Source: https://docs.fallow.tools/integrations/agent-skills Install Fallow skills using the Gemini CLI command. ```bash gemini skills install https://github.com/fallow-rs/fallow-skills.git ``` -------------------------------- ### Example MCP Request Source: https://docs.fallow.tools/integrations/mcp An example request to the MCP server for analysis, specifying production mode and issue types. ```json { "tool": "analyze", "arguments": { "production": true, "issue_types": ["unused-exports", "unused-files"] } } ``` -------------------------------- ### Install Fallow Skills for Cursor Source: https://docs.fallow.tools/integrations/agent-skills Clone the Fallow skills repository into the Cursor skills directory. ```bash git clone https://github.com/fallow-rs/fallow-skills.git ~/.cursor/skills/fallow-skills ``` -------------------------------- ### Install Fallow Skills for GitHub Copilot Source: https://docs.fallow.tools/integrations/agent-skills Clone the Fallow skills repository into the .github/skills directory for GitHub Copilot. ```bash git clone https://github.com/fallow-rs/fallow-skills.git .github/skills/fallow-skills ``` -------------------------------- ### Dry Run Output Example Source: https://docs.fallow.tools/analysis/auto-fix An example of the output from a dry run, showing which exports and dependencies would be removed. This helps in understanding the scope of the fixes. ```bash $ fallow fix --dry-run Would remove export from src/components/Card/index.ts:1 `CardFooter` Would remove export from src/providers/trpc-provider/index.tsx:12 `TRPCProvider` Would remove export from src/server/jobs/queue.ts:61 `enqueueJobDelayed` Would remove export from src/server/jobs/queue.ts:206 `sweepStuckProcessingJobs` Would remove export from src/server/jobs/queue.ts:276 `getDeadLetterJobs` Would remove `@trpc/react-query` from dependencies 6 fixes available (5 exports, 1 dependency). Run without --dry-run to apply. ``` -------------------------------- ### Fix Configuration Example Source: https://docs.fallow.tools/configuration/overview Example of configuring the 'fallow fix' command, specifically for handling preceding comments above removed pnpm catalog entries. ```json { "fix": { "catalog": { "deletePrecedingComments": "auto" } } } ``` -------------------------------- ### Example Output of Fallow Fix Source: https://docs.fallow.tools/cli/fix This shows the typical output when running `fallow fix`, including a summary of changes and a confirmation prompt. ```bash $ fallow fix Would remove export from src/components/Card/index.ts:1 `CardFooter` Would remove export from src/providers/trpc-provider/index.tsx:12 `TRPCProvider` Would remove export from src/server/jobs/queue.ts:61 `enqueueJobDelayed` Would remove export from src/server/jobs/queue.ts:206 `sweepStuckProcessingJobs` Would remove export from src/server/jobs/queue.ts:276 `getDeadLetterJobs` Would remove `@trpc/react-query` from dependencies 6 changes to apply. Proceed? [y/N] y ✓ Applied 6 fixes (5 exports, 1 dependency) ``` -------------------------------- ### Fallow CLI Threshold Example Source: https://docs.fallow.tools/explanations/duplication Demonstrates the output of the fallow CLI when checking duplication against a specified threshold. ```text Duplication: 19.4% (27,255 duplicated lines across 398 files, exceeds 15% threshold) Found 1,184 clone groups, 2,959 instances (0.23s) ✗ ``` -------------------------------- ### Run All Fallow Analyses in CI Source: https://docs.fallow.tools/integrations/ci Execute all Fallow analyses without needing an explicit installation step. ```bash # Run all analyses (no install needed) npx fallow --format compact ``` -------------------------------- ### Install Fallow Skills for Amp Source: https://docs.fallow.tools/integrations/agent-skills Clone the Fallow skills repository into the Amp agents skills directory. ```bash git clone https://github.com/fallow-rs/fallow-skills.git ~/.config/agents/skills/fallow-skills ``` -------------------------------- ### Fallow Coverage Setup with Non-Interactive Flag Source: https://docs.fallow.tools/cli/coverage Runs the setup flow non-interactively, printing instructions instead of prompting. This is useful for CI or agent workflows. ```bash fallow coverage setup --non-interactive ``` -------------------------------- ### Print Example Telemetry Payload Source: https://docs.fallow.tools/cli/telemetry Display a documented example payload, including the purpose of each field. This helps in understanding the structure and content of telemetry events. ```bash fallow telemetry inspect --example # print an example payload + field purposes ``` -------------------------------- ### Install Fallow Node.js Bindings Source: https://docs.fallow.tools/integrations/node-bindings Install the necessary package using npm. This package includes platform-specific binaries for macOS, Linux, and Windows, requiring Node.js 18 or newer. ```bash npm install @fallow-cli/fallow-node ``` -------------------------------- ### Parallel Parse Timing Example Source: https://docs.fallow.tools/analysis/debugging This example shows the output format for parallel parse timing, indicating wall-clock time versus summed CPU time across cores. A significantly larger CPU time suggests a CPU-bound stage. ```bash │ parse/extract: 382ms (21033 modules) (parallel: ~594ms CPU) ``` -------------------------------- ### Example `fallow dupes` output with semantic mode Source: https://docs.fallow.tools/explanations/duplication This example shows the output of the `fallow dupes` command when run in semantic mode, highlighting a clone group with its line count, instance count, and specific file locations. It also indicates renamed identifiers. ```text ● Clone group (196 lines, 2 instances) [semantic match] src/lib/dutch-holidays.ts:193-388 src/lib/dutch-holidays.ts:389-584 Renamed: holidays2024→holidays2025, year2024→year2025 ``` -------------------------------- ### Initial Fallow Scan Source: https://docs.fallow.tools/adoption Run this command from your project root to get a comprehensive overview of your codebase's adherence to Fallow policies. ```bash npx fallow ``` -------------------------------- ### Install Fallow Skills for OpenAI Codex Source: https://docs.fallow.tools/integrations/agent-skills Clone the Fallow skills repository into the agents skills directory for OpenAI Codex. ```bash git clone https://github.com/fallow-rs/fallow-skills.git ~/.agents/skills/fallow-skills ``` -------------------------------- ### Install Fallow Coverage Sidecar Source: https://docs.fallow.tools/cli/coverage Use this command to install the fallow coverage sidecar if it is missing. This command is suggested by the setup process. ```bash pnpm add -D @fallow-cli/fallow-cov ``` -------------------------------- ### Initialize Fallow Configuration Source: https://docs.fallow.tools/configuration/overview Use the 'fallow init' command to create a configuration file. Specify '--toml' to generate a TOML file instead of the default JSONC. ```bash fallow init # Creates .fallowrc.json fallow init --toml # Creates fallow.toml ``` -------------------------------- ### List Project Information (JSON Output) Source: https://docs.fallow.tools/integrations/mcp Display project information, including plugins, entry points, and file count, in JSON format. ```bash fallow list --format json ``` -------------------------------- ### Fallow Health Command Example Source: https://docs.fallow.tools/explanations/health Example of how to run the Fallow health command to get file scores, sorted by triage concern. This command helps identify files needing attention based on their health metrics. ```bash fallow health --file-scores --top 5 theme={null} ``` -------------------------------- ### Generated Recipe for Collecting Coverage Source: https://docs.fallow.tools/cli/coverage This is a typical recipe for collecting coverage, outlining steps from removing old dumps to running the setup command. ```text 1. Remove any old dump directory: rm -rf ./coverage 2. Build the app 3. Start the app with NODE_V8_COVERAGE=./coverage ... 4. Exercise the routes or jobs you care about 5. Stop the app and run: fallow coverage setup ``` -------------------------------- ### List Entry Points Source: https://docs.fallow.tools/cli/list Lists all discovered entry points in the project, along with the plugin that identified each one. Useful for understanding application startup and module loading. ```bash $ fallow list --entry-points Found 42 entry points src/app/layout.tsx (Plugin: nextjs) src/app/page.tsx (Plugin: nextjs) src/instrumentation.ts (Plugin: nextjs) src/proxy.ts (Plugin: nextjs) src/lib/utils.test.ts (Plugin: vitest) e2e/auth.setup.ts (Plugin: playwright) .storybook/main.ts (Plugin: storybook) drizzle.config.ts (Plugin: drizzle) scripts/db-migrate.ts (PackageJsonScript) scripts/db-seed.ts (PackageJsonScript) ... ``` -------------------------------- ### Install Fallow with Cargo Source: https://docs.fallow.tools/installation Install Fallow using Cargo if you have a Rust toolchain set up. ```bash cargo install fallow-cli ``` -------------------------------- ### Initialize Fallow Configuration with TOML format Source: https://docs.fallow.tools/cli/init Generate a fallow.toml configuration file instead of the default .fallowrc.json using the --toml flag. ```bash fallow init --toml ``` -------------------------------- ### Verify Fallow Installation Source: https://docs.fallow.tools/installation Check if Fallow is installed correctly by running this command to display the version number. ```bash fallow --version ``` -------------------------------- ### Initialize Fallow Configuration Source: https://docs.fallow.tools/adoption Run this command if you do not have a Fallow configuration file. It auto-detects project structure and generates a starting config, also adding .fallow/ to .gitignore. ```bash fallow init ``` -------------------------------- ### Re-Export Cycle Reporting Example Source: https://docs.fallow.tools/explanations/dead-code Example output format for re-export cycles, indicating the files involved in the cycle. ```text Re-Export Cycles (Architecture) src/api/index.ts Cycle (2 files): - src/api/index.ts ``` -------------------------------- ### Adopt Fallow in Existing Repository Prompt Source: https://docs.fallow.tools/integrations/agent-skills This self-contained prompt guides an agent through the process of adopting Fallow in an existing repository. It outlines a step-by-step procedure for full-repo analysis, issue fixing, and setting up Fallow as a PR gate. Use this for agents without skill or MCP support. ```text Adopt Fallow in this repository. Goal: - use full-repo analysis first (`fallow`, `fallow dead-code`, `fallow dupes`, `fallow health`), not `fallow audit` - fix real dead code, duplication, and complexity issues in code - model intentional exceptions with the narrowest correct mechanism - end with no functions above the repo's chosen health thresholds, or a consciously widened threshold with written justification - then set up `fallow audit` as a PR gate Process: 1. Run `npx fallow`, then `npx fallow dead-code`, `npx fallow dupes`, and `npx fallow health`. Use `--format json` for structured output. 2. If no config exists, run `fallow init` and create a minimal repo policy. 3. Fix high-confidence issues first: - unresolved imports - unlisted dependencies - unused files (sanity-check with `fallow list --entry-points`) - unused dependencies 4. For each remaining finding, choose one path: - fix it in code (preferred) - model it in config - add a narrow inline exception only if it is truly one-off 5. Match reasons to mechanisms: - external API: `@public` / `@internal` / `@beta` / `@alpha` JSDoc tags, or `publicPackages` - runtime or framework entry point: `entry`, `dynamicallyLoaded`, plugin-aware config - generated code: `ignorePatterns`, `health.ignore` - intentionally retained dependency: `ignoreDependencies` - intentional unused export: `@expected-unused` (preferred over inline comments because it self-cleans) - one-off false positive: `fallow-ignore-next-line` - repo-wide policy: `rules`, `health`, duplication settings, `overrides` 6. Prefer config-level modeling over repeated suppression. 7. Keep every exception narrow and explain why it exists in a commit message. 8. Re-run Fallow after each batch until the repo is clean under the chosen policy. 9. Only after repo cleanup, run `npx fallow audit` and wire it into CI. At the end, report: - code changes - config changes - exceptions added and why - anything left - the final commands and outputs that show the repo is clean ``` -------------------------------- ### Install Fallow Skills for Claude Code Source: https://docs.fallow.tools/integrations/agent-skills Install the Fallow skills package for Claude Code using the plugin marketplace. ```bash /plugin marketplace add fallow-rs/fallow-skills /plugin install fallow-skills@fallow-rs/fallow-skills ``` -------------------------------- ### Example of Static Analysis Findings Source: https://docs.fallow.tools/explanations/static-vs-runtime These are concrete examples of issues that static analysis can confidently identify based on the module graph. ```text An `export function computeTax` that no file imports, directly or through a barrel. A file at `src/server/jobs/worker.ts` that isn't reached from any entry point, script, or test. A tight cycle: `a.ts -> b.ts -> c.ts -> a.ts`. A 60-LOC function with cyclomatic 28 and cognitive 34, colocated with a file that has churned 40 times in the last 90 days. ``` -------------------------------- ### Fallow Flags JSON Output Example Source: https://docs.fallow.tools/cli/flags Example of the JSON output generated by `fallow flags --format json`. ```json { "schema_version": 3, "version": "2.90.0", "elapsed_ms": 116, "feature_flags": [], "total_flags": 0 } ``` -------------------------------- ### List Entry Point Files Source: https://docs.fallow.tools/cli/list Use `fallow list --entry-points` to show only the entry point files identified by fallow. This helps confirm that fallow is correctly recognizing the starting points of your application or library. ```bash fallow list --entry-points ``` -------------------------------- ### Remove Unused Dependencies Source: https://docs.fallow.tools/adoption Clean up packages that have been installed but are not being used in your project. This reduces noise in subsequent analysis steps and speeds up package installations. ```bash npx fallow dead-code --unused-deps ``` -------------------------------- ### Example MCP Response Source: https://docs.fallow.tools/integrations/mcp An example response from the MCP server detailing unused exports, including source file path and line number. ```json { "schema_version": 3, "version": "2.90.0", "elapsed_ms": 42, "total_issues": 1, "unused_exports": [ { "path": "src/utils/format.ts", "export_name": "formatCurrency", "is_type_only": false, "line": 12, "col": 0, "span_start": 280, "is_re_export": false } ] } ``` -------------------------------- ### Example Fallow Configuration Source: https://docs.fallow.tools/adoption A sample Fallow configuration file defining ignored patterns and rule severities. Rules not listed inherit their defaults. ```json { "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "ignorePatterns": ["**/*.generated.ts", "**/*.d.ts"], "rules": { "unresolved-imports": "error", "unlisted-dependencies": "error", "unused-exports": "warn" } } ``` -------------------------------- ### Fallow Configuration (TOML) Source: https://docs.fallow.tools/quickstart Example of a Fallow configuration file in TOML format, defining entry points, ignore patterns, and rule severities. ```toml [entry] "src/workers/*.ts" "scripts/*.ts" ignorePatterns = ["**/*.generated.ts"] [rules] unused-files = "error" unused-exports = "warn" unused-types = "off" ``` -------------------------------- ### Preview Claude Code Hook Installation Source: https://docs.fallow.tools/integrations/claude-hooks Performs a dry run of the Claude Code hook installation to preview changes without modifying files. ```bash fallow hooks install --target agent --dry-run ``` -------------------------------- ### Activate Trial License and Setup Runtime Coverage Source: https://docs.fallow.tools/analysis/runtime-coverage Activate a trial license for fallow and set up runtime coverage collection. This involves activating a trial with your email and then configuring the coverage collection. ```bash fallow license activate --trial --email you@company.com fallow coverage setup fallow health --runtime-coverage ./coverage ``` -------------------------------- ### Typical Fallow CLI Coverage Flow Source: https://docs.fallow.tools/cli/coverage Demonstrates the typical flow for activating a trial, setting up coverage, and analyzing it. ```bash fallow license activate --trial --email you@company.com fallow coverage setup # Follow docs/collect-coverage.md, then: fallow coverage setup ``` ```bash fallow health --runtime-coverage ./coverage ``` -------------------------------- ### Install Fallow VS Code Extension Source: https://docs.fallow.tools/quickstart Install the Fallow VS Code extension to enable real-time diagnostics and Code Lens features directly within your editor. ```bash code --install-extension fallow-rs.fallow-vscode ``` -------------------------------- ### Grouped JSON Output Example Source: https://docs.fallow.tools/cli/global-flags Demonstrates the JSON output structure when using the --group-by flag with the 'owner' mode. Useful for programmatic analysis of grouped issues. ```json { "kind": "dead-code-grouped", "grouped_by": "owner", "total_issues": 12, "groups": [ { "key": "@frontend-team", "total_issues": 8, "unused_files": [], "unused_exports": [] }, { "key": "@backend-team", "total_issues": 4, "unused_exports": [] } ] } ``` -------------------------------- ### Fallow Unused Exports Report Example Source: https://docs.fallow.tools/explanations/fallow-vs-linters Example output from Fallow's unused exports analysis, detailing the files and specific exports that are not being imported elsewhere in the project. ```text ● Unused exports (3) src/components/Card/index.ts :1 CardFooter src/utils/format.ts :14 formatCurrency :28 formatDate ``` -------------------------------- ### JSON _meta Object Example Source: https://docs.fallow.tools/explanations/health This JSON output includes a _meta object with documentation links and metric details. It is generated when the --explain flag is used. ```json { "schema_version": 3, "_meta": { "docs": "https://docs.fallow.tools/explanations/health", "metrics": { "maintainability_index": { "name": "Maintainability Index", "description": "Composite score: 100 - (complexity_density × 30) - ...", "range": "[0, 100]", "interpretation": "higher is better; <40 poor, 40–70 moderate, >70 good" } } } } ``` -------------------------------- ### Install Claude Code Hooks Globally Source: https://docs.fallow.tools/integrations/claude-hooks Installs Claude Code hooks globally for use across all repositories. The settings file is placed in ~/.claude/settings.json and the hook script in ~/.claude/hooks/fallow-gate.sh. ```bash fallow hooks install --target agent --user ``` -------------------------------- ### Preview migration with --dry-run Source: https://docs.fallow.tools/cli/migrate Use the --dry-run flag to preview the generated fallow configuration without writing any changes to disk. ```bash fallow migrate --dry-run ``` -------------------------------- ### GitHub Actions Job Summary Example Source: https://docs.fallow.tools/integrations/ci Example of a Fallow job summary in GitHub Actions, showing found issues categorized by type (Dead Code, Duplication, Complexity). ```bash fallow — 8 issues found Dead Code (3 issues) | Type | File | Symbol | Line | |------|------|--------|------| | unused-export | src/utils/format.ts | formatCurrency | 12 | | unused-export | src/utils/format.ts | formatPercentage | 28 | | unused-file | src/legacy/oldApi.ts | — | — | Duplication (3 clone groups, 1.8%) | Files | Lines | Tokens | |-------|-------|--------| | src/tax/utils.ts ↔ src/savings/utils.ts | 25 | 92 | Complexity (2 hotspots) | File | Function | Cyclomatic | Cognitive | |------|----------|------------|-----------| | src/server/router.ts:42 | handleRequest | 28 | 34 | Completed in 48ms ``` -------------------------------- ### Dry Run Output Example Source: https://docs.fallow.tools/migration/from-knip This output shows a sample of what `fallow migrate --dry-run` might display, indicating detected Knip configurations, migrated settings, and any limitations or warnings for fields that cannot be automatically converted. ```bash Detected knip config: knip.json Migrating settings: entry → entry: ["src/index.ts", "src/cli.ts"] ignore → ignorePatterns: ["**/*.generated.ts"] ignoreDeps → ignoreDependencies: ["@types/node"] ⚠ Cannot migrate: ignoreBinaries → not applicable in fallow Would write: .fallowrc.json Run without --dry-run to write the config. ``` -------------------------------- ### Fallow Health Command Example Source: https://docs.fallow.tools/explanations/health Example of running the Fallow health command to identify refactoring targets. It displays a prioritized list of files with associated health categories and recommendations. ```text fallow health --targets --top 5 theme={null} ● Refactoring targets (5) 92.3 src/core/processor.ts churn+complexity · high Actively-changing file with growing complexity — stabilize before adding features 71.2 src/utils/helpers.ts high impact · high Split high-impact file — 15 dependents amplify every change 55.8 src/legacy/old-api.ts dead code · low Remove 8 unused exports to reduce surface area (73% dead) 52.0 src/graph/resolver.ts circular dep · medium Break import cycle — 8 files depend on this, changes cascade through the cycle 41.8 src/components/Dashboard.tsx complexity · high Extract renderMetrics (cognitive: 45) and renderFilters (cognitive: 32) into smaller functions Prioritized refactoring recommendations based on complexity, churn, and coupling signals — https://docs.fallow.tools/explanations/health#refactoring-targets ``` -------------------------------- ### Configuration-Level Suppression Example Source: https://docs.fallow.tools/configuration/suppression Shows how to use a configuration file (`.fallowrc.json`) to suppress issues globally or for specific file patterns. This is the recommended approach for managing widespread suppressions. ```json // .fallowrc.json { "ignoreExports": [ { "file": "src/components/**/*.tsx", "exports": ["*"] } ] } ``` -------------------------------- ### Example Snapshot JSON Structure Source: https://docs.fallow.tools/cli/health This is an example of the JSON structure generated by the `--save-snapshot` command. It includes schema version, project details, vital signs metrics, and raw counts. ```json { "snapshot_schema_version": 8, "version": "2.90.0", "timestamp": "2026-03-25T14:30:00Z", "git_sha": "a1b2c3d", "git_branch": "main", "shallow_clone": false, "vital_signs": { "dead_file_pct": 4.2, "dead_export_pct": 12.8, "avg_cyclomatic": 3.1, "critical_complexity_pct": 1.2, "p90_cyclomatic": 11, "duplication_pct": null, "hotspot_count": 5, "hotspot_top_pct_count": 3, "maintainability_avg": 72.4, "maintainability_low_pct": 9.1, "unused_dep_count": 3, "unused_deps_per_k_files": 11.5, "circular_dep_count": 1, "circular_deps_per_k_files": 3.8, "unit_size_profile": { "low_risk": 82.1, "medium_risk": 11.4, "high_risk": 4.3, "very_high_risk": 2.2 }, "functions_over_60_loc_per_k": 22.0, "unit_interfacing_profile": { "low_risk": 95.6, "medium_risk": 3.8, "high_risk": 0.5, "very_high_risk": 0.1 }, "p95_fan_in": 8, "coupling_high_pct": 2.3 }, "counts": { "dead_files": 11, "total_files": 262, "dead_exports": 48, "total_exports": 375, "unused_deps": 3, "circular_deps": 1 } } ``` -------------------------------- ### Markdown Health Report Example Source: https://docs.fallow.tools/cli/health Example of a markdown-formatted health report showing high complexity functions and file health scores. This output is suitable for direct use or integration into PR comments. ```markdown ## Fallow Health: 24 functions above threshold ### High complexity functions (2 shown) | File | Function | Line | Cyclomatic | Cognitive | Lines | |:-----|:---------|-----:|-----------:|----------:|------:| | src/diff/index.js | diff | 48 | 67 | 138 | 290 | | src/diff/index.js | diffElementNodes | 381 | 63 | 105 | 200 | ### File health scores (2 files) | File | Maintainability | LOC | Fan-in | Fan-out | Dead code | Density | |:-----|---:|---:|-------:|--------:|----------:|--------:| | src/legacy/handler.ts | 52.3 | 312 | 2 | 18 | 45% | 0.38 | | src/diff/index.js | 68.4 | 847 | 3 | 12 | 0% | 0.89 | ``` -------------------------------- ### Output migration as TOML Source: https://docs.fallow.tools/cli/migrate Specify the --toml flag to output the migrated configuration in TOML format as fallow.toml. ```bash fallow migrate --toml ```