Qodana 2022.3 Help

CircleCI

CircleCI is a cloud-based CI/CD system. You can build Qodana into your CircleCI pipelines using the CircleCI Qodana orb as described in this procedure:

  1. Create the .circleci/config.yml file and specify the CircleCI version:

version: 2.1
  1. Below the CircleCI version, add the orbs stanza, and then specify the qodana element along with the Qodana version:

orbs: qodana: jetbrains/qodana@2022.3.3

If necessary, repeat this step for all required workflows and jobs.

  1. In the CircleCI UI, opt in to use uncertified orbs.

Examples

Using this configuration sample, you can scan your project with Qodana with the default configuration parameters:

version: '2.1' orbs: qodana: jetbrains/qodana@2022.3.3 jobs: code-quality: machine: image: 'ubuntu-2004:current' steps: - checkout - qodana/scan workflows: main: jobs: - code-quality: context: qodana

This configuration sample invokes the args parameter to run the specific linter like jetbrains/qodana-jvm:

version: 2.1 orbs: qodana: jetbrains/qodana@2022.3.3 jobs: code-quality: machine: image: 'ubuntu-2004:current' steps: - checkout - qodana/scan: args: -l jetbrains/qodana-jvm # use space to separate arguments workflows: main: jobs: - code-quality: context: qodana

Qodana Cloud

To forward inspection results to Qodana Cloud, all you need to do is to create the QODANA_TOKEN project variable and save the project token as its value.

After the token is set for analysis, all Qodana job results will be uploaded to your Qodana Cloud project.

Qodana Cloud

Commands and parameters

The CircleCI Qodana orb provides the scan command to let you inspect your project and report the results.

This table contains the list of optional string parameters that can be additionally used with the scan command.

Parameter

Description

Default value

additional-cache-hash

Customize the generated cache hash

<< pipeline.git.revision >>

args

Additional arguments of the Qodana CLI scan command

No default value

artifact-name

Name of the artifact resulting from scanning project with Qodana, used for uploading of scan results

qodana-report

cache-dir

Directory for Qodana caches

/tmp/cache/qodana

results-dir

Directory for storing the results of scanning

/tmp/qodana/results

Last modified: 08 February 2023