2016-11-29 44 views
1

我有一個源代碼的開頭有評論40行的Java文件來描述它實現的基本算法,如:Java的PMD CommentSize錯誤標題評論

/** 
* Detailed descriptions 
* ... 
    ... < total 40 lines of comments > ... 
*/ 

然而PMD發出「CommentSize」 錯誤是這樣的:

<violation beginline="1" endline="40" begincolumn="1" endcolumn="2" 
rule="CommentSize" ruleset="Comments" 
package="..." 
externalInfoUrl="https://pmd.github.io/pmd-5.4.0/pmd-java/rules/java/comments.html#CommentSize" 
priority="3"> 
    Comment is too large: Too many lines 
</violation> 

從詳細explanation here我發現:

Determi是否尺寸非標題評論發現有 在指定的範圍內。

我的理解這個規則applys只非首的意見和我在源代碼頂部意見應不會觸發這個錯誤,所以我的問題是:我誤解了什麼非首評論是否或在PMD中存在實施問題?

+0

這看起來像是PMD上的一個錯誤。您應該在https://github.com/pmd/pmd/issues上報告 – Johnco

回答

0

您是否配置規則?您可以配置一個名爲headerCommentRequirement的parameter。我認爲你需要將其設置爲忽略。