![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/phpmd/phpmd/src/main/resources/rulesets/ |
<?xml version="1.0"?> <ruleset name="Unused Code Rules" 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> The Unused Code Ruleset contains a collection of rules that find unused code. </description> <rule name="UnusedPrivateField" since="0.2" message="Avoid unused private fields such as '{0}'." class="PHPMD\Rule\UnusedPrivateField" externalInfoUrl="https://phpmd.org/rules/unusedcode.html#unusedprivatefield"> <description> Detects when a private field is declared and/or assigned a value, but not used. </description> <priority>3</priority> <example> <![CDATA[ class Something { private static $FOO = 2; // Unused private $i = 5; // Unused private $j = 6; public function addOne() { return $this->j++; } } ]]> </example> </rule> <rule name="UnusedLocalVariable" since="0.2" message="Avoid unused local variables such as '{0}'." class="PHPMD\Rule\UnusedLocalVariable" externalInfoUrl="https://phpmd.org/rules/unusedcode.html#unusedlocalvariable"> <description> Detects when a local variable is declared and/or assigned, but not used. </description> <priority>3</priority> <properties> <property name="allow-unused-foreach-variables" description="Allow unused variables in foreach language constructs." value="false" /> <property name="exceptions" description="Comma-separated list of exceptions" value=""/> </properties> <example> <![CDATA[ class Foo { public function doSomething() { $i = 5; // Unused } } ]]> </example> </rule> <rule name="UnusedPrivateMethod" since="0.2" message="Avoid unused private methods such as '{0}'." class="PHPMD\Rule\UnusedPrivateMethod" externalInfoUrl="https://phpmd.org/rules/unusedcode.html#unusedprivatemethod"> <description> Unused Private Method detects when a private method is declared but is unused. </description> <priority>3</priority> <example> <![CDATA[ class Something { private function foo() {} // unused } ]]> </example> </rule> <rule name="UnusedFormalParameter" since="0.2" message="Avoid unused parameters such as '{0}'." class="PHPMD\Rule\UnusedFormalParameter" externalInfoUrl="https://phpmd.org/rules/unusedcode.html#unusedformalparameter"> <description> Avoid passing parameters to methods or constructors and then not using those parameters. </description> <priority>3</priority> <example> <![CDATA[ class Foo { private function bar($howdy) { // $howdy is not used } } ]]> </example> </rule> </ruleset>