lizard
A code analyzer without caring the C/C++ header files. It works with Java, C/C++, JavaScript, Python, Ruby, Swift, Objective C. Metrics includes cyclomatic complexity number etc.
What it is and what it does
Lizard is a static code analyzer that measures cyclomatic complexity and other code metrics across many programming languages including C/C++, Java, Python, JavaScript, and others. It calculates lines of code without comments, cyclomatic complexity number, token count, and parameter count for each function, then reports functions exceeding configurable thresholds. It also performs copy-paste detection to identify duplicate code blocks.
The tool is designed to work without requiring complete header files or imports, making it practical for analyzing incomplete or complex codebases. It can output results in multiple formats (tabular, XML, CSV, HTML, Checkstyle) and supports filtering via .gitignore patterns or custom exclusion rules. You can run it as a standalone script or install it for full functionality, and it supports parallel analysis via configurable worker threads.
Use it for:
- Measure cyclomatic complexity in legacy codebases to identify functions needing refactoring.
- Detect copy-pasted code blocks across a project to consolidate duplicated logic.
- Generate HTML or XML reports for code quality dashboards and CI/CD pipeline integration.
- Enforce coding standards by setting thresholds for complexity, function length, and parameter count.
- Analyze multi-language projects (e.g., C++ backend + JavaScript frontend) in a single run.
- Identify overly complex functions during code review to guide refactoring priorities.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lizard analyzes code complexity and detects code clones across many programming languages, measuring cyclomatic complexity, lines of code, token count, and function parameters.
Yes. Lizard is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It solves a real problem—measuring code complexity across many languages without requiring complete build environments—and is suitable for both standalone use and CI/CD integration. The 2446 repository stars and top-5000 PyPI tier indicate solid community adoption.
Install
lizard on PyPI
pip
pip install lizarduv
uv add lizardpoetry
poetry add lizardInstalling lizard
Before you install
Low install friction with only two runtime dependencies (pygments and pathspec). The package is actively maintained with a recent release and 2446 repository stars, indicating stable, community-backed development.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install lizard
lizard mySource/
lizard -C 15 -a 5 mySource/ --xml
Requires python3.8 or above; early versions are not verified.
Verify before relying
- Whether the tool's copy-paste detection accuracy and performance scale well for very large codebases.
- Whether all listed language parsers are equally mature or if some are experimental.
- Performance characteristics when analyzing code with many threads enabled.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pygments, pathspec |
| Maintenance | actively maintained — 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,283,998/month — #4,113 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lizard-1.23.0-py2.py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
xenonXenon monitors Python code complexity by…
permissive · top 5,000 on PyPI
complexipyCalculates cognitive complexity scores for…
permissive · top 15,000 on PyPI
radonRadon computes code metrics from Python source…
permissive · top 5,000 on PyPI
flake8-cognitive-complexityA flake8 extension that checks Python code for…
permissive · top 15,000 on PyPI
mccabeMeasures cyclomatic complexity of Python…
permissive · top 1,000 on PyPI
mr-propermr. Proper is a static code analyzer that…
permissive · top 15,000 on PyPI
cognitive-complexityCalculates cognitive complexity scores for…
permissive · top 15,000 on PyPI
scan-buildRuns the Clang static analyzer on C/C++…
permissive · top 15,000 on PyPI
gdtoolkitGDScript parser, linter, formatter, and code…
permissive · top 15,000 on PyPI
pygountPygount counts source lines of code (SLOC)…
permissive · top 15,000 on PyPI