# 使用 Homebrew, MacPorts 安装 lizard-analyzer

查看 lizard-analyzer 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:lizard-analyzer
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install lizard-analyzer
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lizard
```

  证据: MacPorts ports tree: archivers/lizard/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:lizard-analyzer
- **软件包管理器:** Homebrew
- **版本:** 1.23.0
- **来源摘要:** Extensible Cyclomatic Complexity Analyzer
- **主页:** <https://github.com/terryyin/lizard>
- **最后更新:** 2026-06-03T09:53:20Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- lizard (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.23.0
## 项目历史与用法

Lizard is a Python-based cyclomatic-complexity and static-analysis command-line tool. Its package history is mildly confusing because Homebrew names this formula lizard-analyzer while the executable is lizard, avoiding collision with a separate compression utility also named lizard.

### 项目历史

The terryyin/lizard repository was created on GitHub in June 2012. The README describes the tool as an extensible cyclomatic complexity analyzer for many programming languages, with an emphasis on scanning C/C++ without needing complete header search paths and Java without resolving all imports.

Over time the tool expanded beyond basic cyclomatic complexity counts into duplicate-code detection and other static-code metrics. Its language list in the README spans C/C++, Java, Python, JavaScript/TypeScript, Go, Rust, Swift, Solidity, Zig, and other languages.

### 采用历史

The README documents both direct script usage and installation through pip, which made Lizard convenient for CI jobs and local quality gates before language-specific static-analysis suites were always present in package-manager workflows.

Homebrew packaging under lizard-analyzer gives macOS users a CLI install path while avoiding the formula-name collision with the unrelated lizard compressor.

### 使用方式

Lizard is commonly used as a lightweight metric pass over source trees: run lizard on a path, optionally select languages, exclude paths, and fail builds when complexity or parameter-count thresholds are exceeded.

Because it intentionally measures how complex code looks rather than trying to fully compile or semantically resolve a project, it fits quick scans, pre-commit checks, and repository audits where low setup cost matters.

### 为什么软件包爱好者会关心

The formula is a small example of package-manager disambiguation: the upstream project, command name, and common Python package name are lizard, but Homebrew has to call the formula lizard-analyzer because brew:lizard is already the compression tool.

It also shows how scripting-language tools enter Unix package managers even when pip installation is available, because packaging the CLI gives users a repeatable system-level binary without managing a Python environment by hand.

### 时间线

- 2012: terryyin/lizard repository created on GitHub.
- 2026: GitHub releases 1.20.0 and 1.23.0 were published for the analyzer.
- 2026: Homebrew formula lizard-analyzer identified the executable as lizard and the package as an extensible cyclomatic complexity analyzer.

### Related projects

- The package sits near linters, static analyzers, and code-metric tools such as cloc, radon, cppcheck, and language-specific complexity plugins.
- It is unrelated to brew:lizard, the compression utility packaged in the same batch.

### 来源

- <https://api.github.com/repos/terryyin/lizard>
- <https://formulae.brew.sh/formula/lizard-analyzer>
- <https://github.com/terryyin/lizard>
- <https://github.com/terryyin/lizard/releases>
- <https://raw.githubusercontent.com/terryyin/lizard/master/README.rst>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- MacPorts - lizard: installed executable or alias match | MacPorts ports tree: archivers/lizard/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/lizard-analyzer.yml](https://github.com/mxcl/pkgdb/blob/main/combined/lizard-analyzer.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
