{"id":17234,"library":"fta-cli","title":"Fast TypeScript Analyzer CLI","description":"FTA (Fast TypeScript Analyzer) is a static analysis tool designed for TypeScript and JavaScript code, implemented in Rust for superior performance. It utilizes the SWC parser to efficiently analyze codebases and generate metrics concerning complexity and maintainability. The current stable version is 3.0.0, which features upgraded SWC libraries for enhanced accuracy in operand/operator counting and includes support for modern JavaScript/TypeScript syntax such as `import with`. The project exhibits an active release cadence, with frequent updates and major versions, reflecting continuous development. A key differentiator is its exceptional speed, capable of processing up to 1600 files per second on typical hardware, making it highly suitable for large-scale projects. It provides clear, actionable analytics to help developers identify and address potential maintainability issues.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/sgb-io/fta","tags":["javascript","typescript"],"install":[{"cmd":"npm install fta-cli","lang":"bash","label":"npm"},{"cmd":"yarn add fta-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add fta-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"While primarily a CLI, this package ships TypeScript types. `FtaAnalysisOptions` might be used for programmatic configuration when integrating the core logic or interpreting results.","symbol":"FtaAnalysisOptions","correct":"import type { FtaAnalysisOptions } from 'fta-cli'"},{"note":"Represents a single row of the analysis output, containing metrics like line count, FTA score, and assessment. Useful for typing programmatic handling of CLI output.","symbol":"FtaReportEntry","correct":"import type { FtaReportEntry } from 'fta-cli'"},{"note":"A type representing the assessment category (e.g., 'OK', 'Needs improvement'). For robust type-checking when processing FTA results.","symbol":"FtaAssessment","correct":"import type { FtaAssessment } from 'fta-cli'"},{"note":"The `fta-cli` package is primarily a command-line interface. There is no direct JavaScript/TypeScript function to import and run its CLI commands programmatically within your code. Instead, use `npx fta-cli` or `child_process.spawn('fta-cli', ...)`.","wrong":"import { ftaCliCommand } from 'fta-cli'","symbol":"ftaCliCommand"}],"quickstart":{"code":"npx fta-cli ./src --format table --exclude-under 10\n\n# Example of running against a specific file or directory\nnpx fta-cli my-project/index.ts\n\n# To analyze your current project directory\nnpx fta-cli .","lang":"javascript","description":"Demonstrates the basic usage of the `fta-cli` command-line tool to analyze a project directory or specific files."},"warnings":[{"fix":"Review your analysis output and adjust any custom thresholds or baseline expectations for FTA scores to account for the updated calculation methodology.","message":"Version 3.0.0 includes an upgrade to underlying SWC libraries. This results in material changes to how operands and operators are counted, leading to different FTA scores compared to previous versions. It may require recalibrating thresholds or expectations for existing projects.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Re-run analysis on your codebase with v2.0.0+ to establish new baselines for Halstead and FTA scores. Do not directly compare scores from v1.x with v2.x or v3.x.","message":"Version 2.0.0 introduced corrections to the Halstead calculations. This change materially affects the reported Halstead and FTA scores, making direct comparison with results from v1.x inaccurate.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"If you relied on comments being included in scores or need to analyze very small files, explicitly set `--include-comments true` or `--exclude-under 0` when running the CLI. The `output_limit` option's behavior also changed in v1.0.0, now only affecting `table` format output.","message":"In v1.0.0, the `include_comments` option's default value changed to `false`, meaning comments are no longer included in scoring by default. Also, the `exclude_under` option was added with a default of `6`, excluding files under 6 lines of code.","severity":"breaking","affected_versions":">=1.0.0 <2.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure you run `npx fta-cli ...` to execute the package without global installation, or install it globally with `npm install -g fta-cli` if preferred.","cause":"`fta-cli` is not installed globally or `npx` cannot locate it.","error":"Error: Command not found: fta-cli"},{"fix":"Double-check the provided path. Ensure it's an existing directory or file, and that your current working directory is correct if using relative paths.","cause":"The directory or file path provided to `fta-cli` does not exist on your file system.","error":"Error: The specified path does not exist: /path/to/nonexistent/project"},{"fix":"Update `fta-cli` to the latest version. Version 3.0.0 and above significantly improve support for modern syntax due to SWC upgrades. If the issue persists, report it to the `fta-cli` GitHub repository.","cause":"`fta-cli` encountered modern or non-standard syntax that its underlying SWC parser version does not yet support.","error":"Failed to parse TypeScript/JavaScript file: Syntax Error..."}],"ecosystem":"npm","meta_description":null}