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?
Asked
Active
Viewed 194 times
-1
-
I got the answer..... After creating custom standard file using [link][https://phpmd.org/documentation/creating-a-ruleset.html] place this file to [main][usr/share/data/PHPMD/resources/rulesets] I make file custom standard rules file name with [bold]customPHPMD.xml – hemali savaliya Oct 01 '18 at 04:08
1 Answers
1
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

eyllanesc
- 235,170
- 19
- 170
- 241

hemali savaliya
- 69
- 1
- 7