Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not skip source files that contains "ExcludeFromCodeCoverage*" attributes #428

Closed
jdcoffre opened this issue Jun 13, 2017 · 5 comments
Closed
Labels
Area: SQ Plugin Java plugin related issues. Type: Improvement Making existing code better.
Milestone

Comments

@jdcoffre
Copy link

Description

If a source file contains "ExcludeFromCodeCoverage" or "ExcludeFromCodeCoverageAttribute" code attribute, the analyzer will skip the file from the analysis.

This mechanism has been put in place the prevent SonarC# to analyze generated source code. This codding attributes are not related to auto-generated code.

The aim of this issue to prevent the analyzer to skip any source file relying on these coding attributes.
Here is the related source code.

Repro steps

  • create a project
  • 2 source files of this project respectively uses code attribute "ExcludeFromCodeCoverage" or "ExcludeFromCodeCoverageAttribute"
  • run the analysis
  • confirm that the files are skipped

Related information

It impact any analysis since version 5.4 of SonarC#.

@valhristov valhristov added Area: Rules Type: New Feature This hasn't been here before. labels Jun 13, 2017
@valhristov valhristov added this to the near-future milestone Jun 13, 2017
@valhristov
Copy link
Contributor

Related issue #155

@AlgoristHQ
Copy link

Why wouldn't you want to skip a file that is telling you to skip it?

@andrei-epure-sonarsource
Copy link
Contributor

It's saying to exclude the file from code coverage, not from static code analysis, right?

@DanielHWe
Copy link

It would be fine if they are still scanned, but thay are listed to be not covered by unit tests. I did only mark some methods/Properties to not be exclued from code coverage but sonar still say they need to be covered.

@pavel-mikula-sonarsource
Copy link
Contributor

Hi @DanielHWe, this issue was closed 2 years ago.

Please create a new topic on https://community.sonarsource.com with full description of your scenario that could help to understand the situation.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: SQ Plugin Java plugin related issues. Type: Improvement Making existing code better.
Projects
None yet
Development

No branches or pull requests

8 participants