Open PulsarFX opened 6 years ago
What are the Sonar Qube Options you are using for the plugin?
If it is Default or a sln File, you should define the assemblies you want to scan by sonar.cs.fxcop.assembly or you should create your own FxCop Project and use sonar.cs.fxcop.project. (Please see read me for more Information)
In the Moment the Settings in csproj files are not used, I will make a Feature request for this.
this is the parameter setup:
<Property Name="sonar.cs.fxcop.directory">...\BinariesUT</Property>
<Property Name="sonar.cs.fxcop.slnFile">...\My.sln</Property>
<Property Name="sonar.cs.fxcop.fxCopCmdPath">C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe</Property>
could I use multiple values for sonar.cs.fxcop.assembly
if I change from sln style to dll style? This is not clear to me from the readme.
You can use wildcards in the sonar.cs.fxcop.assembly Parameter. If that not works try it with the Project way.
Can you give an example how to use wildcards? Is it regex style (like in the runsettings file)?
It is like in filesystems, so My* will find MyProject.dll, MyProject.exe and MyLib.dll.
Thanks, I managed to get it running. But, some caveats:
this will work:
sonar.cs.fxcop.assembly=Binaries/net461/MyProg*
this wont work or find nothing:
sonar.cs.fxcop.assembly=Binaries\\net461\\MyProg*
sonar.cs.fxcop.assembly=Binaries\net461\MyProg*
sonar.cs.fxcop.assembly=MyProg*
I have a similar situation. I have multiple folders which needs to be provided as assembly. For example - Project/Sub1/bin/Debug/net461/ Project/Sub2/bin/Debug/net461/
I have tried /d:sonar.cs.fxcop.assembly=Project/**/bin/Debug/net461/*
and a few other things. But the * in the middle of path is not being accepted and throwing illegal character error.
I have also tried using comma to specify the paths, like /d:sonar.cs.fxcop.assembly=Project/Sub1/bin/Debug/net461/Sub1.dll,Project/Sub2/bin/Debug/net461/Sub2.dll
-- In this case the whole string is accepted as a single file path and throwing error as file not found.
Any Suggestion?
FxCopCmd.exe itself does only support one assembly directory to scan, so you can not define multiple assembly directories. See https://documentation.help/FxCop/df7e8653-5b24-4547-afaf-f5c8ff75f4b3.htm
What you can do is to define an
I let analyze my sln with fxcop plugin v1.3 and SonarQube 6.7.4 Unfortunately fxcop findings from the unittest dll are reportet to sonarqube. As SQ leaves test projects out of the result, these findings are reported at every module/csproj in the sq-job without a link to a file (as it is excluded). This leads to very high issue numbers which all are caused by the same, excluded code files.
Even after excluding the unit test project from analysis via
the findings for the unit test project are still there, only the unit test project/module has gone completely from the SQ report (instead of showing up with 0 lines of code, as used to)
Here is an excerpt from the sln analysis:
this is done for each module/project in the build job, so the unit test findings are found in every fxcop run like shown above.