We traditionally used copy-paste-detector (CPD) (https://github.com/pmd/pmd) as a post-build step to detect duplicate code.
Some limitations of CPD include:
Feedback is not immediate in the IDE.
As a multi-language support tool (primarily Java), changes in C# specifications can confuse the tool. One example (as of last year) was that the simplified using statement syntax introduced in C# 8 confused the tool into ignoring duplicate code.
There are other tools available on the market; none to my knowledge provide the immediate IDE feedback provided by roslyn.
We traditionally used copy-paste-detector (CPD) (https://github.com/pmd/pmd) as a post-build step to detect duplicate code. Some limitations of CPD include:
There are other tools available on the market; none to my knowledge provide the immediate IDE feedback provided by roslyn.
We built our own: https://github.com/philips-software/roslyn-analyzers/blob/master/Philips.CodeAnalysis.DuplicateCodeAnalyzer/Philips.CodeAnalysis.DuplicateCodeAnalyzer.md
Our organization has been using this analyzer for 1-2 years. Advise if there is interest in having that analyzer ported here.