【问题标题】:Will you please tell me how to set custom phpmd ruleset file in netbeans 8.1? [closed]您能告诉我如何在 netbeans 8.1 中设置自定义 phpmd 规则集文件吗? [关闭]
【发布时间】:2018-09-28 04:30:38
【问题描述】:

我正在将 phpmd 安装到 netbeans 中,它也给了我错误但是如果我想在 netbeans 8.1 中设置我的自定义规则集文件怎么办?

【问题讨论】:

  • 我得到了答案.....使用 [link][phpmd.org/documentation/creating-a-ruleset.html] 创建自定义标准文件后,将此文件放置到 [main][usr/share/data/PHPMD/resources/rulesets]我使用 [bold]customPHPMD.xml 制作文件自定义标准规则文件名

标签: netbeans-8 phpmd


【解决方案1】:

我得到了答案.....
使用 link
创建自定义标准文件后 将此文件放置到 [main][usr/share/data/PHPMD/resources/rulesets]
我使用 [bold][customPHPMD.xml]

制作文件自定义标准规则文件名

为此我在终端上写了一些命令

cd usr/share/data/PHPMD/resources/rulesets
sudo nano customPHPMD.xml
sudo chmod 777 cusomtPHPMD.xml

<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
         xmlns="http://pmd.sf.net/ruleset/1.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
                     http://pmd.sf.net/ruleset_xml_schema.xsd"
         xsi:noNamespaceSchemaLocation="
                     http://pmd.sf.net/ruleset_xml_schema.xsd">
    <description>
        My custom rule set that checks my code...
    </description>

    <!-- Import the entire unused code rule set -->
    <rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
    <rule ref="rulesets/codesize.xml/NPathComplexity" />
    <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
    <rule ref="rulesets/codesize.xml/ExcessiveClassLength" />
    <rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
    <rule ref="rulesets/codesize.xml/TooManyFields" />  
    <rule ref="rulesets/codesize.xml/TooManyMethods" /> 
    <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />   
    <rule ref="rulesets/controversial.xml/CamelCaseClassName" />
    <rule ref="rulesets/controversial.xml/CamelCasePropertyName" /> 
    <rule ref="rulesets/controversial.xml/CamelCaseMethodName" />           
    <rule ref="rulesets/controversial.xml/CamelCaseParameterName" />    
    <rule ref="rulesets/controversial.xml/ExitExpression" />    
    <rule ref="rulesets/design.xml/ExitExpression" />   
</ruleset>

在此之后右键单击项目->属性->phpcsmd

【讨论】:

    猜你喜欢
    • 2023-03-14
    • 1970-01-01
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 1970-01-01
    • 2021-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多