Visual Studio 代码分析与 StyleCop + 福克斯警察

发布于 2024-07-14 05:58:21 字数 183 浏览 6 评论 0原文

我之前在 Visual Studio 项目中使用过 StyleCop + FxCop。 但现在我正在测试Visual Studio代码分析工具,它更容易集成到MSBuild中,并且我发现该工具分析了FxCop和StyleCop的一些规则。

这个工具是 FxCop 和 StyleCop 的完全替代品还是只是实现了它们的一些规则?

I used previously StyleCop + FxCop on my Visual Studio's projects. But now I am testing Visual Studio Code Analysis tool, which is easier to integrate into MSBuild, and I have found that this tools analyses some of the rules of both FxCop and StyleCop.

Is this tool a full replacement for both FxCop and StyleCop or does it just implement some of their rules?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

清君侧 2024-07-21 05:58:21

Visual Studio 包括 FxCop 等。

来自 FxCop 开发者博客

抱歉我的无知,但我认为
FxCop 完全独立于
VSTS 中的代码分析? 更多的
具体来说,我假设如果我
安装新版本的FxCop、VSTS
不会利用(没有共享
代码?)? 如果是这种情况,任何想法
当这些改变将成为
VSTS代码分析? 谢谢!

没错,它们是不同的
产品,但是它们确实有
通用发动机。 视觉工作室 2008 SP1
已经带有相同的修复程序并且
分析(加上一点点),所以
无需“更新”视觉
配备最新 FxCop 的工作室。

开发人员博客 还给出了每个中的确切规则。

至于 StyleCop,它独立于 VS Code Analysis,如 这篇博文,链接到 Jader迪亚斯的帖子

Visual Studio includes FxCop + more.

From the developer blog of FxCop:

Sorry about my ignorance, but I assume
FxCop is completely separate from the
Code Analysis in VSTS? More
specifically, I assume that if I
install the new version of FxCop, VSTS
will not take advantage (no shared
code?)? If this is the case, any idea
when these changes will make it into
VSTS code analysis? Thanks!

That's correct, they are different
products, however they do have a
common engine. Visual Studio 2008 SP1
already comes with the same fixes and
analysis (plus a little bit more), so
there is no need to 'update' Visual
Studio with the latest FxCop.

A developer blog also gave the exact rules which are in each.

As for StyleCop, it's independent of VS Code Analysis as described in this blog post, which links to Jader Dias' post.

坠似风落 2024-07-21 05:58:21

我的理解是 Visual Studio Code Analysis 基本上是 FxCop 的稍微修改版本。 根据我的经验,它们几乎是同一件事(事实上,我相信代码分析在幕后使用 FxCop 可执行文件)。

尽管 FxCop/CodeAnalysis 和 StyleCop 之间存在重叠; FxCop 倾向于更多地关注设计规则,而 StyleCop 则关注编码风格(大小写、空格、缩进等)。

FxCop 还分析 IL,而 StyleCop 直接分析源代码。 这对他们各自可以执行的规则施加了一组不同的限制。

My understanding is that Visual Studio Code Analysis is basically a slightly modified version of FxCop. From my experience they are almost the same thing (in fact I believe Code Analysis uses the FxCop executable behind the scenes).

Although there is overlap between FxCop/CodeAnalysis and StyleCop; FxCop tends to focus more on design rules and StyleCop is focusing on coding style (casing, white space, indents, etc).

Also FxCop analyzes the IL while StyleCop analyzes the source code directly. This imposes a different set of restrictions on what rules they can each enforce.

原来是傀儡 2024-07-21 05:58:21

到目前为止,我的谷歌搜索得到了以下答案:

http ://blogs.msdn.com/bharry/archive/2008/07/19/clearing-up-confusion.aspx

指出:

“我们发现 StyleCop 事实上是一个非常有用的工具,它可以做一些事情FxCop 和 TeamDev 不做(而且它不做他们做的事情),StyleCop 是一个很好的补充工具,用于进行编码风格检查,以验证源代码是否按照您想要的方式格式化并遵循您的要求。虽然与 FxCop 存在一些重叠(例如检查标识符大写),但重叠很小,因为 StyleCop 不会像其他静态分析工具那样进行深入分析来启用代码正确性检查、安全检查等。

但我不确定“TeamDev”是否与“Visual Studio 的代码分析”相同

Until now my googling resulted in the following answer:

http://blogs.msdn.com/bharry/archive/2008/07/19/clearing-up-confusion.aspx

states:

"We found that StyleCop is, in fact, a very useful tool and it does things FxCop and TeamDev doesn't do (and it doesn't do the things they do). It is a wonderful complementary tool. StyleCop is a tool for doing coding style checking to verify that source code is formatted the way you want and follows the style guidelines for conventions. While there is some overlap with FxCop (like checking identifier capitalization), the overlap is miniscule as StyleCop does not do the deep analysis that the other static analysis tools do to enable code correctness checks, security checks, etc."

But I'm not sure if the "TeamDev" is the same thing as "Visual Studio's Code Analysis"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文