List of CLI options
This section explains how you can configure Qodana linters using configuration of the tools that will be used for running like Docker, GitHub Actions, GitLab CI/CD, and other tools.
In several cases, settings mentioned in this section are also available for configuring via the qodana.yaml file, which is also mentioned in this section.
Types of options
You can configure Qodana using three types of options as shown below.
Option type | Example |
|---|---|
Requires the equal sign ( |
|
Requires the space character ( |
|
Requires no argument |
|
Here is the example command that invokes all these options:
In the runner configuration, find the field and specify the path to the plugin file:
Configure projects
Option | Description | The default value |
|---|---|---|
| Set a custom configuration file instead of | None |
| Force initialization, overwrite the existing valid | None |
| Specify the root directory of your project |
|
You can invoke these options in Qodana CLI using the qodana init <options> command.
Analyze projects
Option | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| In place of
Also, you can use any Docker image that has Qodana. | ||||||||||||||||||||||||||||||
| In place of
| ||||||||||||||||||||||||||||||
| Define whether analysis will be performed within a Docker container. If set to If set to The default value is defined dynamically based on the analysis of the current environment and project. Native mode is currently available for the following Qodana linters:
| ||||||||||||||||||||||||||||||
| Root directory of the analyzed project. The default value is | ||||||||||||||||||||||||||||||
| Path to the root of the Git repository. This directory must be the same as | ||||||||||||||||||||||||||||||
| Override the directory for saving Qodana analysis reports. The default value is | ||||||||||||||||||||||||||||||
| Override the cache directory. The default value is | ||||||||||||||||||||||||||||||
| Override the directory for saving Qodana HTML reports. The default value is | ||||||||||||||||||||||||||||||
| Print in the CLI output all problems found by Qodana | ||||||||||||||||||||||||||||||
| Generate a SARIF-formatted Code Climate report supported by GitLab CI/CD. The report will be saved in the directory specified by the | ||||||||||||||||||||||||||||||
| Generate a Code Insights report supported by Bitbucket Cloud. By default, this option is enabled if Qodana is being run in the Bitbucket Pipelines | ||||||||||||||||||||||||||||||
| Clear the local Qodana cache before running analyses | ||||||||||||||||||||||||||||||
| Serve an HTML report on the port specified by the | ||||||||||||||||||||||||||||||
| Port to serve the report. The default value is | ||||||||||||||||||||||||||||||
| Port to serve the report | ||||||||||||||||||||||||||||||
| Set a custom configuration file instead of | ||||||||||||||||||||||||||||||
| Unique report identifier (GUID) to be used by Qodana Cloud. The default value is | ||||||||||||||||||||||||||||||
| Provide the path to an existing SARIF report to be used in the baseline state calculation | ||||||||||||||||||||||||||||||
| Include baseline problems that are marked absent in the output report | ||||||||||||||||||||||||||||||
| Go through the full commit history and run the analysis on each commit. If combined with | ||||||||||||||||||||||||||||||
| Reset Git and run analysis only for the files modified since the given commit. If combined with the | ||||||||||||||||||||||||||||||
| Set the number of problems that will serve as a quality gate. Once the quality gate threshold is reached, the analysis will be terminated with a non-zero exit code | ||||||||||||||||||||||||||||||
| Skip the inspections configured by the | ||||||||||||||||||||||||||||||
| Specify the directory inside the | ||||||||||||||||||||||||||||||
| Specify the VCS root directory for your project. This option is required for Git-related operations | ||||||||||||||||||||||||||||||
| Specify the directory inside the Files and directories contained in the outside directory like | ||||||||||||||||||||||||||||||
| Specify the profile name | ||||||||||||||||||||||||||||||
| Specify the path to the profile file | ||||||||||||||||||||||||||||||
| Set this option to | ||||||||||||||||||||||||||||||
| Override the run scenario of Qodana. Currently, the following run scenarios are available:
| ||||||||||||||||||||||||||||||
| Specify the directory that contains code coverage data for analysis | ||||||||||||||||||||||||||||||
| Apply all available Quick-Fix strategies including cleanup, see the Quick-Fix section for details | ||||||||||||||||||||||||||||||
| Run the | ||||||||||||||||||||||||||||||
| Set a JVM property to be used while running Qodana. Use the | ||||||||||||||||||||||||||||||
| Generate an HTML report. This option is enabled by default | ||||||||||||||||||||||||||||||
| Set Qodana analysis time limit in milliseconds. Once reached, the analysis will be terminated and the process will exit with the | ||||||||||||||||||||||||||||||
| Override the default | ||||||||||||||||||||||||||||||
| Set the hash of the commit that will act as a base for comparison in a change analysis | ||||||||||||||||||||||||||||||
| Set the hash of the commit that will act as an end in a change analysis. This lets you analyze only files changed between the | ||||||||||||||||||||||||||||||
| Override the default run scenario by launching incremental analysis in reverse order. This lets you skip analysis of the main codebase if the incremental analysis finds no issues. | ||||||||||||||||||||||||||||||
| Disable sending anonymous statistics | ||||||||||||||||||||||||||||||
| Specify the path to the | ||||||||||||||||||||||||||||||
| Set additional arguments, see the C / C++ section for details | ||||||||||||||||||||||||||||||
| Set a relative path to a solution file, see the .NET section for details | ||||||||||||||||||||||||||||||
| Set a relative path to a project file, see the .NET section for details | ||||||||||||||||||||||||||||||
| Specify the build configuration, see the .NET section for details | ||||||||||||||||||||||||||||||
| Specify the build platform, see the .NET section for details | ||||||||||||||||||||||||||||||
| Skip project building before analyses, see the .NET section for details | ||||||||||||||||||||||||||||||
| Define environment variables for the Qodana container, multiple variables can be specified. For security reasons, Qodana CLI does not read environment variables from the host operating system, so all variables required by Qodana should be specified explicitly. | ||||||||||||||||||||||||||||||
| Define additional volumes for the Qodana container, multiple volumes can be specified. For example, | ||||||||||||||||||||||||||||||
| User to run Qodana container as. Please specify the user ID – | ||||||||||||||||||||||||||||||
| Skip pulling the latest Qodana container |
You can invoke these options in Qodana CLI using the qodana scan <options> command.
Send analysis reports to Qodana Cloud
Option | Description |
|---|---|
| The unique report identifier (GUID) to be used by Qodana Cloud. The default value is |
| Set a custom configuration file instead of |
| Override the linter which report will be used for sending to Qodana Cloud |
| Root directory of the project which report will be sent to Qodana Cloud. The default value is |
| Override the directory for saving Qodana HTML reports. The default value is |
| Override the directory that will be used for sending a Qodana report from. The default value is |
You can invoke these options in Qodana CLI using the qodana send <options> command.
View reports
Option | Description |
|---|---|
| Set a custom configuration file instead of |
| Open the report directory only without serving it |
| Override the linter which report should be viewed |
| Specify the port to serve a report. The default value is |
| Root directory of the project which report should be viewed. The default value is |
| Override the directory to save a Qodana HTML report. This is the directory that contains the |
| Override the directory for saving analysis reports. The default value is |
You can invoke these options in Qodana CLI using the qodana show <options> command.
View SARIF-formatted files
Option | Description | Default setting |
|---|---|---|
| Path to the SARIF-formatted file |
|
You can invoke these options in Qodana CLI using the qodana view <options> command.
Count contributors
To collect information about contributors to your project, you can run Qodana using the following options.
Option | Description | Default setting |
|---|---|---|
| The number of days in the past that should be used for calculating the number of active contributors | 90 |
| The output format. Available values are |
|
| The Directory of the project that can be specified multiple times to analyze multiple projects |
|
You can invoke these options in Qodana CLI using the qodana contributors <options> command.
View project statistics
You can use these options to view information about your project, such as languages and lines of code.
Option | Description |
|---|---|
| The output format that accepts the |
| The project directory. This option can be specified multiple times to analyze multiple projects. If not specified, the current directory will be used |
You can invoke these options in Qodana CLI using the qodana cloc <options> command.
Pull a Qodana image
Using these options, you can pull the Qodana linter that you would like to employ.
Option | Description |
|---|---|
| Set a custom configuration file instead of |
| Specify the image that you would like to pull |
| Specify the linter that you would like to pull |
| The root directory of the analyzed project. If not specified, the current directory will be used |
You can invoke these options in Qodana CLI using the qodana pull <options> command. Qodana CLI takes information about the linter using either the qodana.yaml file configuration or the --linter option.
Generate an autocompletion script
Using these options, you can generate an autocompletion script for a specific shell.
Command | Description |
|---|---|
| Generate the autocompletion script for bash |
| Generate the autocompletion script for fish |
| Generate the autocompletion script for PowerShell |
| Generate the autocompletion script for zsh |
You can invoke these options in Qodana CLI using the qodana completion <options> command.
Configure update checking and log levels
Option | Description |
|---|---|
| Disable checking and notification about new versions of Qodana CLI |
| Change log level in the output of Qodana CLI. For example, you can set |