<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
    This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
    Checkstyle-Configuration: RCE
    Description: none
-->
<module name="Checker">
  <property name="severity" value="warning"/>
  <property name="localeCountry" value="US"/>
  <property name="localeLanguage" value="en"/>
  <module name="LineLength">
    <property name="fileExtensions" value="java"/>
    <property name="max" value="140" />
  </module>

  <module name="TreeWalker">
    <module name="MissingOverride"/>
    <module name="SuppressWarnings"/>
    <module name="EmptyBlock"/>
    <module name="LeftCurly"/>
    <module name="NeedBraces"/>
    <module name="RightCurly"/>
    <module name="AvoidNestedBlocks"/>
    <module name="VisibilityModifier">
      <property name="protectedAllowed" value="true"/>
      <property name="publicMemberPattern" value="^*$"/>
    </module>
    <module name="FinalClass"/>
    <module name="InterfaceIsType"/>
    <module name="HideUtilityClassConstructor"/>
    <module name="MutableException"/>
    <module name="AvoidInlineConditionals"/>
    <module name="EmptyStatement"/>
    <module name="EqualsHashCode"/>
    <module name="HiddenField">
      <property name="ignoreConstructorParameter" value="true"/>
      <property name="ignoreSetter" value="true"/>
    </module>
    <module name="IllegalInstantiation">
      <property name="classes" value="java.lang.Boolean"/>
    </module>
    <module name="InnerAssignment"/>
    <module name="MagicNumber">
      <property name="ignoreNumbers" value="0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10"/>
    </module>
    <module name="MissingSwitchDefault"/>
    <module name="ModifiedControlVariable"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="SimplifyBooleanReturn"/>
    <module name="StringLiteralEquality"/>
    <module name="NestedIfDepth">
      <property name="max" value="3"/>
    </module>
    <module name="NestedTryDepth">
      <property name="max" value="3"/>
    </module>
    <module name="IllegalCatch">
      <property name="illegalClassNames" value="java.lang.Exception, java.lang.Throwable"/>
    </module>
    <module name="IllegalType">
      <property name="severity" value="warning"/>
    </module>
    <module name="DeclarationOrder"/>
    <module name="DefaultComesLast"/>
    <module name="MultipleStringLiterals">
      <property name="allowedDuplicates" value="2"/>
      <property name="ignoreStringsRegexp" value="^((&quot;&quot;)|(&quot;, &quot;)|(&quot; &quot;)|(&quot;\\n&quot;)||(&quot;\)&quot;)|(&quot;\(&quot;)|(&quot;Dialog&quot;))$"/>
    </module>
    <module name="MultipleVariableDeclarations"/>
    <module name="AvoidStarImport"/>
    <module name="IllegalImport"/>
    <module name="RedundantImport"/>
    <module name="UnusedImports"/>
    <module name="JavadocType">
      <property name="scope" value="anoninner"/>
      <property name="authorFormat" value="[A-Z][\-\p{L}]*\s+[\p{L}\.\s]*[A-Z][\-\p{L}]*"/>
    </module>
    <module name="JavadocMethod">
      <property name="scope" value="public" />
      <property name="tokens" value="METHOD_DEF" />
    </module>
    <module name="JavadocVariable">
      <property name="scope" value="public"/>
    </module>
    <module name="JavadocStyle"/>
    <module name="TodoComment"/>
    <module name="UpperEll"/>
    <module name="ArrayTypeStyle"/>
    <module name="Indentation">
      <property name="caseIndent" value="0"/>
    </module>
    <module name="ModifierOrder"/>
    <module name="RedundantModifier">
      <property name="severity" value="warning"/>
    </module>
    <module name="ConstantName">
      <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|(shared[A-Z][a-zA-Z0-9]+)$"/>
    </module>
    <module name="LocalFinalVariableName"/>
    <module name="LocalVariableName"/>
    <module name="MemberName"/>
    <module name="MethodName">
      <property name="format" value="^[_a-z][a-zA-Z0-9]*$"/>
    </module>
    <module name="PackageName"/>
    <module name="ParameterName"/>
    <module name="StaticVariableName"/>
    <module name="TypeName"/>
    <module name="RegexpSinglelineJava">
      <property name="format" value="e\.printStackTrace"/>
      <property name="message" value="Provide a useful error message (instead of e.printStackTrace())."/>
    </module>
    <module name="RegexpSinglelineJava">
      <property name="format" value="System[.]out[.]print"/>
      <property name="message" value="Usage of print and println is not allowed."/>
    </module>
  
    <!-- Size Violations -->
    <property name="tabWidth" value="4" />
    <module name="MethodLength">
      <property name="tokens" value="METHOD_DEF"/>
    </module>
    <module name="ParameterNumber">
      <property name="tokens" value="METHOD_DEF"/>
    </module>
    <module name="CyclomaticComplexity">
      <property name="severity" value="warning"/>
      <property name="max" value="20"/>
      <property name="switchBlockAsSingleDecisionPoint" value="true"/>
    </module>
    <module name="CyclomaticComplexity">
      <property name="severity" value="error"/>
      <property name="max" value="45"/>
      <property name="switchBlockAsSingleDecisionPoint" value="true"/>
    </module>
    <module name="EmptyForIteratorPad"/>
    <module name="MethodParamPad"/>
    <module name="OperatorWrap"/>
    <module name="ParenPad"/>
    <module name="TypecastParenPad"/>
    <module name="WhitespaceAfter"/>
    <module name="WhitespaceAround">
      <property name="tokens" value="ASSIGN,MINUS,PLUS,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,DIV_ASSIGN,QUESTION,LOR,LAND,NOT_EQUAL,EQUAL,LT,GT,LE,GE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE"/>
    </module>
    <module name="SuppressionCommentFilter">
      <property name="offCommentFormat" value="CHECKSTYLE\:DISABLE \((\w+)\)"/>
      <property name="onCommentFormat" value="CHECKSTYLE\:ENABLE \((\w+)\)"/>
      <property name="checkFormat" value="$1"/>
    </module>
  </module>
  <module name="LineLength">
    <property name="fileExtensions" value="java"/>
    <property name="max" value="140"/>
  </module>
  <module name="SuppressionFilter">
    <property name="file" value="${config_loc}/suppressions.xml"/>
  </module>
  <module name="NewlineAtEndOfFile">
    <property name="lineSeparator" value="crlf"/>
    <property name="fileExtensions" value="java,properties,pom,MF"/>
  </module>
  <module name="Translation"/>
  <module name="FileLength">
    <property name="fileExtensions" value="java,properties,pom,MF"/>
  </module>
  <module name="FileTabCharacter">
    <property name="fileExtensions" value="java,properties,pom,MF"/>
  </module>
  <module name="RegexpHeader">
    <property name="header" value="^/\*\n \* Copyright (\([cC]\) )?\d\d\d\d[\-, ][\w\d\s,\.\-]+\n \* Copyright (\([cC]\) )?\d\d\d\d[\-, ][\w\d\s,\.\-]+\n \* \n \* (All rights reserved|SPDX-License-Identifier: \S+)\n \* \n \* https://rcenvironment.de/\n \*/"/>
    <property name="multiLines" value="3"/>
    <property name="fileExtensions" value="java"/>
  </module>
</module>
