"Find similar code" usage / examples?

Hi there,

Realizing that I was typing code very similar to other code elsewhere, I wanted to try the "Find Similar Code" feature.

Unfortunately, it didn't work the way I expected.

I highlighted the smallest portion of code which I expected to find duplicates of. The duplicates I expected to find would match in all but the name of a single variable. I then right-clicked and chose "Find Similar Code".

What I expected was to see the duplicates. What I got was that there was only one set of "similar" code.

A manual search (using Find Usages on a method called by the duplicated code block showed that there were indeed examples of "similar" code in many places (about 20!)

I then tried to edit the pattern for the "similar code" search, but that also did not do what I expected. I guessed that I would need to replace the variable name with some sort of placeholder, but none of the placeholders I tried worked.

Finally, I tried looking in the help file, but could find no reference to the "Find Similar Code" functionality.

Are there any usage instructions anywhere?


Please sign in to leave a comment.