I am looking to have Visual Studio 2013's static analysis tool throw warnings for CA1502 (cyclomatic complexity) for scores lower than the default score provided (15 instead of the default of 25). The following Stack Overflow posts talk about using FxCop 10.0 to create a default FxCop settings file which then needs to be integrated into the current static code analysis tool (v 12.0) via adjustments to the project and ruleset files:
custom threshold for CA1502 in visual studio 2013 ultimate
However, other than the XML needed for adjust to the FxCop settings file, there are no details on the steps to implement that settings file into the code analysis tool. For example, I review the project file and there isn't a location/setting to list all rule library files in your project file with the rules disabled so the rules can instead be enabled via the ruleset file. I tried a number of combinations without success. Can anyone provide guidance on how to implement the custom settings?
Here is my FxCop settings file for reference:
<?xml version="1.0" encoding="utf-8"?>
<FxCopProject Version="10.0" Name="Test Project">
<ProjectOptions>
<SharedProject>True</SharedProject>
<Stylesheet Apply="False">$(FxCopDir)\Xml\FxCopReport.xsl</Stylesheet>
<SaveMessages>
<Project Status="Active, Excluded" NewOnly="False" />
<Report Status="Active" NewOnly="False" />
</SaveMessages>
<ProjectFile Compress="True" DefaultTargetCheck="True" DefaultRuleCheck="True" SaveByRuleGroup="" Deterministic="True" />
<EnableMultithreadedLoad>True</EnableMultithreadedLoad>
<EnableMultithreadedAnalysis>True</EnableMultithreadedAnalysis>
<SourceLookup>True</SourceLookup>
<AnalysisExceptionsThreshold>10</AnalysisExceptionsThreshold>
<RuleExceptionsThreshold>1</RuleExceptionsThreshold>
<Spelling Locale="en-US" />
<OverrideRuleVisibilities>False</OverrideRuleVisibilities>
<CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" />
<SearchGlobalAssemblyCache>False</SearchGlobalAssemblyCache>
<DeadlockDetectionTimeout>120</DeadlockDetectionTimeout>
<IgnoreGeneratedCode>False</IgnoreGeneratedCode>
</ProjectOptions>
<Targets />
<Rules>
<RuleFiles>
<RuleFile Name="$(FxCopDir)\Rules\DesignRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\GlobalizationRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\InteroperabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\MobilityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\NamingRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\PerformanceRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\PortabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\SecurityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\SecurityTransparencyRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\UsageRules.dll" Enabled="True" AllRulesEnabled="True" />
</RuleFiles>
<Groups />
<Settings>
<Rule TypeName="AvoidExcessiveComplexity">
<Entry Name="Warning Threshold">15</Entry>
<Entry Name="Information Threshold">15</Entry>
<Entry Name="Critical Warning Threshold">15</Entry>
<Entry Name="Critical Error Threshold">15</Entry>
<Entry Name="Error Threshold">15</Entry>
<Entry Name="Recommended Threshold">"15""</Entry>
</Rule>
</Settings>
</Rules>
<FxCopReport Version="10.0" />
</FxCopProject>