Ignore blocks of code that are marked as obsolete from Code Coverage analysis

We are using Azure DevOps/SonarCloud integration and our repository is in C#. We have methods in our files where we mark them as obsolete because they will be removed. Is there a way in Azure or SonarCloud where when you do code coverage analysis(we are using OpenCover), it will ignore any methods that are marked as obsolete?



hi @NetHealth ,


I guess you want to read this related answer on a related github issue. TL;DR; use the OpenCover -excludebyattribute:*.ExcludeFromCodeCoverageAttribute