Ask HN: How do you guys avoid duplication of code?
As the organisation grows even past 10 people, we see that people create modules which are already present and duplicate the code. What is the most effective way to control this? A partial solution would be Sonar code scan. But then it can catch the syntactical duplication if I am not wrong. What about logical duplication like to read release version we can have 2 classes - ReleaseVersionReader and ReleaseVersionInfo.
It looks almost impossible to achieve in larger organisation with 100s of employees.
Thoughts?
5 comments
[ 2.8 ms ] story [ 19.4 ms ] threadThe intrinsic problem with this approach, of course, is that you need the people to stick around for this to work and to force code-reviews for check-ins.
Wanted to see if there is some innovative method out there which can be utilised.
So, using your version example, you could create a rule that checks if the method .ctor() has the word version in it and if it leverages any of the same single lines of code; however, I haven't the faintest idea of if I'm right in that it was StyleCop or how you would go about implementing it but I believe what you're looking for can be done.
Most companies don't go that route, though, unless there's security implications because the ROI is so high for the implementation.