Qodana 2024.3 Help

JetBrains IDEs

You can run Qodana in JetBrains IDEs to inspect your codebase. Qodana supports several JetBrains IDEs installed via JetBrains Toolbox App, such as IntelliJ IDEA, PhpStorm, WebStorm, Rider, GoLand, PyCharm, and Rider.

Using the IDE, you can:

UI overview

In your IDE, navigate to Tools | Qodana.

The Qodana menu

You can also have access to Qodana using the Problems | Server-Side Analysis tool window of your IDE.

The Server-Side Analysis tool window

Run Qodana locally

You can run Qodana locally and then forward inspection reports to Qodana Cloud for storage and analysis purposes.

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

  2. On the Run Qodana dialog, you can configure:

    Configuring Qodana in the Run Qodana dialog

    Click Run for inspecting your code.

  3. On the Server-Side Analysis tab of the Problems tool window, see inspection results.

Connect to Qodana Cloud

You can log in to Qodana Cloud and connect your project opened in the IDE to a specific Qodana Cloud project to get the latest Qodana report and view it.

  1. In your IDE, navigate to Tools | Qodana | Log in to Qodana.

  2. On the Settings dialog, click Log in.

    Connecting to Qodana Cloud

    This will redirect you to the authentication page.

  3. Select the Qodana Cloud project to link your local project with.

    Linking the project to Qodana Cloud
  4. By enabling the Always load most relevant Qodana report option, you can get actual reports automatically retrieved from Qodana Cloud.

    Enabling to load the most relevant reports

    In this case, the IDE will search and fetch from Qodana Cloud the report with the revision ID corresponding to the current revision ID (HEAD). If this report was not found, the IDE will select the previous report with the revision closest to the current revision ID (HEAD). Otherwise, the IDE retrieves the latest available report from Qodana Cloud.

  5. On the Server-Side Analysis tab of the Problems tool window, see inspection results.

Configure Qodana for CI

Once you logged in to Qodana Cloud, you can configure Qodana in your CI pipelines.

  1. In your IDE, navigate to Tools | Qodana | Add Qodana to CI Pipeline

  2. On the Add Qodana to CI Pipeline dialog, follow the recommendations applicable to your CI/CD solution.

    The Add Qodana to CI pipeline dialog

Open a local report

You can open and review SARIF-formatted Qodana reports in your IDE.

  1. In your IDE, navigate to Tools | Qodana | Open Local Report.

  2. Select the SARIF-formatted report file you would like to open.

  3. On the Server-Side Analysis tab of the Problems tool window, you can view inspection results.

Qodana report overview

Using the Server-Side Analysis tab of your IDE, you can view Qodana reports and navigate to the code fragments containing such problems.

Navigating to problems in the IDE

The upper part contains information about the project and branch names, the inspection date, and the number of problems. The left part of the Server-Side Analysis tab contains several buttons.

Functionalities of the Server-Side Analysis tab

This table describes each button from top to bottom:

Button

Description

Close Report

Close the report that was previously opened

Refresh Report

Download the updated version of the report from Qodana Cloud. This requires that you first link your project with Qodana Cloud

Log in to Qodana / Logged in to Qodana

Log in Qodana Cloud, or log out. This action is a prerequisite for linking your project with Qodana Cloud-based reports

Link project with Cloud / Linked with Cloud

Link your project with a specific Qodana Cloud-based project, or unlink it. This requires that you first log in to Qodana Cloud

View Options

Filter out code issues by their severity and configure their sorting. When no grouping or sorting options are selected, the issues are listed in the order they appear in the file. You can also filter all issues by the baseline

Open Editor Preview

Open the preview pane to view the selected issue in its source context. This preview lets you change the code and apply available quick-fixes

Expand All

Expand all nodes to see all issues in the expanded form

Collapse All

Collapse all nodes that were previously expanded

Show Qodana in Browser

Open the inspection report using your default browser

Other

Functionalities from the Tools | Qodana menu

Qodana log overview

In your IDE, navigate to Help | Collect Logs and Diagnostic Data. This will collect all necessary data and save them under a specific directory.

Last modified: 25 September 2024