{ "version": 1, "exclude": {}, "defaultSeverity": "INFO", "extendsConfigPath": "", "numberOfCheckerThreads": 5, "baseDefines": [], "defineCombinations": [], "checks": [ { "comment": "If enabled, prevents using anonymous types inline without creating a typedef for them.", "props": { "severity": "INFO" }, "type": "Anonymous" }, { "comment": "If enabled, mandates spacing around array access syntax.", "props": { "spaceBefore": false, "spaceInside": false, "severity": "INFO" }, "type": "ArrayAccess" }, { "comment": "If enabled, mandates array literals be defined with [] instead of 'new'.", "props": { "severity": "WARNING" }, "type": "ArrayLiteral" }, { "comment": "If enabled, mandates specific syntax for the use of array literals.", "props": { "allowSingleArgParens": true, "allowReturn": true, "allowFunction": true, "allowCurlyBody": true, "enforceArrowForNonMemberFunctions": true, "severity": "INFO" }, "type": "ArrowFunction" }, { "comment": "Specify a list of variable and function names which are not allowed and should be renamed. Doesn't support regex.", "props": { "avoidIdentifiers": [], "severity": "WARNING" }, "type": "AvoidIdentifier" }, { "comment": "If enabled, prevents imports like 'import flixel.*' from being used.", "props": { "severity": "INFO" }, "type": "AvoidStarImport" }, { "comment": "If enabled, prevents ternary operators from being nested.", "props": { "severity": "INFO", "maxDepth": 1 }, "type": "AvoidTernaryOperator" }, { "comment": "If enabled, prevents conditional compilation from crossing blocks. This prevents the case where conditional compilation could potentially create invalid syntax.", "props": { "severity": "INFO" }, "type": "BlockBreakingConditional" }, { "comment": "Specifies a specific naming format for the parameter of a catch block.", "props": { "format": "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$", "severity": "INFO" }, "type": "CatchParameterName" }, { "comment": "If enabled, flags when large blocks of similar code should be extracted to a function.", "props": { "thresholdSimilar": 120, "severity": "IGNORE", "thresholdIdentical": 60, "severityIdentical": "IGNORE" }, "type": "CodeSimilarity" }, { "comment": "If enabled, flags Haxe code that is commented out. Unused code should be removed and accessed via version control later if needed.", "props": { "severity": "WARNING" }, "type": "CommentedOutCode" }, { "comment": "If enabled, flags when conditional compilation blocks are not properly aligned. NOTE:Disabled because it's kinda broken.", "props": { "policy": "aligned", "allowSingleline": true, "severity": "IGNORE" }, "type": "ConditionalCompilation" }, { "comment": "Specifies a specific naming format for static var identifiers.", "props": { "ignoreExtern": true, "format": "^?:_[a-zA-Z0-9]+(?:_[a-zA-Z0-9]+)*$", "tokens": ["INLINE", "NOTINLINE", "NOTFINAL"], "severity": "INFO" }, "type": "ConstantName" }, { "comment": "Specifies a specific naming format for static final identifiers.", "props": { "ignoreExtern": true, "format": "^[A-Z]([_A-Z0-9]+)*$", "tokens": ["INLINE", "NOTINLINE", "FINAL"], "severity": "INFO" }, "type": "ConstantName" }, { "comment": "Calculates the complexity of methods using the McCabe metric, and throws warnings at certain thresholds. Indicates that a function should be refactored or split up.", "props": { "thresholds": [ { "complexity": 20, "severity": "WARNING" }, { "complexity": 25, "severity": "ERROR" } ], "severity": "IGNORE" }, "type": "CyclomaticComplexity" }, { "comment": "If enabled, the default case of a switch statement must be last.", "props": { "severity": "INFO" }, "type": "DefaultComesLast" }, { "comment": "Specifies the format for doc-style comments ().", "props": { "startStyle": "twostars", "endStyle": "onestar", "lineStyle": "onestar", "severity": "INFO" }, "type": "DocCommentStyle" }, { "comment": "If enabled, prevents the use of the Dynamic type.", "props": { "severity": "IGNORE" }, "type": "Dynamic" }, { "comment": "If enabled, ensures ~/.../ is used instead of 'new EReg()'", "props": { "severity": "WARNING" }, "type": "ERegLiteral" }, { "comment": "If enabled, enforces specific syntax on empty blocks (require only one line, etc.)", "props": { "tokens": [ "CLASS_DEF", "ENUM_DEF", "ABSTRACT_DEF", "TYPEDEF_DEF", "INTERFACE_DEF", "OBJECT_DECL", "FUNCTION", "FOR", "IF", "WHILE", "SWITCH", "TRY", "CATCH" ], "option": "empty", "severity": "IGNORE" }, "type": "EmptyBlock" }, { "comment": "If enabled, flags when consecutive empty lines are used.", "props": { "requireEmptyLineAfterPackage": true, "requireEmptyLineAfterInterface": true, "requireEmptyLineAfterAbstract": true, "allowEmptyLineAfterSingleLineComment": true, "max": 1, "requireEmptyLineAfterClass": true, "allowEmptyLineAfterMultiLineComment": true, "severity": "IGNORE" }, "type": "EmptyLines" }, { "comment": "If enabled, mandates the use of 'package;' on root level modules.", "props": { "enforceEmptyPackage": true, "severity": "WARNING" }, "type": "EmptyPackage" }, { "comment": "If enabled, provides advanced checking for when consecutive empty lines are used.", "props": { "none": [], "upto": [], "defaultPolicy": "upto", "exact": [], "max": 1, "ignore": [], "atleast": [], "skipSingleLineTypes": true, "severity": "IGNORE" }, "type": "ExtendedEmptyLines" }, { "comment": "If enabled, mandates documentation comments for public fields.", "props": { "requireParams": true, "fieldType": "BOTH", "requireReturn": true, "ignoreOverride": true, "tokens": ["ABSTRACT_DEF", "CLASS_DEF", "INTERFACE_DEF"], "modifier": "PUBLIC", "excludeNames": ["new", "toString"], "severity": "INFO" }, "type": "FieldDocComment" }, { "comment": "If enabled, mandates documentation comments for public fields.", "props": { "requireParams": true, "fieldType": "FUNCTIONS", "requireReturn": true, "ignoreOverride": true, "tokens": ["ENUM_DEF"], "modifier": "PUBLIC", "excludeNames": ["new", "toString"], "severity": "INFO" }, "type": "FieldDocComment" }, { "comment": "If enabled, warns if files exceed a certain number of lines.", "props": { "max": 1000, "ignoreEmptyLines": true, "severity": "IGNORE" }, "type": "FileLength" }, { "comment": "If enabled, requires modules match the casing of their file name.", "type": "FileNameCase", "props": { "severity": "WARNING" } }, { "comment": "If enabled, requires inline/static variables to be declared final.", "type": "Final", "props": { "severity": "IGNORE" } }, { "comment": "If enabled, requires hexadecimal literals to be in upper case. 0xFFFFFF is valid and 0xffffff is invalid.", "props": { "option": "upperCase", "severity": "WARNING" }, "type": "HexadecimalLiteral" }, { "comment": "If enabled, warns if a local variable or parameter shadows an existing field.", "props": { "ignoreSetter": true, "ignoreFormat": "^(main|run)$", "ignoreConstructorParameter": true }, "type": "HiddenField" }, { "comment": "If enabled, mandates indentation.", "props": { "character": "", "severity": "IGNORE" }, "type": "Indentation" }, { "comment": "If enabled, mandates characters used for indentation.", "props": { "character": "space", "severity": "IGNORE", "ignorePattern": "^$" }, "type": "IndentationCharacter" }, { "comment": "If enabled, warns about assignments performed within another expression, like 'if (a=b){}'", "props": { "ignoreReturnAssignments": true, "severity": "WARNING" }, "type": "InnerAssignment" }, { "comment": "If enabled, enforces that interfaces should not contain properties.", "props": { "allowProperties": false, "allowMarkerInterfaces": true, "severity": "WARNING" }, "type": "Interface" }, { "comment": "If enabled, enforces a newline before the left curly brace of a block.", "props": { "option": "nl", "ignoreEmptySingleline": true, "tokens": [ "CLASS_DEF", "ENUM_DEF", "ABSTRACT_DEF", "TYPEDEF_DEF", "INTERFACE_DEF", "FUNCTION", "FOR", "IF", "WHILE", "SWITCH", "TRY", "CATCH", "ARRAY_COMPREHENSION" ], "severity": "INFO" }, "type": "LeftCurly" }, { "comment": "If enabled, enforces the left curly brace occurs on the end of the line, without a newline.", "props": { "option": "eol", "ignoreEmptySingleline": true, "tokens": ["OBJECT_DECL"], "severity": "IGNORE" }, "type": "LeftCurly" }, { "comment": "If enabled, warns when lines of code exceed a certain length.", "props": { "max": 160, "ignorePattern": "^(\\s*['\"][^'\"]*['\"].*)$", "severity": "INFO" }, "type": "LineLength" }, { "comment": "If enabled, mandates a specific naming convention for listener methods.", "props": { "listeners": ["addEventListener", "addListener", "on", "once"], "format": "^_?[a-z][a-zA-Z0-9]*$", "severity": "IGNORE" }, "type": "ListenerName" }, { "comment": "Specifies a specific naming format for local var variables.", "props": { "ignoreExtern": true, "format": "^[a-z][a-zA-Z0-9]*$", "tokens": ["NOTFINAL"], "severity": "INFO" }, "type": "LocalVariableName" }, { "comment": "Specifies a specific naming format for local final variables.", "props": { "ignoreExtern": true, "format": "^[A-Z][_A-Z0-9]*$", "tokens": ["FINAL"], "severity": "INFO" }, "type": "LocalVariableName" }, { "comment": "Puts a warning on long numbers without separators. 1000000 is invalid and 1_000_000 is valid.", "props": { "severity": "INFO", "decimalGroupSize": 3, "fractionalGroupSize": -1, "binaryGroupSize": 8, "hexadecimalGroupSize": 8, "decimalMinimum": 10000 }, "type": "LongNumber" }, { "comment": "If enabled, warns when unlabelled numeric values get used. Use named constants instead to improve code clarity.", "props": { "ignoreNumbers": [-1, 0, 1, 2], "severity": "IGNORE" }, "type": "MagicNumber" }, { "comment": "Specifies a specific naming format for public abstract member fields.", "props": { "format": "^[a-zA-Z][_a-zA-Z0-9]*$", "tokens": ["PUBLIC", "ABSTRACT"] }, "type": "MemberName" }, { "comment": "Specifies a specific naming format for private abstract member fields.", "props": { "format": "^[_a-zA-Z][a-z][a-zA-Z0-9]*$", "tokens": ["PRIVATE", "ABSTRACT"] }, "type": "MemberName" }, { "comment": "Specifies a specific naming format for public class member fields.", "props": { "format": "^[a-zA-Z][a-z][a-zA-Z0-9]*$", "tokens": ["PUBLIC", "CLASS"] }, "type": "MemberName" }, { "comment": "Specifies a specific naming format for private class member fields.", "props": { "format": "^[_a-zA-Z][_a-zA-Z0-9]*$", "tokens": ["PRIVATE", "CLASS"] }, "type": "MemberName" }, { "comment": "Specifies a specific naming format for enum member fields.", "props": { "format": "^[a-zA-Z][_a-zA-Z0-9]*$", "tokens": ["PUBLIC", "ENUM"] }, "type": "MemberName" }, { "comment": "Specifies a specific naming format for typedef member fields.", "props": { "format": "^[_a-zA-Z][a-z][a-zA-Z0-9]*$", "tokens": ["TYPEDEF"] }, "type": "MemberName" }, { "comment": "If enabled, enforces that modules should not exceed a certain number of methods.", "props": { "maxPrivate": 100, "maxPublic": 100, "maxTotal": 100, "severity": "IGNORE" }, "type": "MethodCount" }, { "comment": "If enabled, enforces that methods should not exceed a certain number of lines of code, excluding empty lines.", "props": { "max": 50, "ignoreEmptyLines": true, "severity": "IGNORE" }, "type": "MethodLength" }, { "comment": "Specifies a specific naming format for method names.", "props": { "ignoreExtern": true, "format": "^[a-z][_a-zA-Z0-9]*$", "tokens": [], "severity": "INFO" }, "type": "MethodName" }, { "comment": "Specifies a specific order for modifiers on fields.", "props": { "modifiers": [ "OVERRIDE", "OVERLOAD", "PUBLIC_PRIVATE", "STATIC", "ABSTRACT", "EXTERN", "INLINE", "DYNAMIC", "MACRO", "FINAL" ], "severity": "INFO" }, "type": "ModifierOrder" }, { "comment": "If enabled, complains when a specific string literal is used in the same file multiple times. Use a named constant instead.", "props": { "minLength": 2, "ignore": "^\\s+$", "allowDuplicates": 5, "severity": "IGNORE" }, "type": "MultipleStringLiterals" }, { "comment": "If enabled, complains when a multiple variables are declared in a single expression. Use individual lines.", "props": { "severity": "WARNING" }, "type": "MultipleVariableDeclarations" }, { "comment": "If enabled, mandates the use of braces on specific block types, unless they fit on a single line.", "props": { "allowSingleLineStatement": true, "tokens": ["FUNCTION", "FOR", "IF", "IF_WITH_ELSE", "ELSE"], "severity": "INFO" }, "type": "NeedBraces" }, { "comment": "If enabled, mandates the use of braces on specific block types, and prevent them from being placed on a single line.", "props": { "allowSingleLineStatement": false, "tokens": ["IF_WITH_ELSE", "CATCH", "WHILE", "DO_WHILE", "ELSE_IF"], "severity": "INFO" }, "type": "NeedBraces" }, { "comment": "If enabled, complains when control flow statements are nested too deep (indicating high complexity).", "props": { "max": 3, "severity": "IGNORE" }, "type": "NestedControlFlow" }, { "comment": "If enabled, complains when 'for' loops are nested too deep (indicating high complexity).", "props": { "max": 1, "severity": "IGNORE" }, "type": "NestedForDepth" }, { "comment": "If enabled, complains when 'if' statements are nested too deep (indicating high complexity).", "props": { "max": 4, "severity": "IGNORE" }, "type": "NestedIfDepth" }, { "comment": "If enabled, complains when try/catch statements are nested too deep (indicating high complexity).", "props": { "max": 1, "severity": "INFO" }, "type": "NestedTryDepth" }, { "comment": "If enabled, enforces ?value rather than value = null.", "props": { "option": "questionMark", "severity": "INFO" }, "type": "NullableParameter" }, { "comment": "If enabled, enforces that operators should be surrounded by whitespace.", "props": { "oldFunctionTypePolicy": "none", "unaryOpPolicy": "none", "intervalOpPolicy": "none", "newFunctionTypePolicy": "around", "ternaryOpPolicy": "around", "boolOpPolicy": "around", "assignOpPolicy": "around", "bitwiseOpPolicy": "around", "arithmeticOpPolicy": "around", "compareOpPolicy": "around", "arrowPolicy": "around", "arrowFunctionPolicy": "around" }, "type": "OperatorWhitespace" }, { "comment": "If enabled, enforces that most operators should be after a newline rather than before.", "props": { "tokens": [ "+", "-", "*", "/", "%", ">", "<", ">=", "<=", "==", "!=", "&", "|", "^", "&&", "||", "<<", ">>", ">>>", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "&=", "^=", "...", "=>", "++", "--" ], "option": "nl" }, "type": "OperatorWrap" }, { "comment": "If enabled, enforces that assignment operators should be before a newline rather than after.", "props": { "tokens": ["="], "option": "eol" }, "type": "OperatorWrap" }, { "comment": "Specifies a specific naming format for method parameter names.", "props": { "ignoreExtern": true, "format": "^(_|[a-z][a-zA-Z0-9]*$)", "tokens": [], "severity": "INFO" }, "type": "ParameterName" }, { "comment": "If enabled, complains when there are too many parameters on a method.", "props": { "max": 7, "ignoreOverriddenMethods": false }, "type": "ParameterNumber" }, { "comment": "If enabled, complains when you make a property accessor method public.", "props": { "severity": "WARNING" }, "type": "PublicAccessor" }, { "comment": "If enabled, complains when an @:access metadata is redundant.", "props": { "prohibitMeta": false, "severity": "INFO" }, "type": "RedundantAccessMeta" }, { "comment": "If enabled, complains when an @:allow metadata is redundant.", "props": { "prohibitMeta": false, "severity": "INFO" }, "type": "RedundantAllowMeta" }, { "comment": "If enabled, complains when an access modifier is redundant.", "props": { "enforcePrivate": false, "enforcePublic": true, "enforcePublicPrivate": false, "severity": "WARNING" }, "type": "RedundantModifier" }, { "comment": "If enabled, enforces that a return type is specified for all methods.", "props": { "enforceReturnTypeForAnonymous": false, "allowEmptyReturn": true, "enforceReturnType": true }, "type": "Return" }, { "comment": "If enabled, mandates a maximum number of 'return' statements in a method.", "props": { "ignoreFormat": "^$", "max": 2, "severity": "IGNORE" }, "type": "ReturnCount" }, { "comment": "If enabled, enforces a specific placement for curly braces. TODO:Choose between Allman/K&R and enforce project-wide.", "props": { "option": "aloneorsingle", "tokens": [ "CLASS_DEF", "ENUM_DEF", "ABSTRACT_DEF", "TYPEDEF_DEF", "INTERFACE_DEF", "OBJECT_DECL", "FUNCTION", "FOR", "IF", "WHILE", "SWITCH", "TRY", "CATCH", "REIFICATION", "ARRAY_COMPREHENSION" ], "severity": "IGNORE" }, "type": "RightCurly" }, { "comment": "Enforces specific whitespace around certain separators, such as commas and semicolons.", "props": { "commaPolicy": "after", "semicolonPolicy": "after", "allowTrailingComma": false, "dotPolicy": "none", "severity": "INFO" }, "type": "SeparatorWhitespace" }, { "comment": "Enforces specific line wrapping for certain separators, such as commas and semicolons.", "props": { "tokens": [","], "option": "eol" }, "type": "SeparatorWrap" }, { "comment": "If enabled, complains about overly complicated boolean expressions.", "props": { "severity": "WARNING", "allowEqualsFalse": false }, "type": "SimplifyBooleanExpression" }, { "comment": "If enabled, complains about overly complicated boolean return statements.", "props": { "severity": "WARNING" }, "type": "SimplifyBooleanReturn" }, { "comment": "If enabled, enforce spacing in and around conditional statements and certain operators.", "props": { "spaceIfCondition": "should", "spaceAroundBinop": true, "spaceForLoop": "should", "ignoreRangeOperator": true, "spaceWhileLoop": "should", "spaceCatch": "should", "spaceSwitchCase": "should", "noSpaceAroundUnop": true }, "type": "Spacing" }, { "comment": "Enforce a specific string literal style (either ' or \").", "props": { "policy": "onlySingle", "allowException": true, "severity": "INFO" }, "type": "StringLiteral" }, { "comment": "If enabled, requires that switch conditions be wrapped in parenthesis.", "props": { "policy": "require", "severity": "INFO" }, "type": "SwitchParentheses" }, { "comment": "Puts a warning on unresolved TODO/FIXME comments.", "props": { "format": "^\\s*(TODO|FIXME|HACK|XXX|BUG)", "severity": "INFO" }, "type": "TODOComment" }, { "comment": "Checks if there are any tabs in the middle of a line.", "props": { "severity": "INFO" }, "type": "TabForAligning" }, { "comment": "If enabled, complains whenever trace() gets used in code.", "props": { "severity": "IGNORE" }, "type": "Trace" }, { "comment": "If enabled, complains about trailing commas at the end of array and object literals.", "props": { "severity": "INFO", "enforceArrayComprehension": false, "enforceArrayLiterals": false, "enforceObjectLiterals": false }, "type": "TrailingComma" }, { "comment": "If enabled, complains about trailing whitespaces at the end of lines.", "props": { "severity": "INFO" }, "type": "TrailingWhitespace" }, { "comment": "If enabled, requires type be specified on member fields.", "props": { "ignoreEnumAbstractValues": true, "severity": "INFO" }, "type": "Type" }, { "comment": "If enabled, mandates documentation comments on classes and interfaces.", "props": { "tokens": [ "CLASS_DEF", "INTERFACE_DEF", "TYPEDEF_DEF", "ABSTRACT_DEF", "ENUM_DEF" ], "severity": "INFO" }, "type": "TypeDocComment" }, { "comment": "Specifies a specific naming format for abstract types.", "props": { "ignoreExtern": true, "format": "^[A-Z]+[a-zA-Z0-9]*$", "tokens": ["ABSTRACT"], "severity": "WARNING" }, "type": "TypeName" }, { "comment": "Specifies a specific naming format for class types.", "props": { "ignoreExtern": true, "format": "^[A-Z]+[a-zA-Z0-9]*$", "tokens": ["CLASS"], "severity": "WARNING" }, "type": "TypeName" }, { "comment": "Specifies a specific naming format for enum types.", "props": { "ignoreExtern": true, "format": "^[A-Z]+[a-zA-Z0-9]*$", "tokens": ["ENUM"], "severity": "WARNING" }, "type": "TypeName" }, { "comment": "Specifies a specific naming format for interface types.", "props": { "ignoreExtern": true, "format": "^[A-Z]+[a-zA-Z0-9]*$", "tokens": ["INTERFACE"], "severity": "WARNING" }, "type": "TypeName" }, { "comment": "Specifies a specific naming format for typedefs.", "props": { "ignoreExtern": true, "format": "^[A-Z]+[a-zA-Z0-9]*$", "tokens": ["TYPEDEF"], "severity": "WARNING" }, "type": "TypeName" }, { "comment": "If enabled, complains when a class with only static fields and values has a redundant constructor.", "props": { "severity": "WARNING" }, "type": "UnnecessaryConstructor" }, { "comment": "If enabled, complains when a module contains unused imports. NOTE:Sometimes complains about required imports.", "props": { "moduleTypeMap": {}, "ignoreModules": [], "severity": "INFO" }, "type": "UnusedImport" }, { "comment": "If enabled, complains when a local variable is unused.", "props": { "severity": "WARNING" }, "type": "UnusedLocalVar" }, { "comment": "If enabled, requires type hints for certain variables.", "props": { "typeHintPolicy": "enforce_all", "ignoreEnumAbstractValues": true, "severity": "IGNORE" }, "type": "VarTypeHint" }, { "comment": "If enabled, complains when a class member variable is initialized at the class level rather than the constructor.", "type": "VariableInitialisation", "props": { "allowFinal": true, "severity": "IGNORE" } }, { "comment": "If enabled, mandates whitespace after certain tokens.", "props": { "tokens": [",", ";"], "allowTrailingComma": false, "severity": "INFO" }, "type": "WhitespaceAfter" }, { "comment": "If enabled, mandates whitespace around certain tokens.", "props": { "tokens": [ "=", "+", "-", "*", "/", "%", ">", "<", ">=", "<=", "==", "!=", "&", "|", "^", "&&", "||", "<<", ">>", ">>>", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "&=", "^=", "=>" ], "severity": "INFO" }, "type": "WhitespaceAround" } ] }