Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.
Semgrep is a fast, open-source static analysis tool built by a team with a documented community and commercial offering. The project is written in OCaml for its core engine (semgrep-core), which handles parsing, pattern matching, and analysis across 30+ languages including Python, Java, Go, JavaScript, Ruby, TypeScript, and C, while a Python command-line interface orchestrates the tool and communicates with the Semgrep AppSec Platform. The core architecture converts source code to a unified Generic Abstract Syntax Tree, performs semantic pattern matching using rules that resemble source code syntax, and operates through a multi-stage pipeline of parsing, analysis, intermediate language conversion, pattern matching, and reporting. The technology stack includes OCaml with Dune as the build system, Python 3 with the uv dependency manager, and integrations with external services, tree-sitter parsers for language support, and Git-based workflows with pre-commit hooks and GitHub Actions for continuous integration and deployment.