xdry - Programming language agnostic clone detection
xdry detects duplicated behaviour in your application, even if the duplicated passages are not exact matches to each other. Likely you should read a bit about the theoretical background for a better understanding.