Skip to content

The tool which generates rules configuration xml for give FxCop assemblies

Notifications You must be signed in to change notification settings

vladonemo/SonarFxCopRulesGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SonarFxCopRulesGenerator

The tool which generates rules configuration xml for give FxCop assemblies

If you want to buid the source file

  • you need to have FxCop installed
  • open the solution file in Visual Studio 2012
  • check the project references and correct them if necessary.
    • FxCopCommon.dll and FxCopSdk.dll are located in %fxcop_home%\FxCopCommon.dll

Note: %fxcop_home% is usually "c:\Program Files (x86)\Microsoft Fxcop 10.0" on 64b OS and "c:\Program Files\Microsoft Fxcop 10.0" on 32b OS

How to generate an XML file for standard FxCop rules

  • execute
SonarFxCopRulesGenerator.exe "%fxcop_home%\rules" YourOutputFile.xml

How to generate an XML file for syour custom FxCop rules

  • execute:
SonarFxCopRulesGenerator.exe "%location_of_your_assemblies%\rules" YourOutputFile.xml

How to generate an XML file for Visual Studio Static Analysis rules

  • copy phx.dll and Microsoft.VisualStudio.CodeAnalysis.Phoenix.dll from "%vs_static_analysis_home%\FxCop" to the folder where your SonarFxCopRulesGenerator.exe is located
  • execute:
SonarFxCopRulesGenerator.exe "%vs_statis_analysis_home%\FxCop\rules" YoutOutputFile.xml

Note: %vs_static_analysis_home% is usually "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools" on 64b OS and "c:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools" on 32b OS
Note: Visual Studio Static Analysis contains all standard FxCop rules. If you only want to generate an XML file for the rules which are not in FxCop, run the tool with DataFlowRules.dll, MaintainabilityRules.dll and ReliabilityRules.dll assemblies only.

How to use FxCop with Visual Studio Static Analysis rules in sonar

  • copy Microsoft.VisualStudio.CodeAnalysis.DataflowModels.dll, Microsoft.VisualStudio.CodeAnalysis.Phoenix.dll and phx.dll from %vs_static_analysis_home% to %fxcop_home%
  • copy PhoenixAnalysisEngine.dll from %vs_static_analysis_home%\Engines to %fxcop_home%\Engines
  • copy DataFlowRules.dll, MaintainabilityRules.dll and ReliabilityRules.dll rom %vs_static_analysis_home%\Rules to %fxcop_home%\Rules
  • place the configuration files you generated to %sonar_home%\extensions\rules\fxcop
  • restart sonar

About

The tool which generates rules configuration xml for give FxCop assemblies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages