/usr/share/php/data/PHP_PMD/resources/rulesets/controversial.xml is in phpmd 1.5.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | <?xml version="1.0"?>
<ruleset name="Controversial 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>
This ruleset contains a collection of controversial rules.
</description>
<rule name="Superglobals"
since="0.2"
message = "{0} accesses the super-global variable {1}."
class="PHP_PMD_Rule_Controversial_Superglobals"
externalInfoUrl="#">
<description>
<![CDATA[
Accessing a super-global variable directly is considered a bad practice.
These variables should be encapsulated in objects that are provided by a framework, for instance.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
]]>
</example>
</rule>
<rule name="CamelCaseClassName"
since="0.2"
message = "The class {0} is not named in CamelCase."
class="PHP_PMD_Rule_Controversial_CamelCaseClassName"
externalInfoUrl="#">
<description>
<![CDATA[
It is considered best practice to use the CamelCase notation to name classes.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
class class_name {
}
]]>
</example>
</rule>
<rule name="CamelCasePropertyName"
since="0.2"
message = "The property {0} is not named in camelCase."
class="PHP_PMD_Rule_Controversial_CamelCasePropertyName"
externalInfoUrl="#">
<description>
<![CDATA[
It is considered best practice to use the camelCase notation to name attributes.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
class ClassName {
protected $property_name;
}
]]>
</example>
</rule>
<rule name="CamelCaseMethodName"
since="0.2"
message = "The method {0} is not named in camelCase."
class="PHP_PMD_Rule_Controversial_CamelCaseMethodName"
externalInfoUrl="#">
<description>
<![CDATA[
It is considered best practice to use the CamelCase notation to name methods.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
class ClassName {
public function get_name() {
}
}
]]>
</example>
</rule>
<rule name="CamelCaseParameterName"
since="0.2"
message = "The parameter {0} is not named in camelCase."
class="PHP_PMD_Rule_Controversial_CamelCaseParameterName"
externalInfoUrl="#">
<description>
<![CDATA[
It is considered best practice to use the camelCase notation to name parameters.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
class ClassName {
public function doSomething($user_name) {
}
}
]]>
</example>
</rule>
<rule name="CamelCaseVariableName"
since="0.2"
message = "The variable {0} is not named in camelCase."
class="PHP_PMD_Rule_Controversial_CamelCaseVariableName"
externalInfoUrl="#">
<description>
<![CDATA[
It is considered best practice to use the camelCase notation to name variables.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
]]>
</example>
</rule>
</ruleset>
|