2012-05-10 2 views
0

FxCop Integration VS Extension을 사용하는 코드 분석을 위해 VS 2010 Professional과 FxCop을 통합하는 과정에 있습니다. 우리는 FxCop에서 구성된 모든 기본 규칙 집합을 사용하여 모범 사례를 엄격하게 위반하지 않아도 좋지만 전혀 그렇지 않은 경우가 많다는 점을보고했습니다. 기본적으로 FxCop의 모든 규칙의 하위 집합 인 규칙 목록이 있습니까? 사람들은 일반적으로 반드시 있어야한다고 생각할 수있는 웹 기반 프로젝트의 코드 분석을 수행하는 데 사용합니다. 우리는 가볍게 검색해 보았지만 개별 선택을 기반으로하는 특정 규칙을 무시하는 것에 대한 토론은 웹 전체에 퍼져있었습니다.) 리소스는 웹 기반 asp.net/C# 커뮤니티가 일반적으로 따르는 규칙의 기본 설정 목록을 나열합니다. 프로젝트.ASP.NET 웹 응용 프로그램 용 FxCop 규칙 목록 하위 집합

답변

0

실제로 TeamCity 통합을 사용하지만 규칙은 동일해야합니다. 아래에서 한번 시도하십시오 :

<?xml version="1.0" encoding="utf-8"?> 
<FxCopProject Version="1.36" Name="testApplication"> 
<ProjectOptions> 
    <SharedProject>True</SharedProject> 
    <Stylesheet Apply="False">\tools\fxcop\Xml\FxCopReport.xsl</Stylesheet> 
    <SaveMessages> 
    <Project Status="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-GB" /> 
    <OverrideRuleVisibilities>False</OverrideRuleVisibilities> 
    <CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" /> 
    <SearchGlobalAssemblyCache>False</SearchGlobalAssemblyCache> 
    <DeadlockDetectionTimeout>120</DeadlockDetectionTimeout> 
    <IgnoreGeneratedCode>False</IgnoreGeneratedCode> 
</ProjectOptions> 
<Targets> 
    <Target Name="$(ProjectDir)/../../solution/PrecompiledWeb/application/bin/App_Code.dll" Analyze="True" AnalyzeAllChildren="True" /> 
</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\UsageRules.dll" Enabled="True" AllRulesEnabled="True" /> 
    </RuleFiles> 
    <Groups /> 
    <Settings /> 
</Rules> 
<FxCopReport Version="1.36" /> 
</FxCopProject> 
+0

필자는 규칙을 더 자세히 필터링하려고했습니다. 예를 들어 Microsoft.Design 규칙 집합의 CA1014 규칙 "CLSCompliantAttribute가있는 어셈블리 표시"규칙은 무시할 수 있습니다. 실제로 각 개발 커뮤니티에서 일반적으로 사용하는 규칙 목록을 가져와야하는 기본 FxCop 규칙 집합에서 무시할 수있는 규칙 목록을 찾고있었습니다. – koder

0

아니요, 그러한 짐승은 없습니다. 그리고이 목록을 만든 사람이 내린 결정이 실제로 상황에 맞는지 어떻게 확신 할 수 있습니까?

규칙이 200 개 정도 있습니다. 왜 당신이 중요하다고 생각하는지 알아내는 데 1, 2 시간 동안 앉아있는 것이 아닙니까? 당신은 지름길을 취할 수 있으며, 현재 당신에게 위반 사항을주는 것들만 볼 수 있습니다. 그러면 아마 시력 검사가 하루에 1/2 시간 미만이 될 것입니다.