<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
    Checkstyle configuration that checks the SSHD coding conventions.
    Checkstyle is very configurable. Be sure to read the documentation at
    http://checkstyle.sf.net (or in your downloaded distribution).
    To completely disable a check, just comment it out or delete it from the file.

    Authors: Guillaume Nodet, Goldstein Lyor
 -->

<module name="Checker">
	<!-- Checks whether files end with a new line.                        -->
	<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
	<!--
		<module name="NewlineAtEndOfFile" />
	-->

	<!-- Checks that property files contain the same keys.         -->
	<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
	<module name="Translation" />

	<!--<module name="StrictDuplicateCode" />-->
    <!--
    <module name="LineLength">
        <property name="max" value="180" />
        <property name="fileExtensions" value="java" />
    </module>
    -->

	<module name="TreeWalker">
        <property name="tabWidth" value="4"/>
            <!-- Checks for Javadoc comments.                     -->
            <!-- See http://checkstyle.sf.net/config_javadoc.html -->
            <!--
                <module name="PackageHtml" />
                <module name="JavadocMethod" />
                <module name="JavadocType" />
                <module name="JavadocVariable" />
                <module name="JavadocStyle" />
            -->

            <!-- Check annotations conventions -->
            <!-- See http://checkstyle.sourceforge.net/config_annotation.html -->
        <module name="MissingOverride" />
            <!-- Un-comment when stops complaining about HTML violations -->
        <!-- module name="MissingDeprecated">
            <property name="violateExecutionOnNonTightHtml" value="false" />
        </module -->

        <!--
        <module name="AnnotationLocation">
            <property name="allowSamelineMultipleAnnotations" value="false" />
            <property name="allowSamelineSingleParameterlessAnnotation" value="false" />
            <property name="allowSamelineParameterizedAnnotation" value="false" />
        </module>
        -->

            <!-- Checks for Naming Conventions.                  -->
            <!-- See http://checkstyle.sf.net/config_naming.html -->
        <module name="ConstantName" />
        <module name="LocalFinalVariableName" />
        <module name="LocalVariableName">
            <property name="format" value="^[a-z][a-zA-Z0-9_]*$" />
        </module>
        <module name="MemberName">
            <property name="format" value="^[a-z][a-zA-Z0-9_]*$" />
        </module>
        <module name="MethodName" />
            <!-- Allow only lowercase and digits in package name -->
        <module name="PackageName">
            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
        </module>
        <module name="ParameterName">
            <property name="format" value="^[a-z][a-zA-Z0-9_]*$" />
        </module>
        <module name="InterfaceTypeParameterName">
            <property name="format" value="^[A-Z]+$" />
        </module>
        <module name="StaticVariableName" />
        <module name="TypeName" />

            <!-- Checks for imports                              -->
            <!-- See http://checkstyle.sf.net/config_imports.html -->
        <!--
        <module name="AvoidStarImport" />
        <module name="AvoidStaticImport" />
        <module name="IllegalImport" />
        <module name="RedundantImport" />
        <module name="UnusedImports" />
        <module name="ImportOrder">
            <property name="groups" value="java,javax,org,net,io,com,*" />
            <property name="ordered" value="true" />
            <property name="separated" value="true" />
        </module>
        -->

            <!--
                <module name="ImportControl">
                    <property name="file" value="etc/import-control.xml" />
                </module>
            -->

            <!-- Checks for Size Violations.                    -->
            <!-- See http://checkstyle.sf.net/config_sizes.html -->
        <module name="AnonInnerLength">
            <property name="max" value="50" />
        </module>
        <module name="ExecutableStatementCount">
            <property name="max" value="100" />
        </module>
        <module name="MethodLength">
            <property name="max" value="150" />
            <property name="countEmpty" value="false" />
        </module>
        <module name="ParameterNumber">
            <property name="max" value="8" />
        </module>
        <module name="OuterTypeNumber">
            <property name="max" value="2"/>
        </module>
        <module name="MethodCount">
            <property name="maxPrivate" value="5"/>
            <property name="maxPackage" value="5"/>
        </module>

            <!-- Checks for whitespace                               -->
            <!-- See http://checkstyle.sf.net/config_whitespace.html -->
        <!--
        <module name="EmptyForIteratorPad" />
        <module name="EmptyForInitializerPad" />
        <module name="MethodParamPad" />
        <module name="WhitespaceAfter" />
        <module name="NoWhitespaceBefore">
            <property name="tokens" value="COMMA,ELLIPSIS,SEMI,POST_INC,POST_DEC,METHOD_REF" />
        </module>
        <module name="NoWhitespaceAfter">
            <property name="tokens" value="ARRAY_INIT,BNOT,DEC,DOT,INC,AT,LNOT,UNARY_MINUS,UNARY_PLUS,METHOD_REF" />
        </module>
        <module name="EmptyLineSeparator">
            <property name="tokens" value="IMPORT,CLASS_DEF,INTERFACE_DEF,STATIC_INIT,INSTANCE_INIT,METHOD_DEF,CTOR_DEF" />
            <property name="allowMultipleEmptyLines" value="false" />
            <property name="allowNoEmptyLineBetweenFields" value="true" />
            <property name="allowMultipleEmptyLinesInsideClassMembers" value="false" />
        </module>
        <module name="GenericWhitespace"/>
        <module name="OperatorWrap" />
        <module name="ParenPad" />
        <module name="NoLineWrap" />
        <module name="TypecastParenPad" />
        <module name="WhitespaceAround">
            <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN,TYPE_EXTENSION_AND" />
        </module>
        -->

            <!-- Modifier Checks                                    -->
            <!-- See http://checkstyle.sf.net/config_modifiers.html -->
        <module name="ModifierOrder" />
        <module name="RedundantModifier" />

            <!-- Checks for blocks. You know, those {}'s         -->
            <!-- See http://checkstyle.sf.net/config_blocks.html -->
        <module name="AvoidNestedBlocks">
            <property name="allowInSwitchCase" value="true" />
        </module>
        <module name="EmptyBlock">
            <property name="option" value="text" />
        </module>
        <module name="LeftCurly" />
        <module name="NeedBraces" />
        <module name="RightCurly" />
        <module name="EmptyCatchBlock">
            <property name="exceptionVariableName" value="expected|ignore" />
        </module>

            <!-- Checks for common coding problems               -->
            <!-- See http://checkstyle.sf.net/config_coding.html -->
        <!--<module name="ArrayTrailingComma" />-->
        <!--<module name="AvoidInlineConditionals" />-->
        <module name="CovariantEquals" />
        <module name="EmptyStatement" />
        <module name="EqualsHashCode" />
        <!--<module name="FinalLocalVariable" />-->
        <!-- DISABLED
            <module name="HiddenField">
                <property name="ignoreConstructorParameter" value="true" />
                <property name="ignoreSetter" value="true" />
            </module>
        -->
        <module name="IllegalInstantiation" />
        <!--<module name="IllegalToken" />-->
        <!--<module name="IllegalTokenText" />-->
        <module name="InnerAssignment" />
        <!--<module name="MagicNumber" />-->
        <module name="MissingSwitchDefault" />
        <!--module name="ModifiedControlVariable"/-->
        <module name="NoFinalizer" />
        <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="NestedForDepth">
          <property name="max" value="3"/>
        </module>
        <module name="SuperClone" />
        <module name="SuperFinalize" />
        <!--<module name="IllegalCatch" />-->
        <module name="IllegalThrows">
            <property name="illegalClassNames" value="java.lang.Error,java.lang.RuntimeException" />
        </module>
        <!--<module name="RedundantThrows" />-->
        <module name="PackageDeclaration" />
        <!-- see http://checkstyle.sourceforge.net/config_coding.html#ReturnCount -->
        <module name="ReturnCount">
            <property name="max" value="15" />
            <property name="maxForVoid" value="15" />
        </module>

        <module name="IllegalType">
            <property name="illegalClassNames" value="java.util.GregorianCalendar, java.util.Hashtable, java.util.HashSet, java.util.HashMap, java.util.ArrayList, java.util.LinkedList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap" />
        </module>
        <module name="DeclarationOrder" />
        <!--<module name="ParameterAssignment" />-->
        <module name="ExplicitInitialization" />
        <module name="DefaultComesLast" />
        <module name="MissingCtor" />
        <module name="FallThrough" />
        <!--<module name="MultipleStringLiterals" />-->
        <module name="VariableDeclarationUsageDistance">
            <property name="allowedDistance" value="8" />
        </module>
        <module name="MultipleVariableDeclarations" />
        <!--<module name="RequireThis" />-->
        <!-- module name="UnnecessaryParentheses" / -->

            <!-- Checks for class design                         -->
            <!-- See http://checkstyle.sf.net/config_design.html -->
        <!--<module name="DesignForExtension" />-->
        <module name="FinalClass" />
        <module name="HideUtilityClassConstructor" />
        <module name="InterfaceIsType" />
        <!--<module name="MutableException" />-->
        <module name="ThrowsCount">
            <property name="max" value="5" />
        </module>
        <module name="VisibilityModifier">
            <property name="protectedAllowed" value="true" />
            <property name="packageAllowed" value="true" />
            <!-- this is needed for the resource injection unit tests.  It will removed
                  when private member inject is supported.
             -->
            <property name="publicMemberPattern" value="resource[12].*" />
        </module>

            <!-- Metrics checks.                   -->
            <!-- See http://checkstyle.sf.net/config_metrics.html -->
        <module name="BooleanExpressionComplexity">
            <property name="max" value="10" />
        </module>
        <!--<module name="ClassDataAbstractionCoupling" />-->
        <!--<module name="ClassFanOutComplexity" />-->
        <!--<module name="CyclomaticComplexity" />-->
        <!--<module name="NPathComplexity" />-->
        <module name="JavaNCSS">
            <property name="methodMaximum" value="150" />
            <property name="classMaximum" value="2000" />
        </module>

            <!-- Miscellaneous other checks.                   -->
            <!-- See http://checkstyle.sf.net/config_misc.html -->
        <!--
            <module name="ArrayTypeStyle" />
            <module name="FinalParameters" />
        -->
        <!-- DISABLED
            <module name="TodoComment">
                <property name="format" value="TODO" />
            </module>
        -->

        <module name="UpperEll" />

            <!--Assert statement may have side effects:-->
        <module name="DescendantToken">
            <property name="tokens" value="LITERAL_ASSERT" />
            <property name="limitedTokens" value="ASSIGN,DEC,INC,POST_DEC,POST_INC,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,DIV_ASSIGN,MOD_ASSIGN,BSR_ASSIGN,SR_ASSIGN,SL_ASSIGN,BAND_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN" />
            <property name="maximumNumber" value="0" />
        </module>

            <!--<module name="UncommentedMain" />-->
            <!--module name="TrailingComment"/-->
        <!--
        <module name="Indentation">
            <property name="caseIndent" value="4" />
            <property name="lineWrappingIndentation" value="0" />
        </module>
        -->
            <!--<module name="RequiredRegexp">-->
        <!-- Make the @SuppressWarnings annotations available to Checkstyle -->
        <module name="SuppressWarningsHolder" />
        <module name="SuppressionCommentFilter">
            <property name="offCommentFormat" value="CHECKSTYLE\:OFF" />
            <property name="onCommentFormat" value="CHECKSTYLE\:ON" />
        </module>
        <module name="SuppressionCommentFilter">
            <property name="offCommentFormat" value="CHECKSTYLE.OFF\:([\w\|]+)" />
            <property name="onCommentFormat" value="CHECKSTYLE.ON\:([\w\|]+)" />
            <property name="checkFormat" value="$1" />
        </module>
    </module>
    <module name="SuppressWarningsFilter" />
	<!-- Header checks -->
	<module name="Header">
        <property name="headerFile" value="${checkstyle.header.file}"/>
        <property name="fileExtensions" value="java"/>
	</module>
	<!-- <module name="RegexpHeader" /> -->
    <!--
    <module name="RegexpSingleline">
        <property name="format" value="\s+$"/>
        <property name="message" value="Trailing whitespace"/>
    </module>
    -->
	<module name="FileLength">
		<property name="max" value="4096" />
	</module>
	<module name="FileTabCharacter">
		<property name="eachLine" value="true" />
	</module>
	    <!-- '{samedir}' is an Eclipse built in environment variable initialized with the value of the external checkstyle configuration file -->
	    <!-- See https://checkstyle.org/eclipse-cs/#!/properties -->
    <module name="SuppressionFilter">
        <property name="file" value="${samedir}/sshd-checkstyle-suppressions.xml"/>
        <property name="optional" value="true"/>
    </module>
</module>
