c# - Java编码风格

标签 c# java coding-style static-analysis

您如何使自己的编码符合标准?有 stylecopresharper对于 C#。是否有任何用于 Java 代码分析的工具/eclipse 插件?您使用其中的哪一个?

最佳答案

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard. Checkstyle is highly configurable and can be made to support almost any coding standard. An example configuration file is supplied supporting the Sun Code Conventions. As well, other sample configuration files are supplied for other well known conventions.

PMD is integrated with JDeveloper, Eclipse, JEdit, JBuilder, BlueJ, CodeGuide, NetBeans/Sun Java Studio Enterprise/Creator, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and Emacs.

FindBugs uses static analysis to inspect Java bytecode for occurrences of bug patterns. Static analysis means that FindBugs can find bugs by simply inspecting a program's code: executing the program is not necessary. This makes FindBugs very easy to use: in general, you should be able to use it to look for bugs in your code within a few minutes of downloading it. FindBugs works by analyzing Java bytecode (compiled class files), so you don't even need the program's source code to use it. Because its analysis is sometimes imprecise, FindBugs can report false warnings, which are warnings that do not indicate real errors. In practice, the rate of false warnings reported by FindBugs is less than 50%.

关于c# - Java编码风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2728139/

相关文章:

java - 防止/减慢反编译的技术

c# - 将只运行一次的代码移动到函数中是否可以?

php - 如何在sublime中使用phpcs来学习编码标准?

c# - NHibernate QueryOver 选择只需要的模型

java - JAXB 解码 xml @XmlValue 和 @XmlElement

c# - 使用动态列名称更新 Dapper

java - 通过 ArrayList 进行搜索

c++ - 在 C++ 中实现可用回调的好方法

c# - 两个不同应用程序之间的通信

c# - wpf 上下文菜单左键单击