PyCharm Tips & Tricks #12: Duplicate code with Cmd + D and find duplicates automatically

Опубликовано: 10 Октябрь 2024
на канале: CodeOpsTech
1,063
2

You can duplicate a section of the code easily. Select a code block and press Cmd + D and "voila!" the code segment is duplicated.

However, we need to be careful with duplication. If you want to find out duplicates in the code, you can choose "Code | Locate Duplicates" and a box will show the duplicated code blocks and you can navigate through them. No need to install a separate tool for finding code duplicates!