TeamCity Plugin for IntelliJ Platform Help 2021.2 Help

Working with Duplicates

TeamCity provides a powerful mechanism for finding redundant and seemingly harmless pieces of code that may eventually lead to an unmanageable project code base.

The TeamCity plugin for IntelliJ Platform enables you to examine results of duplicates analysis without leaving the IDE. The results can be reviewed in either the editor or in the Duplicates tool window and help you keep the code base better structured and controlled.

Setting up a build configuration with the Duplicates finder build runner ensures that all of the integrated code is constantly checked for duplicates.

Any code duplicates found on the server-side are loaded into the editor and highlighted with a particular color which can be configured in the Colors and Fonts dialog.

This section describes how to:

To display the results of duplicate analysis in the editor

  1. On the main menu, choose TeamCity | Code Duplicates | Show in editor.

  2. In the Available Duplicate Reports dialog, click the desired report name.

To view the duplicates analysis results in the Duplicates tool window

  1. On the main menu, choose TeamCity | Code Duplicates | Open Tool Window.

  2. In the Choose Project to Browse Duplicates dialog, click the desired project name.

    The Duplicates tool window opens.

To navigate from the report in the Duplicates tool window to the problem location in the source code

  1. In the Duplicates tool window, select the desired node.

  2. On the context menu of the selection, choose Jump to source, or use the F4 keyboard shortcut.

    img

    For detailed information on the Duplicates tool window, refer to the IntelliJ IDEA Web Help.

To view the duplicates in the source code

  • Navigate to the issue found in the editor, click the light bulb, and then click View Duplicates. You will be navigated to the particular duplicate.

    img

To configure duplicates highlighting

  1. Open the Color and Fonts dialog (File | Settings | IDE Settings | Editor | Colors and Fonts | General).

  2. Select the desired color scheme.

  3. In the General tab, select Duplicates from server, and configure the style and color of highlighting.

Last modified: 04 April 2024