有谁知道用于 C#、C 或 C++ 中自动代码分析的开源和/或免费代码扫描器?
我知道 Java 有一些很棒的东西,比如 FindBugs(Eclipse 集成)、PMD 或 Hammurapi。
C语言有类似的东西吗?
愿望
有谁知道用于 C#、C 或 C++ 中自动代码分析的开源和/或免费代码扫描器?
我知道 Java 有一些很棒的东西,比如 FindBugs(Eclipse 集成)、PMD 或 Hammurapi。
C语言有类似的东西吗?
愿望
FxCop 是一个免费的 .Net 扫描仪。
http://msdn.microsoft.com/en-us/library/bb429476(vs.80).aspx
对于 .NET 语言,您可以查看Reflector CodeMetrics,它提供了一些代码分析和设计指标。还可以查看所有Reflector 插件。
我也支持 FxCop 和 StyleCop 的建议。
StyleCop 进行源代码级别分析。
NDepend有一个为期两周的试用许可证。
对于 C 代码,您可以查看Coccinelle。它已经用于查找和修复 Linux 内核中的错误。
Resharper 做了一些代码分析,特别是用于指出冗余代码和逻辑错误。
您可能能够从使用 /analyze 开关运行 VC++ 中获得一些价值。虽然,并非每个版本都提供此特定开关。获取 Windows SDK 附带的编译器。
通过这里的评论和一些谷歌魔法,我来到了夹板: http ://splint.org/
对于 VisualStudio 和 .Net,FxCop 和 StyleCop 扩展看起来非常复杂。
到目前为止,谢谢,希望
您可以在此处找到免费且不那么免费的静态分析工具列表。
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.