Expand description
The unified cccc CLI.
One binary measures Cognitive Complexity and Cyclomatic Complexity across
every bundled language. A file is routed to the right front-end by its
extension (see lang), so a single run can analyze a mixed-language tree.
Recurring options can be baked into a cccc.toml config file (see
config); CLI flags always take precedence over it.
Everything common to the languages lives here: argument parsing, config
resolution, file discovery, parallel analysis, the threshold/--min/--top
logic, and output rendering. Each language supplies only how to analyze one
file and its default extensions, via the lang::LANGUAGES registry.
§Exit codes
run returns a process exit code with a consistent meaning:
0— success (including an existing input path that simply contains no matching files: “nothing to analyze” is not an error).1— a--max-cognitive/--max-cyclomaticthreshold was exceeded (the CI gate).2— unable to proceed: a given path does not exist, a config/--langvalue was invalid, or the worker pool could not be created. (clap’s own usage errors also exit2.)
Modules§
Functions§
- run
- Run the CLI end to end and return a process exit code.
Type Aliases§
- Analyze
Fn - Analyze one file’s source into a
FileReport. Implemented per language by the relevant adapter (e.g.cccc_es::analyze_source).