IMPE, the most seasoned developers on the project (e.g.: ten years or more) had the experience, that comes with age in position, to know when redundant code was being made and they voiced such during code-reviews for pull-requests.
The 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.
I do know that you can create StyleCop rules to try to check for redundancy. For example, we had a type derived from System.DateTime in .NET that was to be used (instead of System.DateTime) and the smoketest builds would fail for the StyleCop violation.
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.
Comments
IMPE, the most seasoned developers on the project (e.g.: ten years or more) had the experience, that comes with age in position, to know when redundant code was being made and they voiced such during code-reviews for pull-requests.
The 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.
Yup. This is the only approach which is practical and probably followed by all.
Wanted to see if there is some innovative method out there which can be utilised.
I do know that you can create StyleCop rules to try to check for redundancy. For example, we had a type derived from System.DateTime in .NET that was to be used (instead of System.DateTime) and the smoketest builds would fail for the StyleCop violation.
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.