Qodana 2025.2 Help

Analyze Unity project

You can analyze Unity project using the Qodana for .NET linter in the native mode as explained in this section.

Before your start

Before running Qodana, you need to take several steps to prepare your project.

Qodana Cloud

To run Qodana, you need to obtain a project token that will be used by Qodana for identifying and verifying a license.

  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.

Solution and packages

Make sure that you have already built your Unity project, see the Build the project chapter of the .NET section for details.

Unity projects typically don’t include a C# solution and project files, and these should be generated. Install the corresponding .NET SDK in the build environment by executing the following script on each build:

#!/usr/bin/env bash ${UNITY_EXECUTABLE:-xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' unity-editor} \ -batchmode -quit -projectPath $UNITY_DIR -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution

Qodana configuration

In the qodana.yaml file, save the following configuration to employ the Qodana for .NET linter in the native mode and use the qodana.recommended inspection profile:

linter: qodana-dotnet # Specifying the linter withinDocker: false # Enabling native mode baseProfile: qodana.recommended # Specifying the profile

Native mode is the recommended mode for running the Qodana for .NET linter.

Prepare your software

Choose the software that you would like to use for running Qodana, for example:

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

In the root directory of your project, save the .gitlab-ci.yml file. This file will contain a pipeline configuration that will be used by GitLab CI/CD in this use case.

Follow the instructions from the Qodana CLI page on GitHub.

Run Qodana

To inspect the main branch, release branches and the pull requests coming to your repository in the 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@v2025.2 env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
include: - component: $CI_SERVER_FQDN/qodana/qodana/qodana-gitlab-ci@v2025.2

Run this command in the project root directory:

qodana scan

This command tells Qodana to generate the output and report in the /report directory inside a project directory.

  1. In your IDE, navigate to Tools | Qodana | Try Code Analysis with Qodana.

  2. On the dialog that opens, make necessary configurations to the qodana.yaml file.

    Configuring Qodana in the Run Qodana dialog

    Click Run for analyzing your code.

  3. In the Server-Side Analysis tool window, see the inspection results.

Customize your analysis

Using recommendations from the Analysis reports and Inspection profile overview sections, you can adjust Qodana analysis of your project. For example, using the Configuration tab of a Qodana report, you can select the inspections that will be used during the analysis or exclude them from the analysis. Also, you can exclude directories of your project that you do not wish Qodana to analyze. To adjust the existing profile, you can use the recommendations from the Custom inspection profiles section.

29 August 2025