<?xml version='1.0' encoding="UTF-8"?>
<!--
    PHPMD ruleset for Simplyin_Payment.

    This MIRRORS Magento core's PHPMD ruleset
    (vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml)
    at Magento's exact thresholds. It is NOT relaxed and contains NO per-method
    @SuppressWarnings — size/complexity findings are fixed by genuinely splitting
    large methods/classes.

    The 3 Magento-specific rules from the core ruleset
    (AllPurposeAction, CookieAndSessionMisuse, UnusedFormalParameter) are NOT listed
    here because they require the Magento framework on the PHPMD include path; they are
    enforced by Magento's static test suite (dev/tests/static) in a full Magento
    environment. This file is the locally-runnable subset, at identical thresholds.

    Usage (one file at a time — see .github/workflows/quality.yml for why
    directory-mode/batch scanning is unsafe with this tool and silently
    misses violations). Assumes a phpmd binary on PATH (e.g. a global
    Composer install, or the same shivammathur/setup-php "tools:" install CI
    uses) - this module has no local vendor/bin/phpmd:
    phpmd app/code/Simplyin/Payment/Service/SomeClass.php text app/code/Simplyin/Payment/phpmd.xml
-->
<ruleset name="Simplyin Payment PHPMD 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">

    <description>Simplyin Payment PHPMD (mirrors Magento core ruleset, standard-rule subset)</description>

    <!-- Code Size Rules -->
    <rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
    <rule ref="rulesets/codesize.xml/NPathComplexity" />
    <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
    <rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
    <rule ref="rulesets/codesize.xml/ExcessivePublicCount" />
    <rule ref="rulesets/codesize.xml/TooManyFields" />
    <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
        <properties>
            <property name="maximum" value="100" />
        </properties>
    </rule>

    <!-- Unused code rules (UnusedFormalParameter is the Magento-custom variant, enforced in Magento env) -->
    <rule ref="rulesets/unusedcode.xml">
        <exclude name="UnusedFormalParameter"/>
    </rule>

    <!-- Code design rules -->
    <rule ref="rulesets/design.xml/NumberOfChildren" />
    <rule ref="rulesets/design.xml/DepthOfInheritance">
        <properties>
            <property name="minimum" value="8" />
        </properties>
    </rule>
    <rule ref="rulesets/design.xml/CouplingBetweenObjects" />

    <!-- Naming Rules -->
    <rule ref="rulesets/naming.xml/ShortMethodName" />
    <rule ref="rulesets/naming.xml/ConstantNamingConventions" />
    <rule ref="rulesets/naming.xml/BooleanGetMethodName" />

</ruleset>
