Qodana 2021.2 Help

Clone Finder TeamCity plugin

official project

The Qodana Clone Finder plugin for TeamCity lets you extend Qodana static analysis with the Clone Finder functionality.

Quick start

Use TeamCity VCS roots to add all required project source to the build.

With the plugin installed, add the Qodana runner to your build.

Qodana Build Runner

Make sure the Clone Finder option is enabled and provide the following required parameters:

  • Queried project: the project source code

  • Referenced project directories: one or more projects to compare against

  • Languages: languages to perform search

Qodana Clone Finder Build Runner Settings

The example above shows that the project phpunit will be compared to the project pest and the analysis will be performed for the PHP language.

In this example, VCS roots are configured with the following mappings:

  • phpunit sources will be checked out to the phpunit folder (=>phpunit)

  • pest sources will be checked out to the pest folder (=>pest)

If you use DSL to configure your build, add this section to your build configuration description:

steps { ... qodana { ... param("clonefinder-languages", "PHP") param("clonefinder-languages-container", "PHP") param("clonefinder-docker-image", "custom") param("clonefinder-queried-project", "phpunit") param("clonefinder-custom-docker-image", "jetbrains/qodana-clone-finder") param("clonefinder-enable", "true") param("clonefinder-reference-projects", "pest") } }

After the build is finished, you will see the Qodana tab on the Build Overview page. Note that the tab can be hidden under the More section. To see it in all builds with this step, mark the Qodana tab with a star.

Almost all UI features of the Qodana tab are similar among all Qodana tools we provide. They are sufficient for exploring the results of a single run, but the tab in TeamCity offers even more. You can easily compare two builds and focus on the difference. Now, the comparison is limited to a single build configuration, but we are working on providing the cross-configuration option as well.

In the inspection profile, you will find two inspections provided by Clone Finder:

  • Code Fragments/Clone

  • Code Fragments/Clone with license mismatch

Check the Qodana UI to see all features available in the UI.

License

By using Qodana Clone Finder TeamCity plugin, you agree to the JetBrains EAP user agreement and JetBrains privacy policy.

Last modified: 09 September 2021