skillfed

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.

lizard v1.23.0 1.3M downloads/30d#4,113 on PyPI2,446
Permissive license MIT Active released

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 lizard

uv

uv add lizard

poetry

poetry add lizard

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: End Users/DesktopLicense :: FreewareOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: CProgramming Language :: C++Programming Language :: JavaProgramming Language :: JavaScriptProgramming Language :: Objective CProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Quality Assurance

Tags

cyclomatic complexity analyzercode clone detectionstatic code analysis toolcode quality metricsmulti-language code analyzercopy-paste detectionfunction complexity measurement
code-metricsmulti-languageci-cd-ready

More Quality Assurance packages