danielstjules / jsinspect

Detect copy-pasted and structurally similar code
MIT License
3.56k stars 128 forks source link

instances > X OR threshold > Y #66

Open Gregoor opened 7 years ago

Gregoor commented 7 years ago

Hi, just stumbled over this and I love it!

I'm looking into using it as part of an automatic code-review process. I tend to only consider code unnecessary duplication when it is either repeated more than twice or it has a high complexity (which if I understand the threshold param correctly, would for me be something like a threshold of 40).

Or to put in simple english terms: If something is repeated twice, I only consider it an unelegant duplication when the repeated code is complex.

Do you see value in having such an option?

jalooc commented 6 years ago

I think that threshold defines how deep the algorithm looks for repetitions, not how complex is the analysed part of code.