netbeans-8phpmd

Will you please tell me how to set custom phpmd ruleset file in netbeans 8.1?


I'm installing phpmd into netbeans and it gives me error also but what if I want to set my custom ruleset file in netbeans 8.1?


Solution

  • I got the answer.....
    After creating custom standard file using link
    place this file to [main][usr/share/data/PHPMD/resources/rulesets]
    I make file custom standard rules file name with [bold][customPHPMD.xml]

    for that I Write some command on terminal

    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>
    

    after This Rightclick on project->properties->phpcsmd

    and add customPHPMD rule inside rule tab of phpmd