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

FXCop issues on excluded source files are unexpectidely reported at SQ project level #1

Closed
fmallet opened this issue Oct 11, 2016 · 0 comments
Labels
Milestone

Comments

@fmallet
Copy link

fmallet commented Oct 11, 2016

Issue originally reported here: https://stackoverflow.com/questions/38370785

If <SonarQubeExclude>true</SonarQubeExclude> is added to a file in a project (and/or if the file is excluded with sonar.exclusions), then that will not be uploaded to the server (and won't have SonarAnalyzer issues either), but the FxCop issues are showing up (at module level). We should apply the same filtering everywhere.

Here is the root cause of the issue :

  • By design FXCop is not able to map back any quality issue to a piece of code located in a source file. Some quality issues are for instance attached to some dll or logical entities.
  • This is a kind of usual FXcop behavior which conflicts with one SonarQube principle: all issues should be associated to a piece of code.
  • As this is a usual FXCop behavior, we've implemented a trick: each issue not associated to a source file indexed by SonarQube is automatically associated to the SQ project
  • But then comes the very bad side effect: issues located in excluded source files (so source files not indexed) are also attached to the SQ project -> Boom !

As the trick relates to FXCop, I think the workaround should also be part of the FXCop plugin and not located outside (for instance in the Scanner for MSBuild). The workaround could be the following one :

  • Only issues not associated to a source file indexed by SonarQube and not attached to a file with the *.cs or *.vb extension will be associated to the SQ project.
@fmallet fmallet added the bug label Oct 11, 2016
@fmallet fmallet added this to the 1.0 milestone Oct 11, 2016
@henryju henryju closed this as completed Oct 12, 2016
DanielHWe added a commit that referenced this issue Sep 12, 2017
Allow 'fxcop.assembly' to use wildcards like fxcop parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants