What’s mining: search for duplicates in Ruby
It is always a pleasure to tell about new features! This time I’m glad to announce a brand new one that is coming in next RubyMine 1.5 EAP — “Locate duplicates”. It is another useful tool in RubyMine’s code analysis arsenal. Everyone has once faced with copy-paste problem: when you don’t use a refactoring such as extract method/module/variable for some reason but just do copy&paste. Your code begins to “smell”.
Locate duplicates is a helpful feature designed to assist you in writing safe, fast and error-free code.
Use Code | Locate Duplicates menu item to start it. You’ll see the Code Duplication Analysis Settings dialog where you can tune the intelligibility of the search.
Local variables, Fields, Methods, Literals can be anonymized. Do not show duplicates simpler than and Anonymize uncommon subexpressions simpler than options operate with some heuristic values complexity of found fragments of code. These thresholds are used to cut off obvious duplicates like local variables, field etc. You can change them later, but the defaults should fit pretty good for a start.
Results of this search are shown in a familiar diff view with code fragments to inspect the results.
You are welcome to try this in coming EAP build.
-JetBrains RubyMine Team
Subscribe to Blog updates
Thanks, we've got you!
RubyMine 2023.3 EAP Update
Hello everyone! We’re back with an update on the state of the 2023.3 Early Access Program. You can download the latest EAP build from our website, via the free Toolbox App, or by using snaps for Ubuntu. Here are the biggest highlights of this release: Performance improvements As we me…
The RubyMine 2023.3 Early Access Program Is Open!
Hello everyone, The third RubyMine Early Access Program of 2023 is underway! The key change in the first EAP build is an important indexing optimization. By refactoring our code base, we’ve doubled RubyMine’s indexing speed compared to v2023.1. This is particularly noticeable when working…
Performance Improvements in RubyMine 2023.1
Hello everybody, The new release is fast approaching, so it’s time to unveil the performance enhancements you can expect from RubyMine 2023.1. Faster code completion When developing and supporting RubyMine, we analyze a great load of anonymized usage data. A lot of recent data pointed to the fact t…
RubyMine 2023.1 EAP5 Is Out!
Hello everyone, RubyMine 2023.1 EAP5 is now available! Below you can find the most notable features in this build. We encourage you to try them out and share your feedback in the comments or in our issue tracker. Migration of Ruby code to the Symbol API In order to improve code insight actions such…