Back to all posts
Guide
9 min read

Best Static Code Analysis Tools in 2026

DevToolLab Team

DevToolLab Team

June 5, 2026 (Updated: November 21, 2026)

Best Static Code Analysis Tools in 2026

Veracode's 2026 GenAI Code Security Report, published July 28, found AI-generated code syntactically correct nearly 100 percent of the time, with an average security pass rate of 56 percent, barely up from 55 percent in its first report. The October 29 update lifted the average to 62 percent, but cross-site scripting still passed only 18 percent of the time and log injection 12.6 percent.

That is a tooling problem, not a model problem. Code that always compiles sails past anything that only checks syntax. The checks that catch the rest understand types, follow data across files, and recognize a tainted string before it reaches a template. That analysis got much faster in 2026, and almost all of it is free. Every tool with sample output below was run locally in November 2026.

There are three layers. Linters run in milliseconds inside one file, SAST follows data across files in minutes on pull requests, and platforms add dashboards and enforcement. Start with the fast layer, because developers keep it running.

The Fast Layer: Linters and Type Checkers

JavaScript and TypeScript

Oxlint JavaScript TypeScript linter
Oxlint JavaScript TypeScript linter

Oxlint changed the most this year. On July 22, 2026 the Oxc project marked type-aware linting stable, powered by tsgolint, which builds TypeScript programs with the Go port of the compiler. Its benchmarks against typescript-eslint show 12x on VS Code, 14x on the TypeScript repo and 18x on TypeORM, and the docs list 60 of typescript-eslint's 62 type-aware rules as supported. On November 17 Oxc added a second backend, tsrs, which it says runs up to 5x faster than tsgolint.

Type awareness is off by default and runs through the oxlint-tsgolint package, now a peer dependency. Install both so the versions stay pinned. On Oxlint 1.94.0:

Bash
npm install --save-dev oxlint oxlint-tsgolint
npx oxlint --type-aware src
text
src/orders.ts:7:3: warning typescript(no-floating-promises): Promises must be awaited, add void operator to ignore.

Without --type-aware, the same file reports nothing.

Biome JS/TS linter and formatter
Biome JS/TS linter and formatter

Biome is one Rust binary replacing ESLint and Prettier. Version 2.5 (June 5, 2026) crossed 500 lint rules and added cross-file rules, and 2.6 (October 15) added Markdown, YAML and SCSS and promoted 59 nursery rules. Its type-aware rules never call the TypeScript compiler, so they work with no typescript dependency. Some are still nursery rules, so you opt in:

JSON
{
  "$schema": "https://biomejs.dev/schemas/2.6.8/schema.json",
  "linter": {
    "rules": {
      "preset": "recommended",
      "nursery": { "noFloatingPromises": "error" }
    }
  }
}

On 2.6.8 that config caught the same floating promise plus a non-null assertion in 20ms. An older "recommended": true now draws a deprecation warning; npx biome migrate --write rewrites it. The trade-off against Oxlint: self-implemented inference is not the compiler, so exotic generics lag.

ESLint JavaScript TypeScript linter
ESLint JavaScript TypeScript linter

ESLint v10.0.0 landed February 6, 2026 and removed eslintrc, so flat config in eslint.config.js is the only format, on Node.js 20.19.0 or later; v10.15.0 is current. ESLint v9.x reached end of life on August 6, 2026. It still has the widest plugin coverage; our ESLint Config Generator writes a flat config if you are migrating.

Python

Ruff documentation benchmark: Ruff lints CPython in 0.29 seconds, Pylint takes over 60
Ruff documentation benchmark: Ruff lints CPython in 0.29 seconds, Pylint takes over 60

Ruff 0.17.6 is the Python default, replacing Flake8, Black and isort with 900+ rules. On a nine-line sloppy sample, uvx ruff check . flagged eight problems, from unused imports to a bare except, four with automatic fixes. Pair it with ty, Astral's Rust type checker, in beta since December 16, 2025 and now at 0.0.107:

text
error[invalid-argument-type]: Argument to function `apply_discount` is incorrect
 --> checkout.py:6:40
  |
6 |     discounted = apply_discount(price, coupon)
  |                                        ^^^^^^ Expected `int`, found `str | None`

A real bug in six lines of checkout code, found with no config. Caveats: it is still 0.0.x, and Astral's March 2026 deal to join OpenAI's Codex team is still listed as subject to regulatory approval, with a promise to keep the tools open source. For security add Bandit 1.9.4, which reported B608 (CWE-89) on a concatenated query.

Go, Rust, PHP and Beyond

The golangci-lint homepage: a Go linters runner with 100+ bundled linters
The golangci-lint homepage: a Go linters runner with 100+ bundled linters

Go. For Golang static code analysis, golangci-lint v2.15.0 bundles staticcheck and govet behind one command; on a swallowed error it reported SA9003: empty branch. Add gosec with a caveat: v2.30.0 found G304 and its newer taint-based G703 path traversal check, but missed a SQL injection in both concatenation and fmt.Sprintf forms, even with -include=G201,G202. A quiet security linter is not proof nothing is there.

Rust. cargo clippy ships with the toolchain. On a function taking &Vec<f64> and looping by index it flagged both the needless allocation and the index loop, with fixes.

PHPStan PHP static analysis
PHPStan PHP static analysis

PHP. PHPStan 2.3.7 runs from a single phar with eleven rule levels (0 to 10), so legacy code adopts it gradually. Given an array shape of {price: float, qty: int} and a loop reading $item['quantity'], it found the typo PHP surfaces only at runtime. It also noticed who was running it: with AI_AGENT or CLAUDECODE set, PHPStan prints instructions telling the agent to fix the cause, not add @phpstan-ignore comments. Psalm 7.13.2 is stricter and adds taint analysis, now with a TaintedLlmPrompt check, so many teams run both.

Psalm PHP security taint analysis
Psalm PHP security taint analysis
Checkstyle Java style enforcer
Checkstyle Java style enforcer

Elsewhere. Checkstyle 14.4.0, SpotBugs and PMD for Java, RuboCop 1.92.3 for Ruby, clang-tidy and Cppcheck for C++.

RuboCop Ruby linter
RuboCop Ruby linter

Why These Got So Fast

ToolLanguageReplacesVendor-reported speed gain
RuffPythonFlake8 + Black + isort10-100x faster
BiomeJS/TS/CSSESLint + Prettier~35x formatting vs Prettier
OxlintJS/TSESLint50-100x faster
Oxlint + tsgolintTS type-awaretypescript-eslint12-18x faster
tyPython typesmypy, Pyright10-100x faster

The Security Layer: SAST

Semgrep and Opengrep

Semgrep SAST pattern matching
Semgrep SAST pattern matching

Semgrep CE 1.186.0 is the most approachable way to write a security rule, because the pattern language looks like the code it matches. This one is tested:

yaml
rules:
  - id: python-sqli-string-concat
    languages: [python]
    severity: ERROR
    message: SQL built by concatenation. Use a parameterized query instead.
    patterns:
      - pattern-either:
          - pattern: $CURSOR.execute(<... "..." + $VAR ...>)
          - pattern: $CURSOR.execute(f"...{$VAR}...")
          - pattern: $CURSOR.execute("..." % $VAR)
          - pattern: $CURSOR.execute("...".format(...))

Against a concatenated query, an f-string query and a parameterized one, it reported exactly the two real problems. The naive $CURSOR.execute("..." + $VAR) matches nothing, because "..." + email + "'" parses as nested concatenation; the deep expression operator <... ...> is what makes it work.

Opengrep community SAST engine
Opengrep community SAST engine

The Opengrep fork. After Semgrep relicensed its vendor-maintained rules in December 2024, security vendors including Aikido launched Opengrep as an LGPL-2.1 fork. Version 2.0.0 shipped November 13, 2026, dropping the Python wrapper and adding cross-file taint analysis behind --enable-interfile. The same rule file, unmodified, returned 2 findings in 1 file on the same two lines, so rule investment is portable. Semgrep is free for up to 10 contributors and 10 repositories, then $30 per contributor per month; Opengrep is free.

CodeQL

The CodeQL site: a taint-tracking query following a flow from source to sink
The CodeQL site: a taint-tracking query following a flow from source to sink

CodeQL is the deepest free option for public GitHub repos: twelve languages including GitHub Actions workflows, with Copilot Autofix and no Copilot subscription needed. Private repos need GitHub Code Security at $30 per active committer per month. Its dataflow beats pattern matching, but a custom query is a project, not an afternoon.

Infrastructure as Code

The Trivy homepage: one scanner for CVEs and IaC misconfigurations
The Trivy homepage: one scanner for CVEs and IaC misconfigurations

Trivy scans IaC, dependencies, images and secrets from one Apache-2.0 binary. On a thirteen-line Terraform file, Trivy 0.74.0 reported Failures: 11 (LOW: 4, MEDIUM: 1, HIGH: 6), including unrestricted SSH ingress; --severity HIGH,CRITICAL cut that to six. Checkov 3.4.6 caught the same SSH exposure among ten failures, most of them policy preferences such as cross-region replication, so tune the set on day one. In the browser, our Kubernetes Manifest Linter and Dockerfile Linter cover manifests and image builds.

AI-Native SAST, the Paid Alternative

The ZeroPath homepage, "Agentic AppSec for Everyone"
The ZeroPath homepage, "Agentic AppSec for Everyone"

These pair a model with program analysis to cut false positives and draft the patch. ZeroPath starts at $1,000/month plus $60 per developer and advertises 90 percent less noise. Corgea is free for two developers, then $39 per developer per month with a five-seat minimum. DryRun Security reviews each pull request against the surrounding code, with no public price. Trial one on a repo with three known issues.

The Platform Layer

SonarQube code quality and security platform
SonarQube code quality and security platform

SonarQube covers 40+ languages, with 2026.5 as the current LTA release. The Quality Gate is the reason to adopt it: a pass/fail threshold that blocks pull requests. Scanning covers OWASP, CWE, STIG, NIST SSDF and PCI DSS with cross-file taint analysis.

Its 2026 addition is AI Code Assurance: an administrator turns on "Contains AI-generated code" in project settings and the project then needs an AI-qualified quality gate: a labeling workflow, not a detector of which lines an assistant wrote. Community Build is free and LGPL-3.0; paid plans start at $34 a month for up to 100k lines of code.

DeepSource automated code review platform
DeepSource automated code review platform

DeepSource, which Harness acquired on September 9, 2026, is free for open-source projects and $24 per user per month for Team, billed yearly.

Qlty code quality platform
Qlty code quality platform

Qlty runs its CLI locally or in any CI across 70+ linters and analyzers. The source is public under the Business Source License 1.1, converting to GPL-3.0 in December 2028, so today it is source-available rather than open source. MegaLinter is the other bundler worth knowing.

Tracking Code Maintainability

Linters catch defects; maintainability tools track the drift that makes code expensive to change. SonarQube rates each project's maintainability from its code smells and can fail the Quality Gate when new code drops below an A. Qlty tracks duplication and complexity per file, so a pull request adding a 300-line function gets flagged before merge.

Wiring It Into CI

SARIF ties the layers together. Oxlint, Ruff and Semgrep all emit SARIF 2.1.0, confirmed by generating output from each, so findings land in GitHub code scanning as inline annotations.

yaml
name: static-analysis
on: [pull_request]

permissions:
  contents: read
  security-events: write

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: "24"
      - run: npm ci
      - name: Type-aware lint
        continue-on-error: true
        run: npx oxlint --type-aware --format sarif src > oxlint.sarif
      - uses: github/codeql-action/upload-sarif@v4
        with:
          sarif_file: oxlint.sarif
          category: oxlint

  sast:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-python@v7
        with:
          python-version: "3.13"
      - run: pip install semgrep==1.186.0
      - name: Semgrep scan
        continue-on-error: true
        run: semgrep --config p/default --sarif --output semgrep.sarif --metrics=off .
      - uses: github/codeql-action/upload-sarif@v4
        with:
          sarif_file: semgrep.sarif
          category: semgrep

continue-on-error: true lets the SARIF upload run even when findings exist, so code scanning enforces policy rather than the exit code. Remove it once the noise is acceptable.

The Compliance Deadline

Since September 11, 2026 the EU Cyber Resilience Act has required manufacturers, including US companies selling software in the EU, to report actively exploited vulnerabilities: an early warning within 24 hours and a fuller notification within 72. That clock is hard to meet without automated scanning.

Which Static Code Analysis Tools Are Free and Open Source?

Fifteen of the 22 tools in the table below are open source and free with nothing to buy: Ruff, ty, Bandit, Oxlint, Biome, ESLint, Clippy, golangci-lint, RuboCop, Checkstyle, PHPStan, Psalm, Opengrep, Trivy and Checkov. Semgrep CE and SonarQube Community Build are open-source engines with paid platforms on top, CodeQL is free on public repositories, and Corgea, DeepSource and Qlty have free tiers. Only ZeroPath has no free option.

Head-to-Head Comparison

ToolCategoryLanguagesLicenseFree TierPaid Starts At
RuffLinter + formatterPythonMITFree forever-
tyType checkerPythonMITFree forever-
BanditSecurity linterPythonApache-2.0Free forever-
OxlintLinter (type-aware)JS/TSMITFree forever-
BiomeLinter + formatterJS/TS/CSS/JSONMIT or Apache-2.0Free forever-
ESLintLinterJS/TSMITFree forever-
ClippyLinterRustMIT or Apache-2.0Ships with rustup-
golangci-lintLinter aggregatorGoGPL-3.0Free forever-
RuboCopLinterRubyMITFree forever-
CheckstyleLinterJavaLGPL-2.1Free forever-
PHPStanType checkerPHPMITFree forever€7/mo (optional Pro UI)
PsalmSAST + typesPHPMITFree forever-
SemgrepSAST30+LGPL-2.110 contributors, 10 repos$30/contributor/mo
OpengrepSAST30+LGPL-2.1Free forever-
CodeQLSAST12Source-availableFree on public repos$30/committer/mo
TrivyIaC, deps, imagesMultiApache-2.0Free forever-
CheckovIaC policyMultiApache-2.0Free forever-
CorgeaAI SASTMultiProprietary2 devs, 10 repos$39/dev/mo (5 seats min)
ZeroPathAI SASTMultiProprietaryNone$1,000/mo + $60/dev
SonarQubePlatform40+LGPL-3.0 Community BuildSelf-hosted Community$34/mo (100k LOC)
DeepSourcePlatform16 analyzersProprietaryOpen source repos$24/user/mo (annual)
QltyPlatformMultiBSL 1.1 CLI1,000 min/mo$24/contributor/mo ($20 annual)

How to Pick

Solo developer or open-source maintainer. Ruff for Python or Oxlint for TypeScript, plus Semgrep's free tier. Zero cost.

Small team. The same linters plus SonarQube from $34 a month or DeepSource at $24 per user per month, for dashboards and merge enforcement.

Existing large TypeScript codebase. Keep ESLint for plugins you cannot replace, move type-aware rules to Oxlint, and finish the v10 flat config migration, since v9 no longer gets fixes.

A fully open-source pipeline. Oxlint or Biome, Ruff with ty, golangci-lint, Clippy, PHPStan, Opengrep and Trivy, routed into code scanning as SARIF. You trade a license fee for configuration effort.

Enterprise or compliance. SonarQube Server for OWASP, CWE, STIG and NIST SSDF with audit trails, plus AI Code Assurance labeling.

Conclusion

Oxlint, Biome, Ruff and ty made type-aware checks fast enough for every commit, and all four are free. Get a type-aware linter to zero findings this week, add one SAST engine with a few relevant rules, and route the output into code scanning as SARIF. The tools stopped being the constraint; keeping the finding count low enough that people read it still takes discipline.

Prices and versions as of November 2026; check each vendor before buying.

Related Posts

Best Self-Hosted Password Managers in 2027

Vaultwarden, Bitwarden lite, Passbolt, Psono, KeePassXC and TeamPass compared on image size, database, license and team price, after the 1Password incident.

By DevToolLab Team•

Turborepo vs Nx in 2027: Benchmarked

Turborepo 2.11 and Nx 24.1 run on one pnpm workspace: cold builds, cache hits, --affected, install size, remote cache pricing and when each one wins.

By DevToolLab Team•

How to Code by Voice With AI Agents

Claude Code, Copilot CLI, Kiro, Cursor and VS Code now take spoken prompts. Where each one sends your audio, which key to press, and how to dictate a prompt.

By DevToolLab Team•