Java 编码有标准吗?如果是这样,是否有工具可以检查这些标准?

发布于 2024-10-03 12:08:46 字数 133 浏览 1 评论 0原文

Java 编码有标准吗?如果是这样,是否有一个工具可以实施和检查这些标准?我不熟悉,但希望有人使用过 Sonar、Checkstyle、PMD、Findbugs、Clover 和/或 Cobertura,可以告诉我这些工具或其他工具是否可以做到这一点。

Are there Java coding standards? If so, is there a tool that implements and checks for those standards? I'm not familiar but hoping that someone has used Sonar, Checkstyle, PMD, Findbugs, Clover, and/or Cobertura that could tell me if any of those tools or other tools can do that.

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

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

发布评论

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

评论(4

献世佛 2024-10-10 12:08:46

。所有这些工具都可以强制执行编码风格(以及更多)。

Yes. All of those tools can enforce coding styles (and more).

水晶透心 2024-10-10 12:08:46

Sun(现在是 Oracle)的编码约定文档位于:

http://www.oracle。 com/technetwork/java/codeconv-138413.html

我使用 Checkstyle 来验证我的代码是否遵循这些约定以及我工作过的组织采用的约定。

Sun's (now Oracle's) coding conventions documentation is here:

http://www.oracle.com/technetwork/java/codeconv-138413.html

I've used Checkstyle to verify that my code follows these conventions as well as conventions adopted by organizations that I've worked for.

独行侠 2024-10-10 12:08:46

IntelliJ 还可以强制执行编码风格和标准。它的检查器还可以在您编写代码时检查可能的错误。

IntelliJ can enforce coding styles and standards as well. Its Inspector can also check for possible bugs as you write code.

何以心动 2024-10-10 12:08:46

是的,所有这些工具都会满足您的需求。如果需要,您还可以添加自定义规则。您还可以获得 Eclipse 的 checkstyle 和 findbugs 插件。

Yes all these tools will do what you want. You can also add custom rules if you need to. You can also get checkstyle and findbugs plugin for Eclipse.

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