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


7 comments
Comment actions Permalink

Tim Haley wrote:

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

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!"

0
Comment actions Permalink

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

--
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

0
Comment actions Permalink


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

0
Comment actions Permalink

Gordon Tyler 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

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!"

0
Comment actions Permalink

Dave Griffith wrote:

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

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!"

0
Comment actions Permalink

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

0
Comment actions Permalink

Maxim Shafirov (JetBrains) wrote:

Gordon Tyler 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
>>

Right, but that only looks in the current files.


Maxim obviously meant - in the current file (the file you extract method
in).

And duplication criteria is very different.


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!"

0

Please sign in to leave a comment.