AntiCopyPaster is an IntelliJ IDEA plugin, implemented to detect and refactor duplicate code interactively as soon as a duplicate is introduced. The plugin only recommends the extraction of a duplicate when it is worth it. In contrast to current Extract Method refactoring approaches, our tool seamlessly integrates with the developer's workflow and actively provides recommendations for refactorings. This work extends our tool to allow developers to customize the detection rules, i.e., metrics, based on their needs and preferences. The plugin and its source code are publicly available on GitHub at https://github.com/refactorings/anti-copy-paster. The demonstration video can be found on YouTube: https://youtu.be/ Y1sbfpds2Ms.
翻译:AntiCopyPaster 是一款IntelliJ IDEA插件,旨在重复代码引入时即时检测并交互式重构。该插件仅在值得提取时建议对重复代码进行提取。与当前的提取方法重构方法不同,我们的工具与开发者的工作流无缝集成,并主动提供重构建议。本工作扩展了该工具,允许开发者根据自身需求和偏好自定义检测规则(即指标)。该插件及其源代码已在GitHub上公开(https://github.com/refactorings/anti-copy-paster),演示视频可在YouTube上查看(https://youtu.be/Y1sbfpds2Ms)。