explaingit

facebook/infer

Analysis updated 2026-06-24

15,600OCamlAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

Static analysis tool from Facebook that scans Java, C, C++, and Objective-C source for null derefs, memory leaks, and other bugs without running the code.

Mindmap

mindmap
  root((infer))
    Inputs
      Source code
      Build commands
      Compile flags
    Outputs
      Bug reports
      Issue annotations
      Exit codes for CI
    Use Cases
      Catch null derefs before tests
      Find memory leaks in C and C++
      Block bad PRs in CI
    Tech Stack
      OCaml
      LLVM
      Java
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a static analysis gate to a C++ project that blocks PRs introducing null derefs

USE CASE 2

Scan an Android codebase for memory and concurrency bugs before release

USE CASE 3

Run a one off audit of a legacy Objective-C iOS app for resource leaks

USE CASE 4

Wrap an existing make or gradle build with infer capture and analyze

What is it built with?

OCamlLLVMJava

How does it compare?

facebook/infersemgrep/semgrepreasonml/reason
Stars15,60015,13010,307
LanguageOCamlOCamlOCaml
Setup difficultymoderateeasymoderate
Complexity4/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Java support pulls additional GPL components that must be installed separately from the MIT core.

MIT for the core tool. Some optional Java analysis components are GPL and need to be downloaded separately.

In plain English

Infer is a static analysis tool for Java, C++, Objective-C, and C, written in OCaml and originally developed at Facebook. Static analysis means it examines your source code without actually running it, looking for bugs such as null pointer dereferences (trying to use a variable that has no value), memory leaks (allocating memory that never gets freed), and other common coding errors. This kind of tool can catch problems before code is tested or deployed. Infer is licensed under the MIT License, though enabling Java support may require downloading additional components under the GPL. The README does not provide further detail beyond pointing to the documentation website at fbinfer.com for installation and getting-started guides.

Copy-paste prompts

Prompt 1
Show me how to install Infer on macOS and run it against a Gradle Android project
Prompt 2
Wrap a CMake C++ build with infer capture and infer analyze and explain the output
Prompt 3
Write a GitHub Actions workflow that runs Infer on PRs and fails on new issues
Prompt 4
Compare Infer to Clang Static Analyzer and CodeQL for catching null pointer bugs in C

Frequently asked questions

What is infer?

Static analysis tool from Facebook that scans Java, C, C++, and Objective-C source for null derefs, memory leaks, and other bugs without running the code.

What language is infer written in?

Mainly OCaml. The stack also includes OCaml, LLVM, Java.

What license does infer use?

MIT for the core tool. Some optional Java analysis components are GPL and need to be downloaded separately.

How hard is infer to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is infer for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub facebook on gitmyhub

Verify against the repo before relying on details.