Qodana 2026.2 Help

Baseline

The baseline is a snapshot of the codebase problems taken at a specific Qodana analysis for a specific Git branch and contained in the baseline.sarif.json file.

Using the baseline feature, you can compare your current code to its baseline state and see new, unchanged, and resolved problems. For example, you can configure and update the baseline for the main branch to monitor changes after merging pull or merge requests.

The baseline is supported by all linters and available under Community, Ultimate, and Ultimate Plus licenses and their trial versions. To learn more details about licenses, visit the Subscription Options and Pricing page. You can also request a demo.

How the baseline works

During the first analysis of your project, Qodana collects all found problems and moves them to the baseline available for review on the Baseline problems tab. On that tab, you can also download the baseline contained in the qodana.sarif.json file. After downloading the file, you can use it for comparing with later code states as explained in this section. The subsequent analyses do not add new problems to the existing baseline.

You can update the baseline by adding or removing problems as explained in the Analysis reports section. This will update the qodana.sarif.json file in the Qodana Cloud UI accordingly.

The baseline feature divides problems into these groups:

  • Unchanged – problems added to a baseline and remaining unchanged since then.

  • New – problems that arise in addition to the unchanged problems.

  • Absent – problems that were resolved since the baseline was created.

This diagram explains how these groups work.

Enabling the baseline
  1. For example, the first Qodana analysis detected two problems that were added to the baseline.

  2. The second Qodana analysis detected three problems. Fortunately, this time Qodana marks one of them as new. The other two are the unchanged problems; they are already reflected in the baseline report.

  3. After one baseline problem had been resolved, the project was analyzed again. This time, the report will contain three problems. The new problem is the problem that was detected in Step 2 and still remains new. There is also one unchanged problem that has not changed since Step 1. Finally, one baseline problem was resolved and now is marked as absent.

    As you can see, new problems do not automatically change theis status across Qodana analyses. To transform them to unchanged, you need to add such problems to your baseline, and then analyze your project again.

  4. The new problem was moved to the unchanged group by adding that problem to the baseline, downloading the updated qodana.sarif.json file and then running Qodana with the updated baseline.

Run the baseline

After you have downloaded the qodana.sarif.json file from the Baseline problems tab, you can run Qodana with the baseline enabled as shown below:

qodana scan \ -e QODANA_TOKEN="<cloud-project-token>" \ --baseline .qodana/baseline.sarif.json

Here, the QODANA_TOKEN variable refers to the project token required by the Ultimate and Ultimate Plus linters.

docker run \ -v $(pwd):/data/project/ \ -e QODANA_TOKEN="<cloud-project-token>" \ jetbrains/qodana-<image> \ --baseline .qodana/baseline.sarif.json

In this snippet, the --baseline option specifies the path to the baseline file from the Docker filesystem. The QODANA_TOKEN variable refers to the project token required by the Ultimate and Ultimate Plus linters.

name: Qodana on: workflow_dispatch: pull_request: push: branches: # Specify your branches here - main # The 'main' branch - master # The 'master' branch - 'releases/*' # The release branches jobs: qodana: runs-on: ubuntu-latest permissions: contents: write pull-requests: write checks: write steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2026.2 with: args: --baseline .qodana/baseline.sarif.json env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

In this snippet, the --baseline option specifies the path to the baseline.sarif.json file containing the baseline.

pipeline { environment { QODANA_TOKEN=credentials('qodana-token') } agent { docker { args ''' -v "${WORKSPACE}":/data/project --entrypoint="" ''' image 'jetbrains/qodana-<image>' } } stages { stage('Qodana') { steps { sh ''' qodana \ --baseline .qodana/baseline.sarif.json ''' } } } }

In this snippet, the --baseline option specifies the path to the baseline.sarif.json file containing a baseline.

include: - component: $CI_SERVER_FQDN/qodana/qodana/qodana-gitlab-ci@v2026.2 inputs: args: | --baseline .qodana/baseline.sarif.json --image <image>

In this snippet, the --baseline option specifies the path to the baseline.sarif.json file containing a baseline.

In the runner configuration, find the Additional Qodana arguments field and specify the path to the baseline.sarif.json file containing a baseline:

--baseline .qodana/baseline.sarif.json

The list of the IDEs supporting this feature is available in the JetBrains IDEs section.

This animation shows how you can analyze your code using baseline.

Running the baseline in the IDE

Here is the description of each step from the animation:

  1. In your IDE, navigate to the Problems tool window.

  2. In the Problems tool window, click the Qodana tab.

  3. On the Qodana tab, click the Try Locally button.

  4. On the dialog that opens, expand the Advanced Configuration section, select the baseline file, and then click Run.

To include absent problems in the report, you need to run Qodana with the --baseline-include-absent option:

qodana scan \ -e QODANA_TOKEN="<cloud-project-token>" \ --baseline .qodana/baseline.sarif.json \ --baseline-include-absent
docker run \ -v $(pwd):/data/project/ \ -e QODANA_TOKEN="<cloud-project-token>" \ jetbrains/qodana-<image> \ --baseline .qodana/baseline.sarif.json \ --baseline-include-absent
name: Qodana on: workflow_dispatch: pull_request: push: branches: # Specify your branches here - main # The 'main' branch - master # The 'master' branch - 'releases/*' # The release branches jobs: qodana: runs-on: ubuntu-latest permissions: contents: write pull-requests: write checks: write steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2026.2 with: args: | --baseline .qodana/baseline.sarif.json --baseline-include-absent env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
pipeline { environment { QODANA_TOKEN=credentials('qodana-token') } agent { docker { args ''' -v "${WORKSPACE}":/data/project --entrypoint="" ''' image 'jetbrains/qodana-<image>' } } stages { stage('Qodana') { steps { sh ''' qodana \ --baseline .qodana/baseline.sarif.json \ --baseline-include-absent ''' } } } }
include: - component: $CI_SERVER_FQDN/qodana/qodana/qodana-gitlab-ci@v2026.2 inputs: args: | --baseline .qodana/baseline.sarif.json --baseline-include-absent --image <image>

In the runner configuration, find the Additional Qodana arguments field and add the --baseline-include-absent option:

--baseline .qodana/baseline.sarif.json --baseline-include-absent

Customizing the baseline path

By default, Qodana expects the baseline file to be located at .qodana/baseline.sarif.json in your project root. You can override this as follows:

  • If you store the baseline file in a different path within the project directory, use the --baseline option to specify its location relative to the project root, e.g., --baseline path/to/your/baseline.sarif.json.

  • If your baseline file is located outside the project directory, you need to mount it into the container (for Docker-based runs) and then reference it using the mounted path with the --baseline option.

12 October 2026