Find duplicate blocks of text or code in any file

Hi,

I'm missing a feature to locate duplicate blocks of text or code not
just in Java files but in any file. I would be nice if it worked like
this:

1. Mark a text or some code.
2. Right-click on the selected text and choose "Find similar
blocks..."
3. Set the settings for the search:

  • Match ratio (some scale from a bit similar to exact

match).

  • Option to ignore line breaks and white spaces.

  • Set scope (this file, all files, ...)

4. Press "Search" and the result window will present the results
maybe sorted on similarity.

What do I need this for? I have a Ant build file (xml) with lots of
duplicated blocks, so a feature like this would be handy. I've tried
structural search, locate duplicates and search, but none of them seems
to be able to do the above.

What do you think? Something for Demetra?

--
Per Thomas





1 comment

Hi,

Structural Search will work with xml/html/xhtml in Demetra so duplicated
blocks could be found in files of such file types.

Per Thomas Jahr wrote:

Hi,

I'm missing a feature to locate duplicate blocks of text or code not
just in Java files but in any file. I would be nice if it worked like
this:

1. Mark a text or some code.
2. Right-click on the selected text and choose "Find similar
blocks..."
3. Set the settings for the search:

  • Match ratio (some scale from a bit similar to exact

match).

  • Option to ignore line breaks and white spaces.

  • Set scope (this file, all files, ...)

4. Press "Search" and the result window will present the results
maybe sorted on similarity.

What do I need this for? I have a Ant build file (xml) with lots of
duplicated blocks, so a feature like this would be handy. I've tried
structural search, locate duplicates and search, but none of them seems
to be able to do the above.

What do you think? Something for Demetra?

--
Per Thomas






--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.