This article explains how to configure FxCop in SPCAF Ruleset.
FxCop is one of the 3rd party analyzer s that can be integrated with SPCAF via rule. The rule will be executed only if the tool FxCop is installed locally. If the tool is not be found the rule will throw an exception.
Important: Not all FxCop rules are applied.
The analysis uses a subset of FxCop rules which are the same as MSOCAF (Microsoft SharePoint Online Code Analysis Framework) to provide similar behavior. You can override the used ruleset file by using the configuration parameter 'FxCopRuleSets' in the SPCAF ruleset file.
Once you have installed FxCop and have enabled the ruleset you will then need to configure some parameters with FxCop, below is a list of the configurable parameters to be used:
|FxCopExecutable||Absolute or relative path to FxCop executable (FxCopCmd.exe). By default, SPCAF searches for FxCopCmd.exe at the typical installation location of FxCop.|
|FxCopDirectories||List of directories (separated by ";") in which FxCop searches for referenced assemblies.|
|FxCopRuleSets||List of FxCop ruleset files (separated by ";") by default SPCAF uses the MSOCAF.ruleset to limit the number of applied rules to a recommended set for SharePoint.|
|FxCopIgnoreGeneratedCode||Set to true, if generated code should be ignored for the analysis.|
In order to utilize these parameters you will need to either add them via the SPCAF Setting editor and the "Configuration and Details" section adding the key and value as detailed above, as shown below:
Or, via adding the value and key's to the ruleset directly via an .xml editor, as shown below:
<Property Key="FxCopExecutable" Value="directory" />
<Property Key="FXCopDirectories" Value="directory1;directory2;directory3..." />
<Property Key="FxCopRuleset" Value="directory1;directory2;directory3..." />
<Property Key="FxCopIgnoreGeneratedCode" Value="True" />