Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One automated thing I've been really wanting to add to our code review process is copied code detection, where a piece of code is very similar to code somewhere else in the product (though likely not part of the current review).

Obviously there's cases where this is code smell, but plenty of times it isn't. It's not something that you would want to block shipping. But if you do want to ship code like this, you should do so with the reviewer(s) fully seeing where it came from, to make sure everyone agrees that's the best way.

No one has implemented a bot for us that would add such comment for use but I do think it would be a huge win.



Sonarqube has, among other things, code duplication detection, where it detects very similar, but slightly different blocks of code.

It's possible to wire things up so that it runs when you open a merge request and notifies you via email the results.

It's not a silver bullet though.

It also has a linter plugin for vscode (and possibly other editors) that DID NOT work well, atleast the last time I checked which was before February this year. Just thought you should know, incase you decided to just use the linter.

https://www.sonarqube.org/


It’s not automated but IntelliJ does this.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: