6

有谁知道用于 C#、C 或 C++ 中自动代码分析的开源和/或免费代码扫描器?

我知道 Java 有一些很棒的东西,比如 FindBugs(Eclipse 集成)、PMD 或 Hammurapi。

C语言有类似的东西吗?

愿望

4

10 回答 10

7

FxCop 是一个免费的 .Net 扫描仪。

http://msdn.microsoft.com/en-us/library/bb429476(vs.80).aspx

于 2009-01-29T16:17:45.710 回答
6

对于 .NET 语言,您可以查看Reflector CodeMetrics,它提供了一些代码分析和设计指标。还可以查看所有Reflector 插件

我也支持 FxCop 和 StyleCop 的建议。

于 2009-01-29T16:31:55.773 回答
3

StyleCop 进行源代码级别分析。

于 2009-01-29T16:23:32.343 回答
2

NDepend有一个为期两周的试用许可证。

于 2009-01-29T16:24:08.520 回答
2

对于 C 代码,您可以查看Coccinelle。它已经用于查找和修复 Linux 内核中的错误。

于 2009-08-31T14:06:06.917 回答
1

Resharper 做了一些代码分析,特别是用于指出冗余代码和逻辑错误。

于 2009-01-29T18:32:11.633 回答
0

您可能能够从使用 /analyze 开关运行 VC++ 中获得一些价值。虽然,并非每个版本都提供此特定开关。获取 Windows SDK 附带的编译器。

于 2009-01-29T17:01:27.230 回答
0

通过这里的评论和一些谷歌魔法,我来到了夹板: http ://splint.org/

  • 似乎对 C 很有帮助。
  • 便于使用
  • 不依赖于 Visual Studio

对于 VisualStudio 和 .Net,FxCop 和 StyleCop 扩展看起来非常复杂。

到目前为止,谢谢,希望

于 2009-01-29T17:12:40.920 回答
0

您可以在此处找到免费且不那么免费的静态分析工具列表。

于 2009-01-30T11:56:19.450 回答
0

Gendarme is free and open source. It analyses at IL level and provides information related to the source files using the pdb. Even without pdb's it provides results but difficult to localize in the code.

Note that it is best to use it on release code, what is unusual for static analyzers. This is because of the IL analysis: the debug code is cluttered and leads to more false positives.

Gendarme generates a nice HTML report and can be integrated easily in a continuous build server like cc.net.

于 2011-12-19T12:33:06.100 回答