HaxeCheckstyle/haxe-checkstyle

View on GitHub
checkstyle.json

Summary

Maintainability
Test Coverage
{
    "defaultSeverity": "INFO",
    "checks": [
        {
            "type": "Anonymous"
        },
        {
            "type": "ArrayAccess"
        },
        {
            "type": "ArrayLiteral"
        },
        {
            "type": "AvoidStarImport"
        },
        {
            "type": "BlockBreakingConditional"
        },
        {
            "props": {
                "format": "^(e)$"
            },
            "type": "CatchParameterName"
        },
        {
            "type": "CodeSimilarity"
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^[A-Z][A-Z0-9]*(_[A-Z0-9_]+)*$",
                "tokens": [
                    "INLINE"
                ]
            },
            "type": "ConstantName"
        },
        {
            "props": {
                "thresholds": [
                    {
                        "complexity": 20,
                        "severity": "WARNING"
                    },
                    {
                        "complexity": 25,
                        "severity": "ERROR"
                    }
                ]
            },
            "type": "CyclomaticComplexity"
        },
        {
            "type": "DefaultComesLast"
        },
        {
            "type": "CommentedOutCode"
        },
        {
            "type": "DocCommentStyle"
        },
        {
            "type": "Dynamic"
        },
        {
            "type": "ERegLiteral"
        },
        {
            "props": {
                "tokens": [
                    "CLASS_DEF",
                    "ENUM_DEF",
                    "ABSTRACT_DEF",
                    "TYPEDEF_DEF",
                    "INTERFACE_DEF",
                    "OBJECT_DECL",
                    "FUNCTION",
                    "FOR",
                    "IF",
                    "WHILE",
                    "SWITCH",
                    "TRY",
                    "CATCH"
                ],
                "option": "empty"
            },
            "type": "EmptyBlock"
        },
        {
            "props": {
                "max": 1,
                "requireEmptyLineAfterAbstract": false,
                "requireEmptyLineAfterClass": false,
                "requireEmptyLineAfterInterface": false
            },
            "type": "EmptyLines"
        },
        {
            "type": "EmptyPackage"
        },
        {
            "props": {
                "max": 1,
                "skipSingleLineTypes": true,
                "defaultPolicy": "none",
                "exact": [
                    "inFunction",
                    "afterPackage",
                    "afterImports",
                    "beforeUsing",
                    "betweenTypes",
                    "afterAbstractVars",
                    "betweenAbstractMethods",
                    "afterClassStaticVars",
                    "afterClassVars",
                    "betweenClassMethods",
                    "beforeMultiLineComment",
                    "afterDocCommentField"
                ],
                "upto": [
                    "betweenImports",
                    "anywhereInFile",
                    "betweenAbstractVars",
                    "beginClass",
                    "beginInterface",
                    "betweenClassStaticVars",
                    "betweenClassVars",
                    "betweenInterfaceFields",
                    "beforeSingleLineComment"
                ]
            },
            "type": "ExtendedEmptyLines"
        },
        {
            "type": "FieldDocComment",
            "props": {
                "tokens": [
                    "CLASS_DEF"
                ]
            }
        },
        {
            "type": "FileLength"
        },
        {
            "type": "FileNameCase"
        },
        {
            "props": {
                "option": "upperCase"
            },
            "type": "HexadecimalLiteral"
        },
        {
            "props": {
                "ignoreSetter": true,
                "ignoreFormat": "^(main|run)$",
                "ignoreConstructorParameter": true
            },
            "type": "HiddenField"
        },
        {
            "type": "InnerAssignment"
        },
        {
            "props": {
                "allowMarkerInterfaces": true,
                "allowProperties": false
            },
            "type": "Interface"
        },
        {
            "props": {
                "tokens": [
                    "CLASS_DEF",
                    "ENUM_DEF",
                    "ABSTRACT_DEF",
                    "TYPEDEF_DEF",
                    "INTERFACE_DEF",
                    "ARRAY_COMPREHENSION",
                    "FUNCTION",
                    "FOR",
                    "IF",
                    "WHILE",
                    "SWITCH",
                    "TRY",
                    "CATCH"
                ],
                "ignoreEmptySingleline": true,
                "option": "eol"
            },
            "type": "LeftCurly"
        },
        {
            "props": {
                "tokens": [
                    "ANON_TYPE"
                ],
                "ignoreEmptySingleline": true,
                "ignoreSingleline": true,
                "option": "nl"
            },
            "type": "LeftCurly"
        },
        {
            "props": {
                "max": 160,
                "ignorePattern": "(^@desc)|(LONG LINE TEST)"
            },
            "type": "LineLength"
        },
        {
            "props": {
                "listeners": [
                    "addEventListener",
                    "addListener",
                    "on",
                    "once"
                ],
                "format": "^_?[a-z][a-zA-Z0-9]*$"
            },
            "type": "ListenerName"
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^[a-z][a-zA-Z0-9]*$"
            },
            "type": "LocalVariableName"
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^[a-z][a-zA-Z0-9]*$",
                "tokens": [
                    "CLASS",
                    "PUBLIC",
                    "PRIVATE",
                    "TYPEDEF"
                ]
            },
            "type": "MemberName"
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^[A-Z0-9_]*$",
                "tokens": [
                    "ENUM"
                ]
            },
            "type": "MemberName"
        },
        {
            "props": {
                "maxPrivate": 50,
                "maxPublic": 50,
                "maxTotal": 50
            },
            "type": "MethodCount"
        },
        {
            "props": {
                "max": 50
            },
            "type": "MethodLength"
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^[a-z][a-zA-Z0-9]*$"
            },
            "type": "MethodName"
        },
        {
            "props": {
                "modifiers": [
                    "MACRO",
                    "OVERRIDE",
                    "PUBLIC_PRIVATE",
                    "STATIC",
                    "INLINE",
                    "DYNAMIC"
                ]
            },
            "type": "ModifierOrder"
        },
        {
            "props": {
                "minLength": 2,
                "ignore": "^\\s+$",
                "allowDuplicates": 2
            },
            "type": "MultipleStringLiterals"
        },
        {
            "type": "MultipleVariableDeclarations"
        },
        {
            "props": {
                "allowSingleLineStatement": true,
                "tokens": [
                    "FOR",
                    "IF",
                    "ELSE_IF",
                    "WHILE",
                    "DO_WHILE"
                ]
            },
            "type": "NeedBraces"
        },
        {
            "type": "NestedForDepth"
        },
        {
            "type": "NestedIfDepth"
        },
        {
            "type": "NestedTryDepth"
        },
        {
            "props": {
                "assignOpPolicy": "around",
                "unaryOpPolicy": "none",
                "ternaryOpPolicy": "around",
                "arithmeticOpPolicy": "around",
                "compareOpPolicy": "around",
                "bitwiseOpPolicy": "around",
                "boolOpPolicy": "around",
                "intervalOpPolicy": "none",
                "arrowPolicy": "around",
                "oldFunctionTypePolicy": "around",
                "newFunctionTypePolicy": "around",
                "arrowFunctionPolicy": "around"
            },
            "type": "OperatorWhitespace"
        },
        {
            "props": {
                "tokens": [
                    "=",
                    "*",
                    "/",
                    "%",
                    ">",
                    "<",
                    ">=",
                    "<=",
                    "==",
                    "!=",
                    "&",
                    "|",
                    "^",
                    "<<",
                    ">>",
                    ">>>",
                    "+=",
                    "-=",
                    "*=",
                    "/=",
                    "%=",
                    "<<=",
                    ">>=",
                    ">>>=",
                    "|=",
                    "&=",
                    "^=",
                    "...",
                    "=>",
                    "++",
                    "--"
                ],
                "option": "eol"
            },
            "type": "OperatorWrap"
        },
        {
            "props": {
                "tokens": [
                    "+",
                    "-",
                    "&&",
                    "||"
                ],
                "option": "nl"
            },
            "type": "OperatorWrap"
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^(_|[a-z][a-zA-Z0-9]*$)"
            },
            "type": "ParameterName"
        },
        {
            "props": {
                "max": 7,
                "ignoreOverriddenMethods": false
            },
            "type": "ParameterNumber"
        },
        {
            "type": "RedundantModifier"
        },
        {
            "type": "RedundantAllowMeta"
        },
        {
            "type": "RedundantAccessMeta"
        },
        {
            "props": {
                "allowEmptyReturn": true,
                "enforceReturnType": false
            },
            "type": "Return"
        },
        {
            "props": {
                "tokens": [
                    "CLASS_DEF",
                    "ENUM_DEF",
                    "ABSTRACT_DEF",
                    "TYPEDEF_DEF",
                    "INTERFACE_DEF",
                    "OBJECT_DECL",
                    "FUNCTION",
                    "FOR",
                    "IF",
                    "WHILE",
                    "SWITCH",
                    "TRY",
                    "CATCH"
                ],
                "option": "aloneorsingle"
            },
            "type": "RightCurly"
        },
        {
            "props": {
                "dotPolicy": "none",
                "commaPolicy": "after",
                "semicolonPolicy": "after"
            },
            "type": "SeparatorWhitespace"
        },
        {
            "props": {
                "tokens": [
                    ","
                ],
                "option": "eol"
            },
            "type": "SeparatorWrap"
        },
        {
            "type": "SimplifyBooleanExpression"
        },
        {
            "type": "SimplifyBooleanReturn"
        },
        {
            "props": {
                "spaceIfCondition": "should",
                "spaceAroundBinop": true,
                "spaceForLoop": "should",
                "ignoreRangeOperator": true,
                "spaceWhileLoop": "should",
                "spaceCatch": "should",
                "spaceSwitchCase": "should",
                "noSpaceAroundUnop": true
            },
            "type": "Spacing"
        },
        {
            "props": {
                "allowException": true,
                "policy": "doubleAndInterpolation"
            },
            "type": "StringLiteral"
        },
        {
            "type": "TODOComment"
        },
        {
            "type": "TabForAligning"
        },
        {
            "type": "Trace"
        },
        {
            "type": "TrailingWhitespace"
        },
        {
            "props": {
                "ignoreEnumAbstractValues": true
            },
            "type": "Type"
        },
        {
            "type": "TypeDocComment",
            "props": {
                "tokens": [
                    "CLASS_DEF",
                    "INTERFACE_DEF"
                ]
            }
        },
        {
            "props": {
                "ignoreExtern": true,
                "format": "^[A-Z]+[a-zA-Z0-9]*$"
            },
            "type": "TypeName"
        },
        {
            "type": "UnnecessaryConstructor"
        },
        {
            "props": {
                "ignoreModules": [
                    "haxeparser.Data",
                    "haxeparser.Data.Token",
                    "haxeparser.Data.TokenDef",
                    "haxeparser.Data.TypeDecl",
                    "haxe.macro.Expr",
                    "haxe.macro.Expr.Access",
                    "haxe.macro.Expr.Field",
                    "haxe.macro.Expr.Function"
                ],
                "moduleTypeMap": {
                    "checkstyle.Config": [
                        "CheckConfig"
                    ],
                    "checkstyle.ChecksInfo": [
                        "CheckInfo"
                    ]
                }
            },
            "type": "UnusedImport"
        },
        {
            "type": "UnusedLocalVar"
        },
        {
            "type": "VariableInitialisation"
        },
        {
            "props": {
                "tokens": [
                    ",",
                    ";"
                ]
            },
            "type": "WhitespaceAfter"
        },
        {
            "props": {
                "tokens": [
                    "=",
                    "+",
                    "-",
                    "*",
                    "/",
                    "%",
                    ">",
                    "<",
                    ">=",
                    "<=",
                    "==",
                    "!=",
                    "&",
                    "|",
                    "^",
                    "&&",
                    "||",
                    "<<",
                    ">>",
                    ">>>",
                    "+=",
                    "-=",
                    "*=",
                    "/=",
                    "%=",
                    "<<=",
                    ">>=",
                    ">>>=",
                    "|=",
                    "&=",
                    "^=",
                    "=>"
                ]
            },
            "type": "WhitespaceAround"
        }
    ],
    "exclude": {
        "path": "RELATIVE_TO_PROJECT",
        "all": [],
        "Dynamic": [
            "checkstyle/Main",
            "checkstyle/Checker",
            "checkstyle/ChecksInfo",
            "checkstyle/checks/Check",
            "checkstyle/checks/whitespace/SpacingCheck",
            "checkstyle/checks/imports/UnusedImportCheck",
            "TestMain",
            "misc/ExtensionsTest",
            "token/TokenTreeBuilderParsingTest"
        ],
        "MultipleStringLiterals": [
            "checks",
            "schema",
            "token"
        ],
        "CodeSimilarity": [
            "checkstyle/checks/block/RightCurlyCheck:new",
            "checkstyle/checks/block/EmptyBlockCheck:new",
            "ArrayAccessCheck:detectableInstances",
            "HiddenFieldCheck:detectableInstances",
            "InterfaceCheck:detectableInstances",
            "RedundantModifierCheck:detectableInstances",
            "ReturnCheck:detectableInstances",
            "test"
        ],
        "CyclomaticComplexity": [
            "checkstyle/checks/Check",
            "checkstyle/utils/ExprUtils",
            "checkstyle/utils/ComplexTypeUtils",
            "checkstyle/checks/metrics/CyclomaticComplexityCheck",
            "checkstyle/checks/block/LeftCurlyCheck",
            "checkstyle/checks/block/RightCurlyCheck",
            "checkstyle/checks/coding/CodeSimilarityCheck",
            "checkstyle/checks/naming/MethodNameCheck",
            "checkstyle/checks/type/ReturnCheck",
            "checkstyle/checks/whitespace/OperatorWrapCheck",
            "checkstyle/checks/whitespace/WhitespaceAfterCheck",
            "checkstyle/checks/whitespace/WhitespaceAroundCheck",
            "checkstyle/checks/block/EmptyBlockCheck",
            "checkstyle/checks/whitespace/EmptyLinesCheck",
            "checkstyle/token/walk/WalkStatement"
        ],
        "ExtendedEmptyLines": [
            "checks/whitespace/EmptyLinesCheckTest:EmptyLinesCheckTests",
            "checks/whitespace/ExtendedEmptyLinesCheckTest:ExtendedEmptyLinesCheckTests"
        ],
        "FieldDocComment": [
            "checkstyle/Main",
            "checkstyle/Checker",
            "checkstyle/ChecksInfo",
            "checkstyle/ParserQueue",
            "checkstyle/checks/Check",
            "config",
            "detect",
            "errors",
            "reporter",
            "schema",
            "test",
            "utils"
        ],
        "LeftCurly": [
            "checkstyle/checks/metrics/CyclomaticComplexityCheck"
        ],
        "RightCurly": [
            "checkstyle/checks/metrics/CyclomaticComplexityCheck"
        ],
        "MethodCount": [
            "DetectCodingStyleTest"
        ],
        "MethodLength": [
            "checkstyle/checks/block/LeftCurlyCheck:detectableInstances",
            "checkstyle/checks/metrics/CyclomaticComplexityCheck",
            "checkstyle/checks/whitespace/OperatorWhitespaceCheck:detectableInstances",
            "checkstyle/checks/whitespace/WhitespaceAfterCheck",
            "checkstyle/checks/whitespace/WhitespaceAroundCheck",
            "checkstyle/checks/whitespace/EmptyLinesCheck",
            "checkstyle/checks/whitespace/IndentationCheck",
            "checkstyle/token/walk/WalkStatement",
            "checkstyle/utils/ExprUtils",
            "checkstyle/utils/ComplexTypeUtils",
            "checkstyle/Main",
            "JsonSchemaGenerator:genSchema",
            "CheckstyleSchemaGenerator:checkstyleFieldsCallback"
        ],
        "NestedForDepth": [
            "TestMain"
        ],
        "MemberName": [
            "checkstyle/Main"
        ],
        "TypeDocComment": [
            "checkstyle/Main",
            "checkstyle/Checker",
            "checkstyle/ChecksInfo",
            "checkstyle/ParserQueue",
            "checkstyle/checks/Check",
            "config",
            "detect",
            "errors",
            "reporter",
            "schema",
            "test",
            "utils"
        ],
        "UnusedLocalVar": [
            "JsonSchemaGenerator"
        ]
    }
}