Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same code on multiple files #221

Open
edertone opened this issue Apr 5, 2019 · 5 comments
Open

Same code on multiple files #221

edertone opened this issue Apr 5, 2019 · 5 comments

Comments

@edertone
Copy link

edertone commented Apr 5, 2019

It looks like the duplicate code report is shown always for code on two files. If we have, for example, the same method on 4 different files, we won't get a report saying that the block of code is found on all those files. Instead, we will see that the code is duplicated on file 1 and 2, and 3 and 4

It would be really helpful to group the duplicate code on all the files where it is found, so if we have the same block of code in 10 files we can fix it on all of them at once

@akramkohansal
Copy link

I need this feature as well

@kucherenko
Copy link
Owner

kucherenko commented Apr 12, 2019

Thank you of the feature request.

I will investigate the problem but looks like it is not easy to implement with Rabin Karp algorithm used inside jscpd.

@edertone
Copy link
Author

Of course it does not seem easy to implement!, just an improvement suggestion,

thanks!

@strtw
Copy link

strtw commented Jun 22, 2021

I filed #474 before finding this #221 but they are related so wanted to comment here.

In addition to reporting on the same code on multiple files, I'd like to see a report that indicates more than two instances of the same code in the same file. The reason is to be able to prioritize which files might need refactoring. Two instances per file might be ok for a team, but more than three might not be.

@ctf0
Copy link

ctf0 commented Feb 25, 2023

hi @kucherenko any updates on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants