vs2010代码指标的延伸/扩展点在哪里?
我想扩展 2010 年静态代码分析指标(主要是修复它,以便汇总是最大值而不是总和)。扩展点在哪里?它是某处的 MEF 组件吗?
I'd like to extend the 2010 static code analysis metrics (mostly fix it so the rollup is max instead of sum). Where is the extensibility point? Is it an MEF component somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定 VS 2010 指标是否有任何扩展点。
或者,您可以选择附带 82 代码指标 的 NDepend,定义阈值就像这样简单编写一个简短的 针对 LINQ 查询 (CQLinq) 的代码规则,例如:
您还可以查找像默认 CQLinq 代码规则一样的趋势: 避免使复杂方法均匀更复杂(源CC)
您还可以编写建议的代码指标,以定义您自己的代码指标,如CRAP 方法代码指标:
I am not sure if there are any extensibility point for VS 2010 metrics.
Alternatively, you can opt for NDepend that comes with 82 code metrics and defining threshold is as easy as writing a short Code Rule over LINQ Query (CQLinq) like:
You can also look for trending like in the default CQLinq code rule: Avoid making complex methods even more complex (Source CC)
You can also compose proposed code metrics, to define your own code metric like in C.R.A.P method code metric: