Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.
Semgrep is a fast static analysis tool that searches code, finds bugs, and enforces secure guardrails and coding standards across many programming languages including C, Go, Java, JavaScript, Python, Ruby, and TypeScript. The project is built on a two-part architecture: a Python command-line interface that handles orchestration and communication with the Semgrep AppSec Platform, and an OCaml engine (`semgrep-core`) responsible for parsing, pattern matching, and analysis. The core engine processes code through a multi-stage pipeline converting source code to a Generic Abstract Syntax Tree, optionally to an Intermediate Language representation, then performs semantic pattern matching against rules to identify issues. Semgrep is developed and maintained as an open-source Community Edition project.