Skip to content
testcritic

CodeQL

Query your codebase like a database to find vulnerability patterns across the whole repo.

Security TestingFree tierOpen sourceSelf-hostable
Visit CodeQL

What it is

CodeQL compiles source into a relational database and lets you write queries over it, which finds whole-program dataflow issues that pattern matchers miss. GitHub ships it as the engine behind code scanning, free for public repositories and licensed as part of GitHub Advanced Security for private ones.

Best for

GitHub-hosted projects wanting deep static security analysis, free if the repo is public.

Where it is strong

  • Interprocedural dataflow analysis finds real vulnerabilities that regex- and pattern-based tools cannot see.
  • Free on public repositories, with results in the GitHub security tab.
  • Custom queries let you encode organisation-specific security rules.

Where it falls short

  • Writing custom CodeQL queries is a specialist skill with a steep learning curve.
  • Analysis is slow — minutes to tens of minutes, so it fits nightly better than per-commit.
  • Private-repo licensing through Advanced Security is expensive at scale.

Pricing

From $30 per active committer/month (GitHub Code Security)

Free tier

Free tier: Free for public repositories on GitHub.

What drives the bill: Free on public repos. For private repositories GitHub split Advanced Security into two products in April 2025: Code Security at $30 and Secret Protection at $19 per active committer/month, both now available on Team plans as well as Enterprise. CodeQL sits in Code Security. Billing counts active committers, not seats, which can surprise teams with many occasional contributors.

Check current pricing on GitHub (Microsoft)’s site

Figures are indicative and were last reviewed August 2026. Vendors change pricing often; confirm before you commit.

Works with

GitHub ActionsGitHub Advanced SecurityVS CodeJenkins

What people who use CodeQL say

No reviews of CodeQL yet. If you have used it in anger, yours would be the first.

Alternatives to CodeQL

If CodeQL is not the right fit, these solve the same problem differently.

Explore all alternatives