Qodana for PHP Docker image configuration
Docker image paths
Root directory of the project to be analyzed
Directory to store the analysis results, needs to be empty before running Qodana for PHP
PhpStorm distributive directory
PhpStorm configuration directory
Used if a profile was not previously configured either via the CLI or the
Docker images can be configured using several CLI options. All these options can be divided into three groups.
The first group requires the equal sign (
=) to be placed between the option name and its argument like
The second group uses the space character (
The third group of options does not require any arguments to be supplied with, as you can see it in case of the
You can run the
docker run jetbrains/qodana-php command to see the list of options in the CLI.
Root directory of the inspected project (default: current working directory
Directory to save Qodana inspection results to (default:
Directory to save an HTML report to (default:
Cache directory (default:
Directory inside the
Qodana profile can be configured using these CLI options. Alternatively, you can configure Qodana using the
qodana.yaml file as described in the Configure profile section.
Skip running the inspections configured by the
Profile name defined in the project. Note that the name of the profile does not necessarily match the name of the containing file stored in
Absolute path to the profile file.
Absolute path to the fallback profile file. This option is applied in case the profile was not specified using any available options.
Run Qodana in the baseline mode. Provide the path to an existing SARIF report to be used in the baseline state calculation.
Include in the output report the results from the baseline run that are absent in the current run.
Generate HTML report.
Serve HTML report on port 8080.
Set a JVM property to be used while running Qodana using the
Set the number of problems that will serve as a quality gate. If this number is reached, the inspection run is terminated.
Inspect uncommitted changes and report new problems.
Override the default run scenario (default:
Send the inspection report to Qodana Cloud, requires the
Qodana Cloud integration token.
Unique report identifier (GUID) to be used by Qodana Cloud.
Examples of execution tuneup
Override the default inspection profile
If no profile is specified, the default
qodana.recommended profile is used. For more options of how to specify a profile, see Order of resolving a profile. For more about available profiles, see Set up a profile.
Save a report as HTML
By default, the HTML report is stored in a separate
report/ subdirectory under the
results directory. This location could be configured with
Display a report in HTML
After the inspection is finished, the container will not exit and will listen on port
8080. You can connect to
http://localhost:8080 to see the results. To stop the web server, press Ctrl-C in the Docker console.
Change the Heap size
By default, Heap size is set to 80% of the host RAM.
Log INFO messages to STDOUT
The default log level for STDOUT is
Use a different 'idea.properties' file
Turn off user statistics
To disable the reporting of usage statistics, adjust the
You can add any free IntelliJ platform plugins or your custom plugin by using the following command:
To optimize the most common cases, some bundled plugins are disabled by default. You can check the whole list of disabled plugins in
The PHP and its libraries'/frameworks' plugins are enabled by default. plugins are enabled by default.
To change the plugins list, do any of the following:
disabled_plugins.txtby mounting your own file:docker run ... -v $empty_file$:/root/.config/idea/disabled_plugins.txt \ jetbrains/qodana-php
Use IDE properties
Qodana for PHP lets you check only changed files:
You can adjust the
idea.required.plugins.id value and keep only the VCS plugin suitable for your project.
Run in baseline mode
In baseline run mode, each new Qodana for PHP run is compared to some initial run selected as a "baseline". This can help in situations when you have no possibility to fix old problems and rather want to prevent the appearance of new ones.
<baseline-path> is the path to a
qodana.sarif.json file from an earlier run. If the
--baseline-include-absent option is provided, the inspection results will include absent problems, that is the problems detected only in the baseline run but not in the current run.
After the inspection is finished, Qodana for PHP displays the summary of the current project state compared to the baseline.
where the detected problems are aggregated as follows:
new: The problem was detected only in the current run but not in the baseline run.
absent: The problem was detected only in the baseline run but not in the current run.
unchanged: The problem was detected both in the current run and in the baseline run.
The SARIF output report will contain the per-problem information on the baseline state.
Set a quality gate
Qodana for PHP lets you configure a "quality gate", that is, the number of problems that will act as a threshold. If the threshold number is reached, the inspection run is terminated.
When running in baseline mode, a threshold is calculated as the sum of new and absent problems. Unchanged results are ignored.
Run as non-root
By default, the container is run as the
root user so that Qodana for PHP can read any volumes bind-mounted with the project and write the results. As a result, files in the
results/ folder are owned by the
root after the run.
To avoid this, you can run the container as a regular user:
Note that in this case the
results/ folder on host should already be created and owned by you. Otherwise, Docker will create it as
root and Qodana for PHP will not be able to write to it.
You can decrease the time for a Qodana for PHP run by persisting cache from one run to another. For example, package and dependency management tools such as Maven, Gradle, npm, and Yarn keep a local cache of downloaded dependencies.
By default, Qodana for PHP would save caches to folder
/data/cache inside container. This location could be changed via
--cache-dir cli argument. The data inside is per-repository, so you can pass cache from
branch-a to build checking
branch-b. In this case, only new dependencies would be downloaded, if they were added.
Example for local run:
In this case mapping the same
<cache-directory> would speed up the second run.
Override the default run scenario
You can override the standard Qodana run scenario by using the
--script option. By default, Qodana employs the
default scenario, which is equivalent to running:
Order of resolving a profile
Qodana for PHP checks the configuration parameters for resolving the inspection profile in this order:
Profile with the name
%name%from the command-line option
Profile by the path
%path%from the command-line option
Profile with the name
Profile by the path
Profile mounted to
Fall back to using the default