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
On the main menu, choose
.In the Available Duplicate Reports dialog, click the desired report name.
To view the duplicates analysis results in the Duplicates tool window
On the main menu, choose
.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 F4 keyboard shortcut.
, or use theFor 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
. You will be navigated to the particular duplicate.
To configure duplicates highlighting
Open the Color and Fonts dialog (
).Select the desired color scheme.
In the General tab, select Duplicates from server, and configure the style and color of highlighting.