blob: b683bbe32099130cd2bc43b986a93578b0176f0b [file] [log] [blame]
<?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 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
Eclipse Skills PMD rules
</description>
<exclude-pattern>.*/org/eclipse/skills/model/.*</exclude-pattern>
<rule ref="category/java/bestpractices.xml">
<!-- Skills logger takes care of guarding -->
<exclude name="GuardLogStatement" />
</rule>
<rule ref="category/java/codestyle.xml">
<!-- Allow non final method arguments -->
<exclude name="MethodArgumentCouldBeFinal" />
<!-- Fields can be defined after static methods -->
<exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
<!-- Allow to use single line blocks without {} -->
<exclude name="IfStmtsMustUseBraces" />
<exclude name="IfElseStmtsMustUseBraces" />
<exclude name="ForLoopsMustUseBraces" />
<exclude name="WhileLoopsMustUseBraces" />
<exclude name="ControlStatementBraces" />
<!-- Allow additional () for readability -->
<exclude name="UselessParentheses" />
<!-- Allow more than one return statement in a method -->
<exclude name="OnlyOneReturn" />
<!-- Do not require to call super() in constructor -->
<exclude name="CallSuperInConstructor" />
<!-- Do not require a default constructor -->
<exclude name="AtLeastOneConstructor" />
<!-- Allow variable names -->
<exclude name="ShortVariable" />
<exclude name="LongVariable" />
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
<properties>
<property name="utilityClassPattern"
value="[A-Z][a-zA-Z0-9]+" />
</properties>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LawOfDemeter" />
<!-- needs detailed configuration to work, otherwise fails in maven -->
<exclude name="LoosePackageCoupling" />
</rule>
<rule ref="category/java/documentation.xml">
<exclude name="CommentRequired" />
<exclude name="CommentSize" />
<!-- Allow empty constructors without documentation -->
<exclude name="UncommentedEmptyConstructor" />
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="BeanMembersShouldSerialize" />
<!-- fails in maven build, see https://github.com/pmd/pmd/issues/873 -->
<exclude name="DataflowAnomalyAnalysis" />
</rule>
<rule ref="category/java/multithreading.xml" />
<rule ref="category/java/performance.xml" />
<rule ref="category/java/security.xml" />
</ruleset>