为什么这个 SonarQube 规则? Javadoc 的第一句不完整(缺少句点)或不存在
Why this SonarQube rule? First sentence of Javadoc is incomplete (period is missing) or not present
我在我的项目中收到这条 SonarQube 消息:
First sentence of Javadoc is incomplete (period is missing) or not
present. (L39)
为什么 SonarQubet 告诉我用句号结束我的 JavaDoc 中的第一句话?
我认为这是一种糟糕的风格——就像在列表中一样,您也不会以句号结束每个项目。或者报纸上的 header - 没有句点。
而且它不是 'Info' 类型,而是 'Major' tpye。什么是实际...?这对我来说没有任何意义。
有谁知道这条规则是从哪里来的? SonarQube-website(或互联网上的其他地方)是否有 SonarQube-rules 的推理数据库?我找不到任何相似的东西。
来自 Javadoc 工具指南中的 How to Write Doc Comments
The first sentence of each doc comment should be a summary sentence, containing a concise but complete description of the API item.
...
The Javadoc tool copies this first sentence to the appropriate member, class/interface or package summary
...
This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first tag (as defined below)
所以基本的答案是你需要第一句让 Javadoc 工具知道如何提供你的 Javadoc 的摘要。
您可以检查 SonarQube 中每条规则的详细信息(背景、建议、严重性),并可以通过 SonarQube 顶部栏中显示的 'Rules' 选项卡更改它们的严重性并停用它们 UI.
我在我的项目中收到这条 SonarQube 消息:
First sentence of Javadoc is incomplete (period is missing) or not present. (L39)
为什么 SonarQubet 告诉我用句号结束我的 JavaDoc 中的第一句话? 我认为这是一种糟糕的风格——就像在列表中一样,您也不会以句号结束每个项目。或者报纸上的 header - 没有句点。
而且它不是 'Info' 类型,而是 'Major' tpye。什么是实际...?这对我来说没有任何意义。
有谁知道这条规则是从哪里来的? SonarQube-website(或互联网上的其他地方)是否有 SonarQube-rules 的推理数据库?我找不到任何相似的东西。
来自 Javadoc 工具指南中的 How to Write Doc Comments
The first sentence of each doc comment should be a summary sentence, containing a concise but complete description of the API item.
...
The Javadoc tool copies this first sentence to the appropriate member, class/interface or package summary
...
This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first tag (as defined below)
所以基本的答案是你需要第一句让 Javadoc 工具知道如何提供你的 Javadoc 的摘要。
您可以检查 SonarQube 中每条规则的详细信息(背景、建议、严重性),并可以通过 SonarQube 顶部栏中显示的 'Rules' 选项卡更改它们的严重性并停用它们 UI.