<?xml version="1.0"?>

<ruleset name="Custom Rules"
        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 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
    <description>
JGrapes rules
    </description>

    <exclude-pattern>.*/test/.*</exclude-pattern>
    <exclude-pattern>.*/bin/.*</exclude-pattern>
    <exclude-pattern>.*/build/.*</exclude-pattern>
    <exclude-pattern>.*/generated/.*</exclude-pattern>
    <exclude-pattern>^generated/.*</exclude-pattern>

    <rule ref="category/java/bestpractices.xml">
        <exclude name="AccessorMethodGeneration"/>
        <exclude name="AvoidReassigningParameters"/>
    </rule>
    
    <rule ref="category/java/codestyle.xml">
        <exclude name="OnlyOneReturn"/>
        <exclude name="LocalVariableCouldBeFinal"/>
        <exclude name="MethodArgumentCouldBeFinal"/>
        <exclude name="AtLeastOneConstructor"/>
        <exclude name="DefaultPackage"/>
        <exclude name="CallSuperInConstructor"/>
        <exclude name="AbstractNaming"/>
        <exclude name="UseExplicitTypes"/>
    </rule>
    <rule ref="category/java/codestyle.xml/LongVariable">
      <properties>
         <property name="minimum" value="25" />
      </properties>
    </rule>
    <rule ref="category/java/codestyle.xml/FieldNamingConventions">
        <properties>
            <property name="exclusions" value="serialVersionUID,serialPersistentFields,logger" />
            <property name="violationSuppressRegex" 
                value="^.*'logger' is not all capitals."/>
        </properties>
    </rule>
    <rule ref="category/java/codestyle.xml/ShortVariable">
        <properties>
            <property name="violationSuppressRegex" 
                value="Avoid variables with short names like id"/>
        </properties>
    </rule>
    <rule ref="category/java/codestyle.xml/LinguisticNaming">
        <properties>
            <property name="checkSetters" value="false" />
        </properties>
    </rule>
    
    <rule ref="category/java/design.xml">
        <exclude name="LawOfDemeter"/>
    </rule>
    <rule ref="category/java/design.xml/NcssCount">
      <properties>
         <property name="methodReportLevel" value="35" />
      </properties>
    </rule>    
    <rule ref="category/java/design.xml/CyclomaticComplexity">
      <properties>
         <property name="methodReportLevel" value="15" />
      </properties>
    </rule>    
    <rule ref="category/java/design.xml/NPathComplexity">
      <properties>
         <property name="reportLevel" value="300" />
      </properties>
    </rule>    
    <rule ref="category/java/design.xml/TooManyMethods">
      <properties>
         <property name="maxmethods" value="20" />
      </properties>
    </rule>    
    <rule ref="category/java/design.xml/ExcessiveImports">
      <properties>
         <property name="minimum" value="50" />
      </properties>
    </rule>    
    
    <rule ref="category/java/documentation.xml">
        <exclude name="CommentSize"/>
    </rule>
    <rule ref="category/java/documentation.xml/CommentRequired">
      <properties>
         <property name="fieldCommentRequirement" value="Ignored" />
      </properties>
    </rule>    
    
    <rule ref="category/java/errorprone.xml">
        <exclude name="AvoidFieldNameMatchingMethodName"/>
        <exclude name="BeanMembersShouldSerialize"/>
        <exclude name="NullAssignment"/>
        <exclude name="UseProperClassLoader"/>
    </rule>
    
    <rule ref="category/java/multithreading.xml">
        <exclude name="DoNotUseThreads"/>
    </rule>
    
    <rule ref="category/java/performance.xml">
        <exclude name="SimplifyStartsWith"/>
    </rule>
    
</ruleset>
