gitmyhub

cccc-action

Shell ★ 1 updated 8d ago

A GitHub composite action that installs the `cccc` complexity analyzer

A GitHub Actions add-on that installs and runs a code complexity checker so a project's CI pipeline can catch overly complicated code automatically.

ShellGitHub Actionsccccsetup: easycomplexity 2/5

cccc-action is a GitHub Actions add-on that installs and runs a code complexity checker called cccc inside a project's continuous integration pipeline. cccc itself is a separate tool that measures how complicated pieces of code are, using two well known measurements from software engineering called Cognitive Complexity and Cyclomatic Complexity, and it works across TypeScript, JavaScript, Rust, Go, and PHP code.

This action downloads the correct version of the cccc program for whichever operating system and processor type the CI job is running on, checks that the download matches its expected checksum for safety, and adds it to the system so it can be run as a command. If you tell the action which folder or files to look at, it will also run the complexity check right there in the workflow and can fail the build if code is too complicated according to rules you have set.

Rather than letting users configure complexity rules directly through GitHub Actions settings, the action deliberately pushes all of that configuration into a single file in the project itself, called cccc.toml. That file controls which languages to check, which files to skip, complexity limits that should fail a build, and more. The idea is to avoid the action and the underlying tool drifting out of sync as options change over time. There is also a caching feature: turning on one setting in that same config file lets the action reuse results from a previous run so unchanged files do not need to be rechecked every single time, which can make repeated runs several times faster on larger codebases.

The action also supports a simpler install-only mode, where it just puts the cccc binary on the system path and lets you run it yourself with whatever command line options you like, plus an escape hatch to pass extra raw options directly.

This tool is aimed at software developers and teams who want to enforce a complexity limit on their code as part of their GitHub Actions based CI setup. It supports Ubuntu, macOS, and Windows runners, and is released under the MIT license.

Where it fits