-
-
Notifications
You must be signed in to change notification settings - Fork 436
/
.phpcs.dist.ecg.xml
146 lines (144 loc) · 6.39 KB
/
.phpcs.dist.ecg.xml
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
145
146
<?xml version="1.0"?>
<ruleset name="OpenMage ECG" namespace="OpenMage\CS\Standard">
<file>api.php</file>
<file>cron.php</file>
<file>get.php</file>
<file>index.php</file>
<file>install.php</file>
<file>app/Mage.php</file>
<file>app/code/core/Mage/</file>
<file>errors/</file>
<file>lib/Mage/</file>
<file>lib/Magento/</file>
<file>lib/Varien/</file>
<file>shell/</file>
<exclude-pattern>*/core/Mage/*/data/*</exclude-pattern>
<exclude-pattern>*/core/Mage/*/sql/*</exclude-pattern>
<rule ref="Ecg" />
<rule ref="Ecg.Classes.Mysql4.Found">
<exclude-pattern>*/core/Mage/Catalog/Model/Resource/Eav/Mysql4/**.php*</exclude-pattern>
<exclude-pattern>*/core/Mage/Install/Block/Db/Type/Mysql4.php*</exclude-pattern>
<exclude-pattern>*/core/Mage/Install/Model/Installer/Db/Mysql4.php*</exclude-pattern>
<!-- remove when MySql4 classes are removed -->
<exclude-pattern>*/core/Mage/*/Model/Mysql4/**.php*</exclude-pattern>
<!-- resource helpers - keep -->
<exclude-pattern>*/core/Mage/*/Model/Resource/Helper/Mysql4.php*</exclude-pattern>
</rule>
<rule ref="Ecg.Classes.ObjectInstantiation">
<!-- should be reviewed -->
<exclude name="Ecg.Classes.ObjectInstantiation.DirectInstantiation"/>
</rule>
<rule ref="Ecg.Performance">
<!-- should be reviewed -->
<exclude name="Ecg.Performance.CollectionCount.Found"/>
<!-- should be reviewed/commented -->
<exclude name="Ecg.Performance.GetFirstItem.Found"/>
<!-- should be commented -->
<exclude name="Ecg.Performance.FetchAll.Found"/>
<!-- should be reviewed/commented -->
<exclude name="Ecg.Performance.Loop.DataLoad"/>
<!-- should be reviewed/commented -->
<exclude name="Ecg.Performance.Loop.ModelLSD"/>
<!-- should be reviewed -->
<exclude name="Ecg.Performance.Loop.ArraySize"/>
</rule>
<rule ref="Ecg.PHP">
<!-- should be commented -->
<exclude name="Ecg.PHP.PrivateClassMember.PrivateClassMemberError"/>
</rule>
<rule ref="Ecg.Security">
<!-- can be reviewed -->
<exclude name="Ecg.Security.Acl.MissingAclMethod"/>
<!-- should be reviewed -->
<exclude name="Ecg.Security.DiscouragedFunction.Discouraged"/>
<!-- should be reviewed -->
<exclude name="Ecg.Security.ForbiddenFunction.Found"/>
<!-- should be reviewed -->
<exclude name="Ecg.Security.IncludeFile.IncludeFileDetected"/>
<!-- should be ignored -->
<exclude name="Ecg.Security.LanguageConstruct.DirectOutput"/>
<!-- should be ignored -->
<exclude name="Ecg.Security.LanguageConstruct.ExitUsage"/>
<!-- should be ignored - PHPMD -->
<exclude name="Ecg.Security.Superglobal.SuperglobalUsageWarning"/>
<!-- should be ignored - PHPMD -->
<exclude name="Ecg.Security.Superglobal.SuperglobalUsageError"/>
</rule>
<rule ref="Ecg.Strings">
<!-- should be fixed -->
<exclude name="Ecg.Strings.StringPosition.ImproperValueTesting"/>
</rule>
<rule ref="Ecg.Sql">
<!-- should be fixed -->
<exclude name="Ecg.Sql.RawQuery.RawSql"/>
<!-- should be commented -->
<exclude name="Ecg.Sql.SlowQuery.SlowSql"/>
<!-- should be commented -->
<exclude name="Ecg.Sql.SlowQuery.SlowRawSql"/>
</rule>
<rule ref="Generic.CodeAnalysis">
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.Found"/>
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
<!-- should be fixed -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedWhile"/>
<!-- should be reviewed -->
<exclude name="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed"/>
<!-- should be reviewed -->
<exclude name="Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence.MissingParentheses"/>
<!-- should be ignored - PHPMD -->
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<!-- should be reviewed -->
<exclude name="Generic.CodeAnalysis.UselessOverridingMethod.Found"/>
</rule>
<rule ref="Generic.Commenting">
<exclude name="Generic.Commenting.DocComment"/>
<!-- should be reviewed -->
<exclude name="Generic.Commenting.Fixme.TaskFound"/>
<!-- should be reviewed -->
<exclude name="Generic.Commenting.Todo.CommentFound"/>
<!-- should be reviewed -->
<exclude name="Generic.Commenting.Todo.TaskFound"/>
</rule>
<rule ref="Generic.Metrics">
<!-- should be reviewed -->
<exclude name="Generic.Metrics.CyclomaticComplexity.MaxExceeded"/>
<!-- should be reviewed -->
<exclude name="Generic.Metrics.CyclomaticComplexity.TooHigh"/>
<!-- should be reviewed -->
<exclude name="Generic.Metrics.NestingLevel.MaxExceeded"/>
<!-- should be reviewed -->
<exclude name="Generic.Metrics.NestingLevel.TooHigh"/>
</rule>
<rule ref="Generic.Metrics">
<!-- should be ignored - PHPMD -->
<exclude name="Generic.PHP.NoSilencedErrors.Discouraged"/>
</rule>
<rule ref="Squiz.Functions.GlobalFunction">
<!-- should be ignored -->
<exclude name="Squiz.Functions.GlobalFunction.Found"/>
</rule>
<rule ref="Squiz.Operators.IncrementDecrementUsage">
<!-- should be ignored -->
<exclude name="Squiz.Operators.IncrementDecrementUsage.NoBrackets"/>
</rule>
<rule ref="Squiz.PHP.NonExecutableCode">
<!-- should be fixed -->
<exclude name="Squiz.PHP.NonExecutableCode.ReturnNotRequired"/>
<!-- should be fixed -->
<exclude name="Squiz.PHP.NonExecutableCode.Unreachable"/>
</rule>
<rule ref="Squiz.PHP.Eval">
<!-- should be reviewed -->
<exclude name="Squiz.PHP.Eval.Discouraged"/>
</rule>
</ruleset>