Is it possible to ignore folder using .Net Core project at code level

  • which versions are you using: SonarCloud + Sonarscanner for local development
  • what are you trying to achieve: ignore folder (EF migrations) without touching Sonar UIs, just mark the file as “ignore” or configure it in the project file.
  • what have you tried so far to achieve this:
    Tried this (with different path patterns) - no success, sonar still reports issues like code duplications.
 <ItemGroup>
    <SonarQubeSetting Include="sonar.coverage.exclusions">
      <Value>**/Migrations/*</Value>
    </SonarQubeSetting>
  </ItemGroup>

Hi Pavel,

The analysis parameter sonar.coverage.exclusions only excludes files from consideration for the code coverage measurement. If you want to fully exclude files from all analysis consideration, you’d want to use the parameter sonar.exclusions instead. Now they’ll be fully ignored.

1 Like

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