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:
On the main menu, choose TeamCity | Code Duplicates | Show in editor.
In the Available Duplicate Reports dialog, click the desired report name.
tip
Choosing No server-side duplicates in the dialog disables highlighting of the server-side code duplicates.
On the main menu, choose TeamCity | Code Duplicates | Open Tool Window.
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
In the Duplicates tool window, select the desired node.
On the context menu of the selection, choose Jump to source, or use the F4 keyboard shortcut.
For detailed information on the Duplicates tool window, refer to the IntelliJ IDEA Web Help.
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.
Open the Color and Fonts dialog (File | Settings | IDE Settings | Editor | Colors and Fonts | General).
Select the desired color scheme.
In the General tab, select Duplicates from server, and configure the style and color of highlighting.
Thanks for your feedback!