C++、Eclipse CDT 代码分析?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5540751/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:06:25  来源:igfitidea点击:

C++, Eclipse CDT code analysis?

c++eclipsestaticanalysiseclipse-cdt

提问by blubberbernd

Are there any good plugins for static code analysis for Eclipse CDT? I found two so far:

Eclipse CDT 的静态代码分析有什么好的插件吗?到目前为止我发现了两个:

  • Cppcheck plugin, but this still needs the original cppcheck executable
  • CppChecker, but this didn't work (it didn't do anything)
  • Cppcheck 插件,但这仍然需要原始的 cppcheck 可执行文件
  • CppChecker,但这不起作用(它没有做任何事情)

Are there any more that are better? Or how do I get CppChecker to do something (or is it a static code analyiser at all? the website is not clear at all)?

还有更好的吗?或者我如何让 CppChecker 做一些事情(或者它是一个静态代码分析器?网站根本不清楚)?

采纳答案by Rick

There is another called "Codan," stands for CODe ANalysis.

还有一个叫做“Codan”,代表代码分析。

It can be reviewed at this wiki, with links to the tool:

可以在这个 wiki 上查看它,并提供指向该工具的链接:

http://wiki.eclipse.org/CDT/designs/StaticAnalysis

http://wiki.eclipse.org/CDT/designs/StaticAnalysis

I cannot answer whether this is the better than your list, but at least it's another option you can review. Eclipse integration seems to be its only requirement.

我无法回答这是否比您的列表更好,但至少它是您可以查看的另一个选项。Eclipse 集成似乎是它的唯一要求。

Keep in mind that this is a work in progress, but given its goals, it may suit your short-term needs.

请记住,这是一项正在进行的工作,但鉴于其目标,它可能适合您的短期需求。

回答by Tod

You can always run lint inside Eclipse as well. I wrote up a blog entryon doing it manually. However, there also exists Visual Lintand it works in VS and Eclipse. It's not perfect but it's easier than setting it all up manually.

您也可以始终在 Eclipse 中运行 lint。我写了一篇关于手动操作的博客条目。但是,也存在Visual Lint,它适用于 VS 和 Eclipse。这并不完美,但比手动设置更容易。

回答by greywolf82

I suggest a free plugin based on Codan framework called Artemis. You can get it from ecliplse marketplace. There are other checkers but only plugins integrated into Codan, like this one, can perform real-time analysis in Eclipse.

我推荐一个基于 Codan 框架的免费插件,叫做 Artemis。您可以从 ecliplse 市场获得它。还有其他检查器,但只有集成到 Codan 中的插件,例如这个,才能在 Eclipse 中执行实时分析。