<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="nop-entropy-pmd-ruleset"
         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 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

    <description>
        Nop Entropy PMD 规则集 - 显式列出仅需要的 BUG 检测规则。
        不使用 category 整体引用(避免 PMD 版本升级引入大量噪声规则)。
        设计理由详见 ai-dev/design/code-quality/checkstyle-configuration.md
    </description>

    <!-- ===== Error Prone: 真正的 bug 检测 ===== -->
    <rule ref="category/java/errorprone.xml/EmptyCatchBlock"/>
    <rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
    <rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop"/>
    <rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough"/>
    <rule ref="category/java/errorprone.xml/CloneMethodMustImplementCloneable"/>
    <rule ref="category/java/errorprone.xml/CloneMethodReturnTypeMustMatchClassName"/>
    <rule ref="category/java/errorprone.xml/ProperCloneImplementation"/>

    <!-- ===== Security ===== -->
    <rule ref="category/java/security.xml/HardCodedCryptoKey"/>
    <rule ref="category/java/security.xml/InsecureCryptoIv"/>
</ruleset>