Qodana Clone Finder Docker Image
We provide a Docker image for the Clone Finder linter 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 ).
Run analysis locally
Pull the image from Docker Hub (necessary to use the
latestversion):docker pull jetbrains/qodana-clone-finder
Run the following command:docker run --rm -it -p 8080:8080 \ -v <queried-project-directory>/:/data/project/ \ -v <reference-projects-directory>/:/data/versus/ \ -v <output-directory>/:/data/results/ \ jetbrains/qodana-clone-finder --show-report
<output-directory> are full local paths to the directories that contain, respectively, the project source code, one or more projects to compare against, and the analysis results.
Example of project structure:
This command runs the analysis on your source code and starts 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 UI section of this guide for details. When done, you can stop the web server by pressing
Ctrl-C in the Docker console.
In case 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.
If reference projects are not located under the same root directory, you can use the following options to map them inside the container:
-v "<local path to project for comparison>/<project name>:/data/versus/<project name>"
Run analysis in CI
Run the following command as a task in a generic Shell executor:docker run --rm -it \ -v <queried-project-directory>/:/data/project/ \ -v <reference-projects-directory>/:/data/versus/ \ -v <output-directory>/:/data/results/ \ jetbrains/qodana-clone-finder
<output-directory> are full paths to the directories that contain, respectively, the project source code, one or more projects to compare against, and the analysis results.
The content of
<output-directory> is described in Clone Finder Output. Consider using fail-threshold to make the build fail on reaching a certain number of problems. Running as non-root is also supported.
Example for GitHub Workflow (
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.