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 a baseline for the main branch to monitor changes after merging pull or merge requests. Whenever necessary, you can update your baseline by generating a new baseline.sarif.json file and using it while running Qodana.

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

If you run Qodana without the baseline, you will be able to see the problems detected at a current analysis.

Running Qodana without a baseline

In this case, you can only see the number of problems and their description, without classification to new and existing problems.

To improve the situation, you can add problems to the baseline and save them to the .qodana/baseline.sarif.json file in your project directory as explained in the Baseline problems section of the Qodana report description. Once done, this file becomes a basis for comparing with later code states. Below are the examples of how to run Qodana using various tools. The default path for the baseline file is .qodana/baseline.sarif.json.

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.1 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.

The baseline feature divides problems into these groups:

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

  • New are the problems that arise in addition to the baseline problems.

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

This image explains how everything works.

Enabling the baseline
  1. The first Qodana analysis detected two problems in the codebase.

  2. To create the baseline for your project, download the baseline.sarif.json file and save it in your project directory as shown in the Baseline problems section. Starting from this moment, these two problems are identified by Qodana as baseline problems.

  3. A later Qodana analysis detected three problems. Fortunately, this time Qodana identifies one of them as new and marks it respectively. The other two are the baseline problems; they are already reflected in the baseline report and marked as unchanged.

  4. After one baseline problem is resolved, you decided to run Qodana again. This time, the report will contain three problems. The new problem is the problem that was detected in the previous analysis and still remains new. There is also one unchanged problem that has not changed its status. Finally, the first baseline problem was resolved and now is marked as absent.

    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.1 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

As you can see, new problems do not change the status across Qodana analyses. To transform them to unchanged, you need to update your baseline.

Updating the baseline
  1. Add the new problem to your baseline and then save the updated version of the baseline.sarif.json file in your project directory.

  2. Run Qodana again to see the change in the problem status.

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.

18 August 2026