We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您可以使用 Checkstyle。然而,标准检查(sun 编码标准)非常严格,您可能希望根据您的喜好从用于配置的 XML 中删除一些检查
You can use Checkstyle. However, the standard checks (sun coding standards) are quite strict and you probably may want to remove some checks from the XML that is used for configuration, depending on your taste
虽然像 Checkstyle 这样的工具可以检查对样式约定的遵守情况,但它们不应该用于评估文档。是的,checkstyle 可以检查文档是否存在,但不能检查该文档是否正确或以任何方式有用 - 无用的文档比没有更糟糕,因为它至少不会使源代码变得混乱。例如,checkstyle 会考虑:
更好(因为存在注释并且所有参数和返回值都已记录),而不是
因为后者没有记录方法参数......
简而言之,该记录是否足够不能通过机器,并且容易获得的指标仅显示了图片的一部分 - 在我看来,这很大程度上是不相关的部分。
While tools like Checkstyle can check adherence to style conventions, they should not be used to evaluate documentation. Yes, checkstyle can check that documentation is present, but not that this documentation is correct or in any way useful - and useless documentation is worse than none, since it at least doesn't clutter the source code. For instance, checkstyle would consider:
to be better (because comments exist and all parameters and return values are documented), than
because the latter does not document the method parameter ...
In short, that documentation is adequate can not be verified by a machine, and easily obtainable metrics only show part of the picture - a largely irrelevant part in my opinion.