Automic VaultAutomic Vault

brew

Install gnu-complexity with Homebrew, apt, Nix, zypper

Measures complexity of C source. Version 1.13 via Homebrew; verified from local package data.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install gnu-complexity

local Homebrew formula metadata

Linux

Debian aptverified · 92%
sudo apt install complexity

Debian stable package indexes · complexity · source: deb.debian.org

Nixverified · 92%
nix profile install nixpkgs#complexity

nixpkgs package indexes · pkgs/by-name/co/complexity/package.nix · source: api.github.com

openSUSE zypperverified · 92%
sudo zypper install complexity

openSUSE Tumbleweed package metadata · complexity · source: download.opensuse.org

overview

Package summary

Measures complexity of C source

Commands and aliases

  • complexity
  • cx-vs-mc

history

Project history and usage

GNU Complexity is a small GNU static-analysis tool for measuring the complexity of C functions, designed as a more human-comprehension-oriented alternative to simple McCabe-style path counts.

Project history

The GNU Complexity manual documents version 0.4 as of May 2011 and describes a tool by Bruce Korb for analyzing C function complexity. Its rationale is explicit: McCabe-style scoring and `pmccabe` are useful for testing effort, but GNU Complexity tries to better rank functions that are difficult for humans to understand by considering length, nesting, switch bodies, and complicated boolean expressions.

Adoption history

GNU Complexity has a narrow adoption footprint compared with larger GNU developer tools. Its significance is in the code-review and maintenance niche: it gives C maintainers a command-line metric that can point to suspicious functions in unfamiliar code, estimate testing or comprehension effort, and produce sorted score tables and histograms.

How it is used

Practitioners run `complexity` over C source files to report procedure scores, line counts, source locations, and optional histograms. The manual's example runs the tool against its own source with a low threshold, illustrating use as a quick audit tool for ranking functions before refactoring or review.

Why package nerds care

For package nerds, GNU Complexity is interesting because it embodies a Unix-tool approach to maintainability: one command, text output, tunable thresholds, and a documented scoring model. It is useful in distributions as a lightweight companion to older tools such as `pmccabe` rather than as a large static-analysis framework.

Timeline

  • 2011: GNU Complexity web page and manual documented version 0.4.
  • 2011: Manual rationale compared GNU Complexity with `pmccabe` and explained its scoring model.

Related projects

  • `pmccabe` is the comparison point used throughout the GNU Complexity manual.
  • `unifdef` is discussed in the parsing model as a way to handle preprocessor-conditional source.

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 12 platform targets.
  • Installs with 1 runtime dependencies.
  • Build metadata lists 2 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
complexitycliglobal executable
cx-vs-mccliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version1.13
manager updated
local dataok
upstreamnot checked
latest detectednot detected

https://www.gnu.org/software/complexity/

install metadata

Package metadata

Package keybrew:gnu-complexity
Version1.13
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/gnu-complexity
Homepagehttps://www.gnu.org/software/complexity/
Repositoryhttps://git.savannah.gnu.org/cgit/complexity.git
Upstream docshttps://www.gnu.org/software/complexity/manual
LicenseGPL-3.0-or-later
Source archivehttps://ftpmirror.gnu.org/gnu/complexity/complexity-1.13.tar.xz
Dependenciesautogen
Build dependenciesautoconf, automake
Bottleavailable (on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, monterey, sonoma, ventura, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namegnu-complexity
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Debian apt92%

complexity 1.13-1+b1

tool for analyzing the complexity of C program functions

https://gnu.org/software/complexity

sudo apt install complexity
  • Section: devel
  • Architecture: amd64
  • Source Package: complexity
  • 2 dependencies
  • installed executable or alias match
  • Matched by: Complexity
Debian stable package indexes · deb.debian.org · Debian stable package indexes: complexity from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt92%

complexity-doc 1.13-1

tool for analyzing the complexity of C program (documentation)

https://gnu.org/software/complexity

sudo apt install complexity-doc
  • Section: doc
  • Architecture: all
  • Source Package: complexity
  • installed executable or alias match
  • Matched by: Complexity
Debian stable package indexes · deb.debian.org · Debian stable package indexes: complexity-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix92%

complexity

nix profile install nixpkgs#complexity
  • installed executable or alias match
  • Matched by: Complexity
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/co/complexity/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt92%

complexity 1.13-1

tool for analyzing the complexity of C program functions

https://gnu.org/software/complexity

sudo apt install complexity
  • Section: universe/devel
  • Architecture: amd64
  • 2 dependencies
  • installed executable or alias match
  • Matched by: Complexity
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: complexity from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt92%

complexity-doc 1.13-1

tool for analyzing the complexity of C program (documentation)

https://gnu.org/software/complexity

sudo apt install complexity-doc
  • Section: universe/doc
  • Architecture: all
  • Source Package: complexity
  • installed executable or alias match
  • Matched by: Complexity
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: complexity-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
zypper92%

complexity 1.13-1.7

C source code complexity computation utility

https://www.gnu.org/software/complexity/

sudo zypper install complexity
  • License: GPL-3.0-or-later
  • Category: Development/Tools/Other
  • Architecture: x86_64
  • Source Package: complexity
  • 4 dependencies
  • 1 provides
  • installed executable or alias match
  • Matched by: Complexity
openSUSE Tumbleweed package metadata · download.opensuse.org · openSUSE Tumbleweed package metadata: complexity from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment