Skip to content

Fix incorrect override of CouplingBetweenObjects for Magento 2#71

Open
ArjenMiedema wants to merge 1 commit into
YouweGit:masterfrom
ArjenMiedema:bugfix/phpmd-resolve-duplicate-coupling-between-objects
Open

Fix incorrect override of CouplingBetweenObjects for Magento 2#71
ArjenMiedema wants to merge 1 commit into
YouweGit:masterfrom
ArjenMiedema:bugfix/phpmd-resolve-duplicate-coupling-between-objects

Conversation

@ArjenMiedema
Copy link
Copy Markdown
Contributor

It's not possible to override PHPMD config, so the design ruleset with its default CouplingBetweenObjects set to 13 and the custom override below of 20 resulted in the check being done twice with two different maximum values.

By excluding the original value the override from 13 to 20 does work as expected.

It's not possible to override PHPMD config, so the design ruleset
with its default CouplingBetweenObjects set to 13 and the custom
override below of 20 resulted in the check being done twice with
two different maximum values.

By excluding the original value the override from 13 to 20 does work
as expected.
Comment thread config/magento2/phpmd.xml

<rule ref="rulesets/design.xml" />
<rule ref="rulesets/design.xml">
<exclude name="CouplingBetweenObjects"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exclude name="CouplingBetweenObjects"/>
<!-- For this rule we have exceptions configured below -->
<exclude name="CouplingBetweenObjects"/>

Same comment as we use on rulesets/naming.xml to make clear this rule is not disabled but merely overidden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants