A JavaScript complexity analysis library that calculates maintainability, cyclomatic complexity, and Halstead metrics from ASTs.
escomplex is a JavaScript complexity analysis library that processes abstract syntax trees to calculate software metrics. It helps developers understand code quality by providing maintainability indexes, cyclomatic complexity, Halstead metrics, and dependency analysis. The tool identifies complex code areas that might be difficult to maintain or test.
JavaScript developers and teams who need to monitor code quality, technical debt, and maintainability in their projects. It's particularly useful for code reviewers, architects, and developers working on large codebases.
escomplex provides comprehensive, configurable complexity metrics directly from ASTs with detailed per-function and project-wide analysis. Unlike simpler tools, it offers dependency analysis between modules and customizable calculation options for different coding styles.
Software complexity analysis of JavaScript-family abstract syntax trees.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a wide range of metrics including maintainability index, cyclomatic complexity, and Halstead measures, offering a holistic view of code quality. Evidence from README: Detailed result formats cover sloc, params, cyclomatic density, and Halstead effort, bugs, and time.
Allows customization of complexity calculations for logical OR, switch cases, for-in loops, and try-catch blocks via options. README shows options like logicalor and switchcase to tailor analysis to coding styles.
Analyzes dependencies between modules and computes project-wide metrics like adjacency and visibility matrices. README specifies that for multiple modules, it returns first-order density, change cost, and core size.
Delivers granular metrics per function, including line numbers and parameter counts, aiding in pinpointing complex code. Evidence: Functions array in results includes sloc, cyclomatic, and Halstead data for each function.
Calculations like visibility matrix and core size can be expensive; README admits this with options like noCoreSize to skip them, indicating scalability issues for big codebases.
Tied to JavaScript ASTs, so it doesn't natively support other languages or syntaxes without extra parsers, and README doesn't mention TypeScript or modern ES modules explicitly.
Acts as a back-end library only, requiring integration with tools like complexity-report for user-friendly reports, which adds setup complexity compared to all-in-one solutions.