Repository navigation
Expand file tree
/
Copy pathphpmd-db.xml
More file actions
50 lines (44 loc) · 2.65 KB
/
Copy pathphpmd-db.xml
File metadata and controls
50 lines (44 loc) · 2.65 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
<?xml version="1.0"?>
<ruleset name="Keepiq Nextcloud Rules (lib/Db persistence layer)"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
http://pmd.sourceforge.net/ruleset_xml_schema.xsd">
<description>
The full keepiq ruleset (phpmd.xml) MINUS the two rules that measure a
database table's shape rather than a design defect. Applied to lib/Db/
only. Every other rule in phpmd.xml stays in force here - see the long
rationale in phpmd.xml.
</description>
<rule ref="phpmd.xml">
<!-- TooManyFields: in an OCP\AppFramework\Db\Entity subclass one
protected property IS one database column. Nextcloud's Entity
base class derives the column list, the magic getters/setters and
the dirty-field tracking from the declared properties, so the
field count is not a modelling choice - it is the width of the
table. Keepiq's two widest tables are:
Db\Secret 19 fields -> `keepiq_secrets`
Db\SiemSink 18 fields -> `keepiq_siem_sinks`
Verified against the migration that owns those tables:
Version001000Date20260908000000 declares `keepiq_secrets` with 19
columns and `keepiq_siem_sinks` with 18, which is where these two
counts come from. That single migration replaced the 35 incremental
ones that used to build the tables a column at a time. Every
property on the entity is one of those real columns. The only refactor that takes the class under the
threshold of 15 is splitting the app's core secrets table in a
destructive migration - i.e. the rule is unreachable by
refactoring the PHP.
This is a rule-scoped, path-scoped exception. It is NOT an
@SuppressWarnings (which would have to be repeated on every future
entity and is invisible to the count) and NOT a baseline file
(which hides everything that exists today, including real
defects). -->
<exclude name="TooManyFields"/>
<!-- ExcessiveClassLength: same cause. An entity's length is a linear
function of its column count - each column contributes a typed
property plus its @method docblock entries. No lib/Db class trips
this today; the rule is excluded here so that the next wide table
does not reopen the same unreachable ticket. -->
<exclude name="ExcessiveClassLength"/>
</rule>
</ruleset>