Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ines
Drupal9 skeleton
Commits
9d434e39
Commit
9d434e39
authored
Feb 10, 2021
by
Ines WALLON
Browse files
update phpmd
parent
700f413c
Pipeline
#671
failed with stages
in 19 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/quality/phpmd.xml
View file @
9d434e39
<?xml version="1.0"?>
<ruleset
name=
"Drupal PHPMD Ruleset"
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>
Ruleset for PHPMD analysis of Drupal projects. Excludes coding issues
handled better by PHPCS and rules which have too many false positives
in a typical Drupal codebase.
</description>
<rule
ref=
"rulesets/codesize.xml"
>
<exclude
name=
"ExcessiveMethodLength"
/>
</rule>
<rule
ref=
"rulesets/controversial.xml/Superglobals"
/>
<rule
ref=
"rulesets/design.xml"
/>
<rule
ref=
"rulesets/naming.xml"
/>
<rule
ref=
"rulesets/unusedcode.xml"
>
<exclude
name=
"UnusedFormalParameter"
/>
</rule>
<ruleset
name=
"Drupal PHP MD 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"
>
<!--
As there are no official Drupal PHP MD rules, those ones had been taken from
https://gitlab.com/beram-drupal/drupal-ci. And slightly modified if needed.
-->
<!-- Clean Code Rules. -->
<rule
ref=
"rulesets/cleancode.xml"
>
<exclude
name=
"StaticAccess"
/>
<exclude
name=
"ElseExpression"
/>
</rule>
<!-- Code Size Rules. -->
<rule
ref=
"rulesets/codesize.xml"
>
<!-- <exclude name="CyclomaticComplexity" />-->
<!-- <exclude name="ExcessiveMethodLength" />-->
</rule>
<rule
ref=
"rulesets/codesize.xml/ExcessiveClassComplexity"
>
<properties>
<property
name=
"maximum"
value=
"100"
/>
</properties>
</rule>
<rule
ref=
"rulesets/codesize.xml/TooManyMethods"
>
<properties>
<property
name=
"maxmethods"
value=
"50"
/>
</properties>
</rule>
<!-- Controversial Rules. -->
<rule
ref=
"rulesets/controversial.xml"
>
<exclude
name=
"CamelCaseParameterName"
/>
<exclude
name=
"CamelCaseVariableName"
/>
</rule>
<!-- Design Rules. -->
<rule
ref=
"rulesets/design.xml"
/>
<!-- Naming Rules. -->
<rule
ref=
"rulesets/naming.xml"
>
<exclude
name=
"LongVariable"
/>
<exclude
name=
"ShortMethodName"
/>
<exclude
name=
"ShortVariable"
/>
</rule>
<rule
ref=
"rulesets/naming.xml/ShortMethodName"
>
<properties>
<property
name=
"minimum"
value=
"3"
/>
<!-- Allow id method name. -->
<property
name=
"exceptions"
description=
"Comma-separated list of exceptions"
value=
"id"
/>
</properties>
</rule>
<rule
ref=
"rulesets/naming.xml/ShortVariable"
>
<properties>
<property
name=
"minimum"
value=
"3"
/>
<!-- Allow $id and $op as a variable name. -->
<property
name=
"exceptions"
description=
"Comma-separated list of exceptions"
value=
"id,op"
/>
</properties>
</rule>
<!-- Unused Code Rules. -->
<rule
ref=
"rulesets/unusedcode.xml"
>
<exclude
name=
"UnusedFormalParameter"
/>
</rule>
</ruleset>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment