> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Infer

> CodeRabbit's guide to Infer.

export const ProPlanBadge = ({tip = "This feature is available as part of the Pro, Pro+ and Enterprise plans. Please refer to our pricing page for more information about our plans and features.", title = "Pro Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-check" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const AllPlatformsBadge = ({tip = "This feature is available on all supported platforms: GitHub, GitLab, Azure DevOps, and Bitbucket.", title = "All Platforms", cta, href, disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="globe" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

<AllPlatformsBadge /> | <ProPlanBadge />

[Infer](https://fbinfer.com/) is a static analysis tool for finding bugs in C, C++, and Java code. CodeRabbit runs Infer version 1.2.0 to report issues such as null dereferences, resource leaks, and concurrency bugs on changed files.

## Files

Infer will run on changed files with the following extensions:

* `.c`
* `.cc`
* `.cpp`
* `.cxx`
* `.h`
* `.hh`
* `.hpp`
* `.hxx`
* `.java`

Java analysis is disabled by default. Enable `reviews.tools.fbinfer.enable_java` when you want CodeRabbit to analyze changed Java files with Infer.

## Configuration

Infer is disabled by default. Set `reviews.tools.fbinfer.enabled` to `true` when you want CodeRabbit to run it, and leave `reviews.tools.fbinfer.enable_java` as `false` unless Java analysis should be included.

<Tabs>
  <Tab title="Using configuration file">
    ```yaml theme={null}
    reviews:
      tools:
        fbinfer:
          enabled: false
          enable_java: false
    ```
  </Tab>

  <Tab title="Using web interface">
    Enable or disable Infer from **Reviews → Tools → Infer** in CodeRabbit's settings page. Infer is disabled by default. Turn on **Enable Java analysis** when Java files should be included.
  </Tab>
</Tabs>

## Compilation database discovery

Infer uses a compilation database for C and C++ analysis. CodeRabbit searches the repository for `compile_commands.json` files while skipping dependency and VCS directories such as `.git`, `node_modules`, `vendor`, `third_party`, `external`, and `subprojects`.

When no compilation database is available, CodeRabbit skips C and C++ analysis. Java files are analyzed only when Java analysis is enabled.

## When we skip Infer

CodeRabbit will skip running Infer when:

* Infer is disabled in CodeRabbit settings or `.coderabbit.yaml`.
* No changed files match the supported file types.
* Java is the only matching language and Java analysis is not enabled.
* Infer is already running in GitHub workflows.
* C or C++ files changed but no compilation database is available.

## Links

* [Infer documentation](https://fbinfer.com/docs/getting-started)
* [Infer on GitHub](https://github.com/facebook/infer)

## What's next

<CardGroup cols={1}>
  <Card title="Tool catalog" href="/tools/list" icon="list" horizontal>
    Browse all linters, security analyzers, and CI/CD integrations by category and technology.
  </Card>

  <Card title="Tools reference" href="/tools/reference" icon="wrench" horizontal>
    Explore detailed specifications and configuration options for CodeRabbit tools.
  </Card>
</CardGroup>
