Qodana 2026.2 Help

Baseline

The baseline is a snapshot of the codebase problems taken at a specific Qodana analysis.

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

The baseline is enabled by default and does not require any additional setup. Information about your project baseline is stored and updated in Qodana Cloud.

During the first analysis of your project, Qodana collects all found problems, moves them to the baseline, and makes the baseline available for review and later Qodana analyses. You can add and remove problems from the baseline.

Generally, the baseline feature divides problems into these groups:

  • Unchanged – problems added to a baseline during the first analysis and remaining unchanged since then.

  • New – problems that could not be matched to any problem in the baseline. These are usually problems introduced by recent changes. However, existing problems can also be reported as new if Qodana cannot recognize them after refactorings or file updates.

  • 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 may now be marked as absent.

    As you can see, new problems do not automatically change their 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.

If you are a user of the Editor or Admin roles in Qodana Cloud, you can configure the baseline by using the Apply ... dropdown list of the Baseline problems tab.

Explore analysis results

The baseline is available for review on the Baseline problems tab.

Baseline problems tab

On the Baseline problems tab, you can view the baseline used for later analyses.

You can update the baseline by promoting or demoting problems as explained in the Analysis reports section.

If you are a user of the Editor or Admin roles in Qodana Cloud, you can configure the baseline by using the Apply ... dropdown list of the Baseline problems tab.

The Apply ... dropdown list

File baseline

If you require baseline governance and version control, you can manage a project’s baseline in a file, stored in a version control system. If you provide a baseline file when you run code analysis, it overrides the project’s existing baseline.

To start with a file baseline, navigate to the Baseline problems tab of Qodana Cloud UI, and then download the baseline saved in the qodana.sarif.json file. Configure the file baseline by setting the --baseline option 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.

Including absent problems in reports

To include absent problems in reports, 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.

Requiring a file-based baseline

If you are a user of the Editor or Admin roles in Qodana Cloud, you can configure your project to use only a file baseline.

  1. In the Qodana Cloud UI, on the Baseline problems tab download the baseline.sarif.json file containing the baseline.

  2. In the Qodana Cloud UI, on the Baseline problems tab, disable the Apply ... dropdown list.

  3. Configure the file baseline using the recommendations from the File baseline chapter.

  4. Run Qodana.

  1. On the Baseline problems tab of the Qodana Cloud UI, enable the Apply ... dropdown list.

  2. In your Qodana configuration, configure the --baseline option.

  3. Run Qodana with the --baseline option, to update the default baseline.

11 November 2026