What tools can I use to view diff of two sections of the same file?

I am trying to reorganize a python module in which duplicate code is the main problem.

Is there any tool that I can use to view the diff of two selected sections so that I can see the difference between these almost identical codes?

+3
source share
5 answers

Although I don't think the interface is great, check out Clone Digger . See example .

The TC Toolkit may simplify the search for duplicate code, but does not seem to offer good visualization.

: , Atomiq .

Diffuse, : Diffuse

, .

+3

, Emacs:

  • (M-x clone-indirect-buffer).
  • (C-x n n).
  • .
  • Ediff (M-x ediff-two-buffers) .

, , .

+3

, , , . , , , .

CloneDR , Python. ( "" ), , (Python), , , , . (Atomiq, , , ).

CloneDR Windows .

0

Beyond Compare text compare has the "Open Clipboard" command, which will put everything that is on the clipboard on one side of the comparison. If you then copy the second function and use this command again, it will align them with the highlighted differences.

-1
source

Source: https://habr.com/ru/post/1785335/


All Articles