Can We exclude specific methods from sonar qube analysis can we use opencovee for that?

Hi Team,
Can we exclude methods from sonarqube analysis. Code base is dotnet framwwork


You can exclude whole files, but not parts of files.


Hi Team,

As I was trying to exclude test methods from particular file by using opencover command that is [
“D:\OpenCover\OpenCover.Console.exe” -output:“%CD%\opencover.xml” -register:user -target:“C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe” -targetargs:“WebApplication1.Tests\bin\Debug\WebApplication1.Tests.dll” -filter:“+[] -[HomeController.cs]*.About()”]

can we exclude by using sonarqube.Please let us know there is any way to try exclusion of methods in sonarqube.

Admin note: combined duplicate threads here.