IntelliJ IDEA 15 dynamically warns developers of code duplicates
Some fresh news in from the gang developing IntelliJ IDEA 15, with the expansion of the handy ‘Locate Duplicates’ feature. The new addition also gives options for a quick fix if needed. Catch cloned code on-the-fly!
An average codebase usually contains significantly more code copies than you think. To eliminate this and make code more concise and stable, IntelliJ IDEA has introduced the Locate Duplicates feature. JetBrains Product Manager Andrey Cheptsov recently put the spotlight on the new addition on the JetBrains blog.
In recent weeks, users of the EAP version of the integrated development environment IntelliJ IDEA have been immersing themselves in newly available features. After having an initial play around with IntelliJ IDEA 15, the Locate Duplicates feature has now be expanded and improved upon.
The latest IntelliJ IDEA 15 EAP Build now provides a more dynamic application to the inspection of duplicate code, or as Cheptsov says, takes “duplicates analysis to an entirely new level”. If a user has either unknowingly or accidentally created a duplicate, the system will tell you outright.
The analysis also includes quick-fixes and allows for easy navigation to the appropriate code or the choice to display in a tool window.
The new inspection to check for copies is called Duplicated Code and is enabled by default. To toggle it, go to Settings → Editor → Inspections. You can also run it on an entire project (or a custom scope) any time via Run Inspection by Name.
However, a warning for the non-Java types: The feature is currently only available for Java, due to the relatively early stages of development that Intellij IDEA 15 finds itself in. Cheptsov says that rare false positives could be expected and to report them if they pop up.
Some other fixes at this stage of development include a cleanup of the big, blurry fonts and icons in the Editor on Linux, and the ‘not working’ Terminal on Windows 10 issue.
Other features of the latest builds can the found over on the changelog.