Find duplicated code
How is the work going on this?
I see that there is a Locate Duplicates menu item under the Analyze tab.
In it's current state, it doesn't seem to provide any sort of refactoring
capability as was suggested in the "Weekly progress news" at the end of last
month.
I know, I am being a little impatient, but I think that this will be an
extremely useful feature.
Tim
Please sign in to leave a comment.
Tim Haley wrote:
I think refactoring suggestions won't be implemented in 4.1. Sorry. On the other hand I feel dupLocator itself is quite
useful feature.
--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Maxim Shafirov (JetBrains) wrote:
But I've used the Extract Method refactoring in 2013 and it's suggested
to replace duplicate code.
Ciao,
Gordon
--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919
UI-wise, it's pretty much a mess. "Costs" are described, but without any indication of what they might mean, how you might wish to limit them, or why. The results reported are pretty difficult to interpret, with no context and only the first line of duplicates shown (often, this is just a "{" for me). Refactoring support seems missing, but that's understandable.
That said, the actual search for duplicates seems both thorough and amazingly quick, and the information returned very helpful in code reviews. I like it a lot, and think it will be a very valuable innovation, but I'll like it even more with a comprehensible UI.
--Dave Griffith
Gordon Tyler wrote:
>> I think refactoring suggestions won't be implemented in 4.1. Sorry. On
>> the other hand I feel dupLocator itself is quite useful feature.
Right, but that only looks in the current files. And duplication criteria is very different.
--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Dave Griffith wrote:
You're quite right there. As always though. Any UI ideas are greatly appreciated.
P.S. you may highlight duplication fragment by pressing Enter in usage view on the selected usage node.
--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
I used to work with these guys.]]>
I'm still using the SimScan tool developed by my last company
(http://blue-edge.bg/download.html) I've tried the IDEA's duplication
search, but find it somewhat lacking.
The most important is that the SimScan returns IMHO better results and
the display is much better... Also I miss the ability to mark
duplicate groups to ignore.
my 2c,
dimiter
Maxim Shafirov (JetBrains) wrote:
>> Maxim Shafirov (JetBrains) wrote:
>>
>>> I think refactoring suggestions won't be implemented in 4.1. Sorry. On
>>> the other hand I feel dupLocator itself is quite useful feature.
>>
>>
>> But I've used the Extract Method refactoring in 2013 and it's suggested
>> to replace duplicate code.
>>
>> Ciao,
>> Gordon
>>
Maxim obviously meant - in the current file (the file you extract method
in).
Indeed, the main difference being that when method is extracted, "Extract
Method" looks for exact matches that can be 100% (ok, probably 99%) safely
replaced with call to extracted method.
DupLocator allows for some diversion in duplicates it finds.
Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"