Configuration overview
You have the following configuration approaches:
Configuring Qodana via a YAML-formatted file, typically named
qodana.yaml, is suitable for settings that require lengthy commands, such as inspection configuration, bootstrap, and other settings that are not convenient to configure otherwise. Once a YAML configuration is saved, you can reuse it across different instances of Qodana.Using configuration capabilities of the tools that are running Qodana like Docker, Qodana CLI, IDEs, and CI/CD tools.
Settings like linter or quality gate can be set up using both methods. In this case, tool configurations override configurations saved in a YAML-formatted file.
Configuring inspection profiles lets you specify inspections and paths in your codebase that should be used for analysis by Qodana. You can configure and use the existing inspection profiles or create your custom profiles from scratch.
If the existing inspections do not fit your needs, you can develop your own inspections using the FlexInspect feature, Roslyn analyzers, or structural search patterns, which you can apply in your inspection profile. Alternatively, you can use plugins that will extend the inspection capabilities of Qodana or develop your own plugin.
Finally, you can override the default JDK versions shipped with Qodana, see the Configuring the JDK section for details.
Performance optimization
To make Qodana work better during the project configuration stage, you can follow the recommendations below.
First of all, specify the --cache-dir option, the use-caches input argument in case of CI/CD integrations, or the /data/caches directory in the Docker container of a linter after the first linter analysis. Cache contains data related to project structure, indexes, dependencies, which makes subsequent analyses faster. However, in case of significant and disruptive changes of your project or Qodana version updates, it may be beneficial to reset cache.
You can also store your IntelliJ IDEA setting files in the .idea folder, for example:
The
modules.xmlfile improves project structure parsingThe language-specific files like
kotlinc.xmlorphp.xmlprovide information about compiler versions and optionsThe
*.imlfiles contain information about directories
Make sure that your project is correctly configured by looking at the <results-dir-artifact>/projectStructure directory after the first analysis. Also, make sure that:
The project imports work correctly
The tooling that you use matches the configured versions
Project dependency pooling works correctly, as it should be done only once if you are using cache
Analyses do not show sanity problems because they are a key indicator of configuration issues
Docker image paths
Path | Description |
|---|---|
| Root directory of the project to be analyzed |
| Directory to store the analysis results |
| Directory containing the IDE distribution |
| Directory where the IDE contains configuration |
| Used if a profile was not previously configured either via the CLI or the |
For Maven and Gradle projects, Qodana uses the following directories to access third-party libraries:
Path | Description |
|---|---|
| Maven project dependencies |
| Gradle project dependencies |
Mounting these directories saves Qodana from downloading all dependencies again while using these linters: