Skip to content

Instantly share code, notes, and snippets.

@josemiguelq
Created January 28, 2020 12:20
Show Gist options
  • Save josemiguelq/4d6eb21022d4d691bc3435e39115d5eb to your computer and use it in GitHub Desktop.
Save josemiguelq/4d6eb21022d4d691bc3435e39115d5eb to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<ruleset name="teranex PMD 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>PMD ruleset</description>
<!-- ************************************************************************** -->
<!-- ============================= Clean Code Rules ========================== -->
<!-- =================== https://phpmd.org/rules/cleancode.html =============== -->
<!-- ************************************************************************** -->
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess"/>
<exclude name="ElseExpression"/>
<exclude name="BooleanArgumentFlag"/>
</rule>
<!-- ************************************************************************** -->
<!-- ============================= Code Size Rules =========================== -->
<!-- ==================== https://phpmd.org/rules/codesize.html =============== -->
<!-- ************************************************************************** -->
<rule ref="rulesets/codesize.xml/TooManyPublicMethods">
<properties>
<property name="maxmethods" value="14"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<properties>
<property name="minimum" value="61"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml">
<exclude name="TooManyPublicMethods"/>
<exclude name="ExcessiveMethodLength"/>
</rule>
<!-- ************************************************************************** -->
<!-- ============================= Design Rules ============================= -->
<!-- ==================== https://phpmd.org/rules/design.html ================= -->
<!-- ************************************************************************** -->
<rule ref="rulesets/design.xml"/>
<!-- ************************************************************************** -->
<!-- ============================= Naming Rules ============================= -->
<!-- ================= https://phpmd.org/rules/naming.html ==================== -->
<!-- ************************************************************************** -->
<rule ref="rulesets/naming.xml/LongVariable">
<properties>
<property name="maximum" value="35"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml">
<exclude name="LongVariable"/>
<exclude name="ShortVariable"/>
</rule>
<!-- ************************************************************************** -->
<!-- ======================== Unused Code Rules ============================= -->
<!-- ================== https://phpmd.org/rules/unusedcode.html =============== -->
<!-- ************************************************************************** -->
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable">
<properties>
<property name="allow-unused-foreach-variables" value="true"/>
</properties>
</rule>
<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedLocalVariable"/>
<exclude name="UnusedFormalParameter"/>
</rule>
<!-- ************************************************************************** -->
<!-- ========================== Exclude Pattern ============================= -->
<!-- ************************************************************************** -->
<!-- Ignoring tests directory -->
<exclude-pattern>/tests/*</exclude-pattern>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment