Qodana 2026.3 Help

Dart

To analyze Dart and Flutter projects, you can use the Qodana Polyglot linter that has the following characteristics:

Characteristic

Description

Linter name

qodana-poly

Docker image

jetbrains/qodana-poly:2026.3

Based on

The Flutter SDK

Available under licenses

Ultimate and Ultimate Plus licenses

Shipped as

A native solution and a Docker image

Supported language

Dart

Supported framework

Flutter

Supported Qodana features

Baseline, quality gate

Before you start

Install project dependencies

Before starting the linter, make sure that project dependencies are set up. You can do this using the bootstrap key of your YAML configuration, for example:

bootstrap: flutter pub get

The command will be automatically executed before the analysis. For plain Dart projects, use the dart pub get command instead.

Qodana Cloud

Because the Qodana Polyglot linter requires a Qodana Cloud project token for identifying and verifying a license, follow these steps to get it:

  1. Navigate to Qodana Cloud and create an account there.

  2. In Qodana Cloud, create an organization, a team, and a project.

  3. On the project card, you can find the project token that you will be using further in this section.

Prepare your software

On the Settings tab of the GitHub UI, create the QODANA_TOKEN encrypted secret and save the project token as its value.

If you are using Linux, you should be able to run Docker under your current non-root user.

Follow the instructions from the Qodana CLI page on GitHub.

Configure the SDK

To analyze plain Dart projects, provide the path to the Dart SDK using the QODANA_FLUTTER_PATH environment variable. In this case, the Flutter SDK is not required.

To analyze Flutter projects, the Qodana Polyglot linter uses the Flutter SDK available via the PATH. To use a specific installation, set the QODANA_FLUTTER_PATH environment variable to the bin directory of your Flutter SDK.

The Docker version of Qodana Polyglot requires manual configuration of the Flutter/Dart SDK.

Run Qodana

The Dart SDK dependency management uses absolute paths that are not cross-compatible between Docker and native deployment modes. Use native mode to avoid the potential issues with dependency setup in your local development while using Qodana CLI. In Docker mode, SDK is not shipped within the jetbrains/qodana-poly:2026.3 image, so you should provide it manually by using the bootstrap option.

You can run Qodana using the Qodana Scan GitHub action.

To analyze the main branch, release branches and the pull requests coming to your repository in native mode, save this workflow configuration to the .github/workflows/code_quality.yml file:

name: Qodana on: workflow_dispatch: pull_request: push: branches: # Specify your branches here - main # The 'main' 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: | --linter qodana-poly --within-docker false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

This configuration uses the --linter option to specify a linter. The --within-docker option in the false state is used for enabling native mode.

More configuration examples are available in the GitHub Actions section.

Run this command in the project root directory:

qodana scan \    -e QODANA_TOKEN="<qodana-cloud-token>" \    --linter qodana-poly \    --within-docker false

This configuration uses the --linter option to specify the Qodana Polyglot linter. The --within-docker option in the false state is used for enabling native mode.

If you are using another Qodana Cloud instance than https://qodana.cloud/, override it by declaring the QODANA_ENDPOINT environment variable.

In your browser, open Qodana Cloud to examine analysis reports and reconfigure the analysis. See the Analysis reports section of the documentation for full details.

Explore analysis reports

After Qodana analyzed your project and uploaded the analysis reports to Qodana Cloud, in Qodana Cloud navigate to your project and review analysis reports.

Extend Qodana configuration

Configuring inspections and scope

The Qodana Polyglot linter reads the analysis scope and rules from the analysis_options.yaml files contained in the repository, so any changes to the analysis scope, i.e., included and excluded files and directories or ruleset should be made in those files.

The only inspection that you can configure via a YAML file is the DartAnalyze inspection acting as a single toggle for all Dart and Flutter analysis. This inspection is enabled by default. To disable the inspection, for example, when you only need other inspections from the linter, exclude it as follows:

exclude: - name: DartAnalyze

Enabling the baseline feature

Save the snippet to the .github/workflows/code_quality.yml file containing the --baseline option that specifies the path to a SARIF-formatted baseline file:

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 <path/to/qodana.sarif.json> --linter qodana-poly --within-docker false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

Run this command in the project root directory using the --baseline option to specify the path to a SARIF-formatted file containing a baseline:

qodana scan \    -e QODANA_TOKEN="<cloud-project-token>" \    --linter qodana-poly \    --within-docker false \    --baseline <path/to/qodana.sarif.json>

In your browser, open Qodana Cloud to examine the analysis reports and reconfigure the analysis. See the Analysis reports section of the documentation for full details.

Enabling the quality gate

You can configure the quality gate for a total number of problems:

Save the snippet to the .github/workflows/code_quality.yml file containing the --fail-threshold option that specifies the number of problems:

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: | --fail-threshold <number> --linter qodana-poly --within-docker false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

Run this command in the project root directory using the --fail-threshold option to specify the number of problems accepted as a quality gate:

qodana scan \ -e QODANA_TOKEN="<cloud-project-token>" \ --linter qodana-poly \ --within-docker false \ --fail-threshold <number>

Analyzing pull requests

The Qodana Scan GitHub action automatically analyzes all pull requests, so you do not have to provide any additional configuration. Save this configuration to the .github/workflows/code_quality.yml file:

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: | --diff-start=<GIT_START_HASH> --linter qodana-poly --within-docker false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

To analyze changes in your code, employ the --diff-start option and specify a hash of the commit that will act as a base for comparison:

qodana scan \ -e QODANA_TOKEN="<cloud-project-token>" \ --linter qodana-poly \ --within-docker false \ --diff-start=<GIT_START_HASH>
17 November 2026