FxCop 使用Data Flow Rules

简介: FxCop的UI并未提供Phoenix engine的支持,也就是以下这些验证规则通过FxCop的 UI没有办法验证,但是可以通过FxCopCmd来验证 CA1062 Validate Arguments of Public Methods CA1303 Do Not Pass Literals...

FxCop的UI并未提供Phoenix engine的支持,也就是以下这些验证规则通过FxCop的 UI没有办法验证,但是可以通过FxCopCmd来验证

CA1062 Validate Arguments of Public Methods

CA1303 Do Not Pass Literals as Localized Parameters

CA2000 Dispose Objects Before Losing Scope

CA2100 Review SQL Queries For Security Vulnerabilities

CA2202 Do Not Dispose Objects Multiple Times

CA2204 Literals Should Be Spelled Correctly

CA2215 Dispose Methods Should Call Base Class Dispose

CA2241 Provide Correct Arguments to Formatting Methods

 

可以通过对.FxCop文件添加规则来实现

   1: <FxCopProject Version="10.0" Name="My FxCop Project">
   2:  <Rules>
   3:    <RuleFiles>
   4:    <RuleFile Name="$(ProjectDir)/../Rules/DataflowRules.dll" Enabled="True" AllRulesEnabled="True" AllRulesBreakBuild="True" />
   5:    </RuleFiles>
   6:  </Rules>
   7:  </FxCopProject>

 

DataflowRules.dll文件可以在%Program Files%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\Rules中找到,XML的路径可以自己视情况添加

 

Reference:

http://blogs.msdn.com/b/codeanalysis/archive/2010/04/14/data-flow-analysis-rules-in-visual-studio-2010.aspx

http://msdn.microsoft.com/zh-cn/library/bb429449(v=vs.80).aspx

http://msdn.microsoft.com/en-us/library/dd264939

目录
相关文章
|
9月前
|
API
什么是 Angular library 的 secondary entry points?
什么是 Angular library 的 secondary entry points?
|
2月前
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
179 0
|
9月前
|
JavaScript
Angular 应用里 server.ts 文件的 APP_BASE_HREF token 的用法?
Angular 应用里 server.ts 文件的 APP_BASE_HREF token 的用法?
|
2月前
|
搜索推荐 JavaScript API
Spartacus cds-feature.module.ts 源代码结构介绍
Spartacus cds-feature.module.ts 源代码结构介绍
|
2月前
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
36 2
|
2月前
|
JavaScript
【Vue Error】 error Component name “product“ should always be multi-word vue/multi-word-compone……
【Vue Error】 error Component name “product“ should always be multi-word vue/multi-word-compone……
|
7月前
(node)Warning: Accessing non-existent property ‘xxx‘ of module exports inside circular depen
(node)Warning: Accessing non-existent property ‘xxx‘ of module exports inside circular depen
|
10月前
|
JavaScript
如何使用 multiparty 工具库在 Node.js 应用里解析 multipart form-data 格式的请求
如何使用 multiparty 工具库在 Node.js 应用里解析 multipart form-data 格式的请求
|
12月前
打包报错Error: ‘default‘ is not exported by node_modules/qs/lib/index.js
打包报错Error: ‘default‘ is not exported by node_modules/qs/lib/index.js
222 0
|
JavaScript 前端开发 开发者
Component name “xxx“ should always be multi-word
Component name “xxx“ should always be multi-word
Component name “xxx“ should always be multi-word