2012-07-12 16 views
0

如何在PMD中使用屬性的默認規則。使用帶屬性的PMD默認規則

現在我使用的是默認的規則

<rule ref="rulesets/basic.xml/UselessOperationOnImmutable"/> 

這個工作正常,但像Codesize「NPathComplexity」的規則使用屬性,以便我們可以配置默認的規則了。如何配置這個。有人請幫忙。

回答

2
<rule ref="rulesets/codesize.xml/CyclomaticComplexity"> 
    <properties> 
    <property name="reportLevel" value="5"/> 
    </properties> 
</rule> 

工作正常。