有没有JavaScript静态分析工具? [英] Are there any JavaScript static analysis tools?

查看:251
本文介绍了有没有JavaScript静态分析工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯让我的编译器抱怨当我做一些愚蠢的事情就像变量名称上的拼写错误但是JavaScript有习惯让它通过。

I'm used to having my compiler complain when I do something stupid like a typo on a variable name but JavaScript has a habit of letting this pass.

Are还有JavaScript的静态分析工具吗?

Are there any static analysis tools for JavaScript?

推荐答案

我同意JSLint是最好的起点。请注意, JavaScript Lint JSLint的。我还建议查看 JSure ,这在我的有限测试中表现优于其中任何一个,尽管实现中的一些粗糙的边缘 - 英特尔Mac版本在启动时崩溃了,虽然PowerPC版本在英特尔上运行良好,而且Linux版本运行良好。 (开发人员Berke Durak说,如果修复后他会回复我,但我没有收到他的消息。)

I agree that JSLint is the best place to start. Note that JavaScript Lint is distinct from JSLint. I’d also suggest checking out JSure, which in my limited testing did better than either of them, though with some rough edges in the implementation—the Intel Mac version crashed on startup for me, though the PowerPC version ran fine even on Intel, and the Linux version ran fine as well. (The developer, Berke Durak, said he'd get back to me when this was fixed, but I haven't heard from him.)

不要指望很多来自JavaScript静态分析,因为你从一个好的C检查器。正如Durak告诉我的那样,由于Javascript的动态特性,任何非平凡的分析都非常困难。

Don’t expect as much from JavaScript static analysis as you get from a good C checker. As Durak told me, "any non-trivial analysis is very difficult due to Javascript's dynamic nature."

(另一个,更加模糊的Mac-only bug,这次是JSLint的Konfabulator小部件:将BBEdit文档图标拖到窗口小部件上会将文档移动到垃圾箱。开发人员Douglas Crockford没有在Mac上试过这个小部件。)

(Another, even more obscure Mac-only bug, this time with JSLint’s Konfabulator widget: Dragging a BBEdit document icon onto the widget moves the document to the trash. The developer, Douglas Crockford, hadn’t tried the widget on a Mac.)

2009年8月10日:今天在静态分析研讨会上,Simon Holm Jensen发表了一篇关于 TAJS:用于JavaScript的类型分析器,由AndersMøller和Peter Thiemann编写。本文没有提到上述工具,但Jensen告诉我他看了一些并没有留下深刻印象。 TAJS的代码应该在今年夏天的某个时候提供。

10 August 2009: Today at the Static Analysis Symposium, Simon Holm Jensen presented a paper on TAJS: Type Analyzer for JavaScript, written with Anders Møller and Peter Thiemann. The paper doesn’t mention the above tools, but Jensen told me he’d looked at some of them and wasn’t impressed. The code for TAJS should be available sometime this summer.

这篇关于有没有JavaScript静态分析工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆