Qodana Community for Android Docker image
The Docker image for the Qodana Community for Android linter is provided to support different usage scenarios:
Running the analysis on a regular basis as part of your continuous integration (CI-based execution)
Single-shot analysis (for example, performed locally).
If you are familiar with IntelliJ IDEA code inspections and know what to expect from the static analysis outside the editor, you can skip the following section and continue from Using an existing profile.
If you are just starting in the field, we recommend proceeding with the default setup we provide. You will see the results of the most common checks performed on your code base. Later, you can adjust them to suit your needs better.
Quick start with the recommended profile
Run analysis locally
Pull the image from Docker Hub (only necessary to update to the
latestversion):docker pull jetbrains/qodana-jvm-android
Run the following command:docker run --rm -it -p 8080:8080 \ -v <source-directory>/:/data/project/ \ -v <output-directory>/:/data/results/ \ jetbrains/qodana-jvm-android --show-report
output-directoryare full local paths to, respectively, the project source code directory and the analysis results directory.
This command will run the analysis on your source code and start the web server to provide a convenient view of the results. Open
http://localhost:8080 in your browser to examine the found problems and performed checks. Here you can also reconfigure the analysis. See the User interface overview for details. When done, you can stop the web server by pressing Ctrl-C in the Docker console.
If you don't need the user interface and prefer to study raw data, use the following command:
If you run the analysis several times in a row, make sure you've cleaned the results directory before using it in
docker run again.
Run analysis in CI
Use the following command as a task in a generic Shell executor:
output-directory are full paths to, respectively, the project source code directory and the analysis results directory.
Consider using a fail threshold to make the build fail when a certain number of problems is reached, and baseline mode, in which each new Qodana Community for Android run is compared to some initial run selected as a "baseline". Running as non-root is also supported.
Using an existing profile
This section is intended for users familiar with configuring code analysis via IntelliJ IDEA inspection profiles.
You can pass the reference to the existing profile in multiple ways. Here are some examples:
Mapping the profile to
/data/profile.xmlinside the container:docker run --rm -it -p 8080:8080 \ -v <source-directory>/:/data/project/ \ -v <output-directory>/:/data/results/ \ -v <inspection-profile.xml>:/data/profile.xml jetbrains/qodana-jvm-android --show-report
Using the name of the profile in your project
.idea/inspectionProfiles/folder.docker run --rm -it -p 8080:8080 \ -v <source-directory>/:/data/project/ \ -v <output-directory>/:/data/results/ \ jetbrains/qodana-jvm-android --show-report --profile-name custom-profile
Configure via qodana.yaml
qodana.yaml file will be automatically recognized and used for the analysis configuration, so that you don't need to pass any additional parameters.
Paid plugins are not yet supported. Each vendor must clarify licensing terms for CI usage and collaborate with us to make it work.
Any free IntelliJ platform plugins or your custom plugin can be added by mounting it to the container plugins' directory using the following command:
Refer to the technical guide for more details.
According to the JetBrains EAP user agreement, we can use third-party services to analyze the usage of our features to further improve the user experience. All data will be collected anonymously. You can disable the reporting of usage statistics by adjusting the options of the Docker command you use. Refer to the technical guide for details.