-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathphpmd.xml
More file actions
78 lines (72 loc) · 3.18 KB
/
Copy pathphpmd.xml
File metadata and controls
78 lines (72 loc) · 3.18 KB
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
<?xml version="1.0"?>
<ruleset name="2amigos QrCode Library"
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>
PHPMD ruleset for 2amigos/qrcode-library. It is the standard rulesets, with a few rules
relaxed where they do not fit this codebase: a graphics/math library uses short, spec-matching
variable names; renderers/factories rely on static access (factory methods, framework facades,
BaconQrCode static enums); and the framework adapters expose established builder-style APIs.
</description>
<!--
Clean Code:
- StaticAccess: factory methods, Laravel facades and BaconQrCode static enum/factory calls.
- BooleanArgumentFlag: the property-accessor API (AbstractFormat) intentionally takes flags.
- ElseExpression: contentious; the few uses read more clearly with an else.
-->
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess"/>
<exclude name="BooleanArgumentFlag"/>
<exclude name="ElseExpression"/>
</rule>
<!--
Code Size: the GD rasterizer is inherently complex (scanline fill, SVG-arc/bezier flattening);
raise the thresholds rather than obscuring clear algorithms. The Laravel factory/blade
component use a builder-style parameter list.
-->
<rule ref="rulesets/codesize.xml">
<exclude name="CyclomaticComplexity"/>
<exclude name="NPathComplexity"/>
<exclude name="ExcessiveClassComplexity"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="TooManyFields"/>
</rule>
<!-- The Laravel blade component mirrors every QR option as a bindable public field. -->
<rule ref="rulesets/codesize.xml/TooManyFields">
<properties>
<property name="maxfields" value="20"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="15"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/NPathComplexity">
<properties>
<property name="minimum" value="400"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
<properties>
<property name="maximum" value="100"/>
</properties>
</rule>
<rule ref="rulesets/controversial.xml"/>
<!-- Design: the GD backend and StyleManager legitimately bridge many BaconQrCode types. -->
<rule ref="rulesets/design.xml">
<exclude name="CouplingBetweenObjects"/>
</rule>
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<properties>
<property name="maximum" value="20"/>
</properties>
</rule>
<!-- Naming: short names (x, y, rx, cx, r, g, b, t) read better in graphics/math code. -->
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
</rule>
<rule ref="rulesets/unusedcode.xml"/>
</ruleset>