--- id: scan-build version: "3.1.0" license: MIT license_treatment: permissive maintenance: active --- # scan-build — Run the Clang static analyzer on projects with a compilation database. License: permissive · Maintenance: active · Downloads: 151.1K/mo ## What it is and what it does scan-build is a Python-based wrapper around the Clang static analyzer that automates analysis of C/C++ projects. It reads a compilation database (a JSON file describing how each source file should be compiled), runs the Clang analyzer against each entry, and produces reports of potential bugs in HTML or machine-readable plist format. The tool works with any build system that can generate a compilation database—CMake does this natively with a flag, and other build systems can use the Bear tool to capture compiler invocations. The package requires clang to be installed separately and Python 3.10 or later. It has no Python dependencies, making installation straightforward. Unlike earlier versions, it no longer intercepts build commands; it purely analyzes existing compilation databases. This design simplifies the tool and shifts database generation to dedicated tools like Bear, which now support all major platforms including Windows. Use it for: - Integrate static analysis into CI/CD pipelines with --status-bugs to fail builds when potential bugs are detected. - Analyze third-party or legacy C/C++ codebases without modifying their build configuration. - Generate HTML reports of code defects for code review and quality tracking across releases. - Exclude specific directories (e.g., vendor code) from analysis using --exclude flags. - Export machine-readable plist output for automated tooling and defect tracking systems. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Runs the Clang static analyzer on C/C++ projects using a compilation database and generates HTML or plist reports of potential bugs without modifying the build. Yes. This is a mature, actively maintained tool (release 4 days old, 396 GitHub stars) with zero known vulnerabilities, no Python dependencies, and permissive MIT licensing. Install it if you need to run Clang static analysis on C/C++ projects with a compilation database. The only real prerequisite is having clang and a compilation database available—if your build system doesn't generate one natively, use Bear first. ## Install pip install scan-build uv add scan-build poetry add scan-build ## Installing scan-build Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a release 4 days old. Requires clang and a compilation database to function, but the tool itself installs cleanly. License in practice: MIT license (permissive): you can use, modify, and distribute this package freely with minimal restrictions, making it safe for both open-source and commercial projects. Quickstart: $ pip install scan-build $ cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $ clanganalyzer --cdb build/compile_commands.json --output report Requires clang to be installed and a compilation database (compile_commands.json) for your project; Python 3.10 or later. Verify before relying: - Whether the tool's analysis accuracy and coverage match or exceed the original Perl scan-build implementation. - Performance characteristics when analyzing large codebases with many compilation database entries. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 151.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags clang static analyzer, c++ code analysis, compilation database analysis, static code quality checking, clang bug detection, scan-build tool, c code defect finder, static-analysis, c-cpp, clang [View on SkillFed](https://skillfed.io/packages/scan-build) · [View on PyPI](https://pypi.org/project/scan-build/)