Can SonarCloud flag new usages of obsolete methods?

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps): Azure DevOps
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI: Azure DevOps
  • Languages of the repository: C#

I’ve flagged a method as obsolete as we update references away from using it. I can’t set the obsolete error flag to true to cause build failures because the process of moving code off of it will happen over a period of time. The obsolete flag creates a compiler warning, but nothing stops a developer from adding a new usage of the method. Is SonarCloud able to flag new usages of obsolete methods?

Hi,

When invoking obsolete method, CS0612 compiler warning is raised by Roslyn.

If you configure your analysis to import external issues, you should be able to import this one too into SonarCloud.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.