![]() In the Code Duplication Analysis Settings dialog, select the languages that you want to analyze.įor each language, check the options to define the analysis preferences. In addition, you can include test sources into the analysis, too. In the Specify Code Duplication Analysis Scope dialog, specify the analysis scope: whole project, current file, uncommitted files (for the projects under version control), or some custom scope. This option has been deprecated and is going to be removed soon.įrom the main menu, select Code | Analyze Code | Locate Duplicates. The value of units can be calculated as follows: units = 2* +. Alter the number of units to enable duplicate detection for smaller code fragments. In the Python context, the constructs less than 45 units are ignored by default. In the Do not show duplicates simpler than field for the necessary file type, set the size of duplicated language constructs to be detected. In the inspection options, select whether you want to view duplicates only within the same file or across the entire project. Select the Duplicated code fragment inspection under the General node. ![]() Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections. Result2 = (-m - return_type_of_sqrt) / (2 * n) Result1 = (-m + return_type_of_sqrt) / (2 * n) Return_type_of_sqrt = math.sqrt(m ** 2 - 4 * n * k) Root2 = (-b - return_type_of_sqrt) / (2 * a) Root1 = (-b + return_type_of_sqrt) / (2 * a) Return_type_of_sqrt = math.sqrt(b ** 2 - 4 * a * c) Additionally, select the Variable or identifier names/ Function or field names/ Constant values checkboxes to define whether two identical entities that use different names should be treated as duplicates.įor example, if the Variable or identifier names and Function or field names are enabled, the following two functions will be considered duplicate: On the Duplicates page that opens, select the file types, to which duplicates analysis should apply. Press Ctrl+Alt+S to open the IDE settings and select Editor | Duplicates. If you stumble upon an existing duplicate or somehow create one by writing or pasting code, P圜harm reports a problem and suggests quick-fixes that let you navigate to the detected duplicates, or view all of them in the Duplicates tool window. The analysis is performed by means of the Duplicated code fragment inspection, which you can find under the General node in the Editor | Inspections page of the IDE settings Ctrl+Alt+S. P圜harm enables spotting duplicates on the fly. Analysis results are displayed directly in the editor or in the dedicated tab of the Duplicates tool window. This range can be a single file, a project, a module, or a custom scope. ![]() P圜harm helps you find repetitive blocks of code in a certain range.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |