# gnu-complexity を Homebrew, apt, Nix, zypper でインストール

gnu-complexity のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:gnu-complexity
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install gnu-complexity
```

  証拠: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install complexity
```

  証拠: Debian stable package indexes: complexity from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#complexity
```

  証拠: nixpkgs package indexes: pkgs/by-name/co/complexity/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install complexity
```

  証拠: openSUSE Tumbleweed package metadata: complexity from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## パッケージ情報

- **パッケージキー:** brew:gnu-complexity
- **パッケージマネージャ:** Homebrew
- **バージョン:** 1.13
- **ソース概要:** Measures complexity of C source
- **ホームページ:** <https://www.gnu.org/software/complexity/>
- **最終更新:** 2026-08-02T20:52:07+09:00
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- complexity (エイリアス)
- cx-vs-mc (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 1.13
## プロジェクトの歴史と使われ方

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.

### プロジェクトの歴史

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.

### 採用の歴史

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.

### 使われ方

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.

### パッケージ好きにとっての重要性

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.

### タイムライン

- 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.

### ソース

- <https://www.gnu.org/software/complexity/>
- <https://www.gnu.org/software/complexity/manual/complexity.html>


## セキュリティノート

narrow executable package without higher-risk signals.

- **Geiger リスク:** グリーン / 低
- narrow executable package without higher-risk signals

## 他のパッケージマネージャ記録

- Debian apt - complexity - 1.13-1+b1: installed executable or alias match | Debian stable package indexes: complexity from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for analyzing the complexity of C program functions | https://gnu.org/software/complexity
- Debian apt - complexity-doc - 1.13-1: installed executable or alias match | Debian stable package indexes: complexity-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for analyzing the complexity of C program (documentation) | https://gnu.org/software/complexity
- Nix - complexity: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/co/complexity/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - complexity - 1.13-1: installed executable or alias match | Ubuntu 24.04 LTS package indexes: complexity from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | tool for analyzing the complexity of C program functions | https://gnu.org/software/complexity
- Ubuntu apt - complexity-doc - 1.13-1: installed executable or alias match | Ubuntu 24.04 LTS package indexes: complexity-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | tool for analyzing the complexity of C program (documentation) | https://gnu.org/software/complexity
- zypper - complexity - 1.13-1.9: installed executable or alias match | openSUSE Tumbleweed package metadata: complexity from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | C source code complexity computation utility | https://www.gnu.org/software/complexity/


## Combined YAML source

View the package source record on GitHub. [combined/gnu-complexity.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gnu-complexity.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
