Qodana Documentation

repository·2025.2·Indexed 19 days ago

https://github.com/jetbrains/qodana

Official user guides for Qodana, a code quality platform for enforcing coding standards and quality gates. Documentation covers local execution via CLI and IDEs, CI/CD integration with GitHub Actions, GitLab CI/CD, Azure Pipelines, CircleCI, TeamCity, Bitbucket, and Jenkins, as well as configuring baselines, quality gates, and custom inspection profiles.

Tokens
91.1K
Snippets
237
Records
402
Agent score
64%

What's inside Qodana

  1. Overview of Qodana for Golang

    2025.2

    Qodana provides static analysis for Golang projects based on the GoLand IDE. It is available as both a native solution and a Docker image.

    Key Characteristics:

    • Linter Name: %go-linter%
    • Docker Image: %go-image%
    • Supported Languages: Golang, JavaScript, and TypeScript
    • License Requirements: Ultimate or Ultimate Plus licenses.
  2. Overview of Qodana Analysis Reports

    2025.2

    Qodana analysis reports provide an interactive interface to review inspection results either locally (via HTML reports) or in the cloud. The report UI is organized into several key tabs:

    • Actual problems: Displays problems detected during the most recent inspection.
    • Baseline: Lists problems that were previously marked as baseline and remain unresolved.
    • Configuration: Allows you to adjust your inspection profile for future runs.
    • License audit: Shows dependency license compatibility results.

    Additionally, the upper-right corner of the report displays code coverage analysis results.

  3. Available Insights Widgets

    2025.2

    The Insights dashboard provides several widgets to monitor code quality and compliance across your projects:

    • Projects: Shows the count of active and inactive projects. A project is active if reports were uploaded to %cloud% within the last 90 days. A project is inactive if its reports are older than 90 days or if it contains sanity problems. Hovering over the widget reveals specific counts; clicking the inactive projects line navigates to a full list.
    • Scans: Displays information about analyses performed by %product% versions 2024.2 or later (excluding pull or merge requests).
    • Average code coverage rate: Shows the extent of test coverage using the code coverage feature. Hovering allows you to see the number of covered vs. uncovered projects and navigate to them.
    • Average license audit rate: Shows the percentage of projects that passed the license audit feature. Hovering allows you to navigate to projects where the audit failed or was not enabled.
    • Problems by severity: A diagram showing the distribution of detected problems based on their severity levels.
    • Problems over a specific period: A diagram showing the number of problems detected over time to track code quality progress.
    • Projects sorted: Located in the lower-left, this allows you to filter/sort projects by number of problems, number of critical problems, or code coverage. Clicking a project entry navigates to its specific page.
    • Problems sorted: Located at the bottom, this sorts problems by severity and occurrence. You can click a specific problem to see all projects containing it, or click View all problems to use a search field for finding problems by name.
  4. Add Qodana to your CI pipeline

    2025.2

    Qodana can be integrated into various CI systems either through native solutions or by running Qodana via Docker images.

    Integration Methods

    MethodSupported CI Systems
    Native SolutionsAzure Pipelines, Bitbucket, GitHub, GitLab, TeamCity
    Docker ImagesBitbucket, Jenkins

    For a complete list of guides and configuration examples for other CI systems, refer to the ci.md section.

  5. Supported IDEs and Qodana functionalities

    2025.2

    Qodana integrates with several IDEs, providing varying levels of functionality depending on the product:

    JetBrains IDEs

    (IntelliJ IDEA, PhpStorm, WebStorm, GoLand, PyCharm, Rider, CLion)

    • Available in most JetBrains IDEs:
      • Run Qodana locally.
      • Upload reports to Qodana Cloud (requires a project token).
      • Download and explore reports from Qodana Cloud.
      • Open local reports in SARIF format.
    • Note for CLion: Local execution and uploading to Qodana Cloud are not available in CLion.

    Visual Studio Code

    • Functionalities:
      • Run Qodana locally.
      • Upload reports to Qodana Cloud.
      • Download and explore reports from Qodana Cloud.
    • Prerequisites:
      • Install the Qodana extension.
      • A Qodana Cloud project token.
      • A running Docker daemon.

    Visual Studio

    • Functionalities:
      • Download and explore reports from Qodana Cloud.
    • Prerequisites:
  6. OWASP Top 10 improvements for Java and Kotlin

    2025.2

    Version 2025.2 includes several security analysis enhancements for Java and Kotlin to better address OWASP Top 10 risks:

    • Java Collections: Expanded taint modeling for all standard Java collections to improve propagation and sink coverage.
    • Kotlin Collection API: Modeling of standard Kotlin collection APIs for deeper analysis.
    • Kotlin String Taint Propagation: Modeling of Kotlin String APIs to detect injection and data exposure.
    • Kotlin Engine Stability: Improved reliability for large Kotlin codebases.
    • Java Field-Sensitive Data Flow: Enhanced tracking of tainted data through class fields to reduce false negatives in complex object graphs.
  7. Choose a Qodana linter for Java, Kotlin, and Groovy

    2025.2

    Qodana provides several linters for JVM-based languages depending on your license and required features.

    • Qodana (Ultimate): Based on IntelliJ IDEA Ultimate. Supports Java, Kotlin, Groovy, JavaScript, and TypeScript. Available as a native solution or Docker image.
    • Qodana Android (Ultimate): Based on IntelliJ IDEA Ultimate. Supports Java, Kotlin, Groovy, JavaScript, and TypeScript. Available as a Docker image.
    • Qodana Community (JVM): Based on IntelliJ IDEA Community Edition. Supports Java, Kotlin, and Groovy. Available as a native solution or Docker image.
    • Qodana Community Android: Based on IntelliJ IDEA Community Edition. Supports Java, Kotlin, and Groovy. Available as a Docker image.
  8. Choose a .NET linter for Qodana

    2025.2

    To analyze .NET code, you can choose between two different Qodana linters depending on your licensing and language requirements:

    %dotnet% (Rider-based)

    • Linter name: %dotnet-linter%
    • Docker image: %dotnet-image%
    • Based on: JetBrains Rider
    • Licenses: Ultimate and Ultimate Plus
    • Supported languages: C#, C/C++, VB.NET, JavaScript, TypeScript, F#
    • Deployment: Available as a native solution or a Docker image.

    %dotnet-co% (ReSharper-based)

    • Linter name: %dotnet-co-linter%
    • Docker image: %dotnet-co-image%
    • Based on: JetBrains ReSharper
    • Licenses: Community
    • Supported languages: C#, C/C++, VB.NET
    • Deployment: Available as a Docker image only.
  9. What is Qodana Native Mode?

    2025.2

    By default, Qodana runs linters using Docker-based Linux images. Native mode allows you to run specific linters directly on your host operating system (Linux, macOS, or Windows) without Docker.

    Why use Native Mode?

    • To handle private packages/dependencies.
    • To run on operating systems with incomplete Docker support.
    • To use the exact same environment, credentials, and dependency resolution used for building your projects.

    Supported Linters in Native Mode

    LinterLinter name
    JVM%jvm-linter%
    JVM Code Analysis%jvm-co-linter%
    PHP%php-linter%
    JavaScript%js-linter%
    .NET%dotnet-linter%
    Python%python-linter%
    Python Code Analysis%python-co-linter%
    Go%go-linter%
    IMPORTANT

    Native mode is currently in Early Access and may be unreliable or contain errors. Native mode is incompatible with Docker containers; you must choose either Docker mode or Native mode.

  10. What is FlexInspect and how does it work?

    2025.2

    FlexInspect allows you to develop custom code inspections specific to your project using the IntelliJ API and Kotlin. These inspections are written as .inspection.kts files and stored in an inspections directory within your project.

    IntelliJ IDEA reads these files, compiles the Kotlin code on the fly, and executes them. FlexInspect uses the Program Structure Interface (PSI), which is an Abstract Syntax Tree (AST) representation of your source code. By traversing the PSI tree, your inspection can identify specific code patterns, nodes, and structures (like classes, methods, or imports) to validate or flag.

  11. What is taint analysis and how does it work?

    2025.2

    Taint analysis is a security process that traces the flow of untrusted user input (called a source) through a program to see if it reaches sensitive operations (called a sink) without proper validation or sanitization. This helps identify vulnerabilities like SQL injection, XSS, command injection, and path traversal.

    Key components of the taint flow include:

    • Source: The origin of untrusted or tainted data.
    • Sink: A vulnerable function or operation that may be compromised by tainted data.
    • Passthrough: Functions that carry the taint status from input to output.
    • Sanitizer: Functions that transform data into a safe state, removing the taint.
    • Projection: A mechanism that shares the taint status across all arguments of a function call, ensuring the taint status of arguments is transferred to the return value.

    By default, if no specific configuration exists for a library function, a projection is applied, meaning the taint status of the arguments is passed to the return value.

  12. Combine Baseline and Quality Gate

    2025.2

    To manage technical debt effectively, combine the baseline and quality gate. This configuration ensures that Qodana only detects new problems (those not in the baseline) and fails the workflow if those new problems exceed the specified --fail-threshold.

    - name: Qodana Scan
      uses: %action-version%
      with:
        args: --baseline,qodana.sarif.json,--fail-threshold,<number-of-accepted-problems>
      env:
        QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}