1️⃣0️⃣ ERRORS - Critical issues |
|
Generic.Functions.CallTimePassByReference Ensures that variables are not passed by reference when calling a function. |
✖️ |
Generic.PHP.CharacterBeforePHPOpeningTag Checks that the opening PHP tag is the first content in a file. |
✖️ |
Generic.PHP.DeprecatedFunctions Discourages the use of deprecated PHP functions. |
✖️ |
Generic.PHP.NoSilencedErrors Throws an error or warning when any code prefixed with an asperand is encountered. |
✖️ |
Generic.PHP.Syntax Ensures PHP believes the syntax is clean. |
✖️ |
Magento.Legacy.MageEntity Detects typical Magento 1.x (Mage:: ) classes constructions. |
✖️ |
Magento.NamingConvention.ReservedWords Validates that class name is not reserved word. |
✖️ |
Magento.PHP.FinalImplementation Magento is a highly extensible and customizable platform. The use of final classes and methods is prohibited. |
✖️ |
Magento.PHP.Goto Detects use of goto . |
✖️ |
Magento.PHP.ReturnValueCheck Detects misusing of === and !=== operators when checking srtpos , stripos , array_search |
✖️ |
Magento.Security.LanguageConstruct Detects possible usage of discouraged language constructs (exit , echo , backquotes). |
✖️ |
Magento.Security.Superglobal Detects possible usage of super global variables. |
✖️ |
Magento.Strings.ExecutableRegEx Detects executable regular expressions. |
✖️ |
PSR1.Classes.ClassDeclaration Checks the declaration of the class is correct. |
✖️ |
PSR2.Files.ClosingTag Checks that the file does not end with a closing tag. |
✔️ |
Squiz.PHP.Eval The use of eval is discouraged. |
✖️ |
9️⃣WARNINGS - Possible security issues |
|
Magento.Security.IncludeFile Detects possible improper usage of include functions. |
✖️ |
Magento.Security.XssTemplate Detects not escaped output in phtml templates. |
✖️ |
8️⃣WARNINGS - Magento specific code issues |
|
Magento.Classes.ObjectInstantiation Detects direct object instantiation via new keyword. |
✖️ |
Magento.Classes.ObjectManager Class ObjectManagerSniff detects direct ObjectManager usage. |
✖️ |
Magento.Exceptions.DirectThrow Detects possible direct throws of Exception . |
✖️ |
Magento.Files.LineLength Line length sniff which ignores long lines in case they contain strings intended for translation. |
✖️ |
Magento.NamingConvention.InterfaceName Detects possible interface declaration without 'Interface' suffix. |
✖️ |
Magento.PHP.DateTime Detects overcomplicated Date/Time handling. |
✖️ |
Magento.PHP.ShortEchoSyntax Validate short echo syntax is used. |
✖️ |
Magento.Templates.ThisInTemplate Detects possible usage of $this variable files. |
✖️ |
Magento.Translation.ConstantUsage Make sure that constants are not used as the first argument of translation function. |
✖️ |
7️⃣WARNINGS - General code issues |
|
Generic.Arrays.DisallowLongArraySyntax Bans the use of the PHP long array syntax. |
✔️ ✖️ |
Generic.Classes.DuplicateClassName Reports errors if the same class or interface name is used in multiple files. |
✖️ |
Generic.CodeAnalysis.ForLoopShouldBeWhileLoop Detects for-loops that can be simplified to a while-loop. |
✖️ |
Generic.CodeAnalysis.ForLoopWithTestFunctionCall Detects for-loops that use a function call in the test expression. |
✖️ |
Generic.CodeAnalysis.JumbledIncrementer Detects incrementer jumbling in for loops. |
✖️ |
Generic.CodeAnalysis.UnconditionalIfStatement Detects unconditional if- and elseif-statements. |
✖️ |
Generic.CodeAnalysis.UnusedFunctionParameter Checks the for unused function parameters. |
✖️ |
Generic.CodeAnalysis.UselessOverridingMethod Detects unnecessary overridden methods that simply call their parent. |
✖️ |
Generic.Metrics.CyclomaticComplexity Checks the cyclomatic complexity (McCabe) for functions. |
✖️ |
Generic.Metrics.NestingLevel Checks the nesting level for methods. |
✖️ |
Generic.PHP.DisallowShortOpenTag Makes sure that shorthand PHP open tags are not used. |
✔️ ✖️ |
Magento.CodeAnalysis.EmptyBlock Detects empty statements and functions. |
✖️ |
Magento.Exceptions.Namespace Detects possible usage of exceptions without namespace declaration. |
✖️ |
Magento.PHP.DiscouragedFunction Detects possible usage of discouraged functions. |
✖️ |
Magento.PHP.LiteralNamespaces Detects the use of literal class and interface names. |
✖️ |
Magento.PHP.Var Detects possible usage of var language construction. |
✖️ |
Magento.Performance.EmptyCheck Allows easily detect wrong approach for checking empty variables in conditions. |
✖️ |
Magento.Strings.StringConcat Detects string concatenation via + operator. |
✖️ |
PEAR.Functions.ValidDefaultValue Ensures function params with default values are at the end of the declaration. |
✖️ |
Squiz.Functions.GlobalFunction Tests for functions outside of classes. |
✖️ |
Squiz.Operators.IncrementDecrementUsage Ensures that the ++ operators are used when possible. |
✖️ |
Squiz.PHP.GlobalKeyword Stops the usage of the global keyword. |
✖️ |
Squiz.PHP.NonExecutableCode Warns about code that can never been executed. |
✖️ |
Squiz.Scope.MemberVarScope Verifies that class members have scope modifiers. |
✖️ |
6️⃣WARNINGS - Code style issues |
|
Generic.ControlStructures.InlineControlStructure Verifies that inline control statements are not present. |
✔️ |
Generic.Files.ByteOrderMark A simple sniff for detecting BOMs that may corrupt application work. |
✖️ |
Generic.Files.LineEndings Checks that end of line characters are correct. |
✔️ |
Generic.Formatting.DisallowMultipleStatements Ensures each statement is on a line by itself. |
✔️ |
Generic.Functions.FunctionCallArgumentSpacing Checks that calls to methods and functions are spaced correctly. |
✔️ |
Generic.NamingConventions.UpperCaseConstantName Ensures that constant names are all uppercase. |
✖️ |
Generic.PHP.LowerCaseConstant Checks that all uses of true, false and null are lowercase. |
✔️ |
Generic.PHP.LowerCaseKeyword Checks that all PHP keywords are lowercase. |
✔️ |
Generic.WhiteSpace.DisallowTabIndent Throws errors if tabs are used for indentation. |
✔️ |
Generic.WhiteSpace.ScopeIndent Checks that control structures are defined and indented correctly. |
✔️ |
Magento.Whitespace.EmptyLineMissed Class EmptyLineMissedSniff |
✖️ |
Magento.Whitespace.MultipleEmptyLines Detects possible usage of multiple blank lines in a row. |
✖️ |
PEAR.ControlStructures.ControlSignature Verifies that control statements conform to their coding standards. |
✖️ |
PSR1.Files.SideEffects Ensures a file declares new symbols and causes no other side effects, or executes logic with side effects, but not both. |
✖️ |
PSR1.Methods.CamelCapsMethodName Ensures method names are defined using camel case. |
✖️ |
PSR2.Classes.ClassDeclaration Checks the declaration of the class and its inheritance is correct. |
✔️ ✖️ |
PSR2.Classes.PropertyDeclaration Verifies that properties are declared correctly. |
✖️ |
PSR2.ControlStructures.ControlStructureSpacing Checks that control structures have the correct spacing around brackets. |
✔️ |
PSR2.ControlStructures.ElseIfDeclaration Verifies that there are no else if statements (elseif should be used instead). |
✔️ |
PSR2.ControlStructures.SwitchDeclaration Ensures all switch statements are defined correctly. |
✔️ ✖️ |
PSR2.Files.EndFileNewline Ensures the file ends with a newline character. |
✔️ |
PSR2.Methods.FunctionCallSignature Checks that the function call format is correct. |
✔️ |
PSR2.Methods.FunctionClosingBrace Checks that the closing brace of a function goes directly after the body. |
✔️ |
PSR2.Methods.MethodDeclaration Checks that the method declaration is correct. |
✔️ ✖️ |
PSR2.Namespaces.NamespaceDeclaration Ensures namespaces are declared correctly. |
✔️ |
PSR2.Namespaces.UseDeclaration Ensures USE blocks are declared correctly. |
✔️ ✖️ |
Squiz.Classes.ValidClassName Ensures classes are in camel caps, and the first letter is capitalized. |
✖️ |
Squiz.ControlStructures.ControlSignature Verifies that control statements conform to their coding standards. |
✔️ ✖️ |
Squiz.ControlStructures.ForEachLoopDeclaration Verifies that there is a space between each condition of foreach loops. |
✔️ ✖️ |
Squiz.ControlStructures.ForLoopDeclaration Verifies that there is a space between each condition of for loops. |
✔️ ✖️ |
Squiz.ControlStructures.LowercaseDeclaration Ensures all control structure keywords are lowercase. |
✔️ |
Squiz.Functions.FunctionDeclaration Checks the function declaration is correct. |
✖️ |
Squiz.Functions.FunctionDeclarationArgumentSpacing Checks that arguments in function declarations are spaced correctly. |
✔️ |
Squiz.Functions.LowercaseFunctionKeywords Ensures all function keywords are lowercase. |
✖️ |
Squiz.Functions.MultiLineFunctionDeclaration Ensure single and multi-line function declarations are defined correctly. |
✔️ |
Squiz.Scope.MethodScope Verifies that class methods have scope modifiers. |
✖️ |
Squiz.WhiteSpace.LogicalOperatorSpacing Verifies that operators have valid spacing surrounding them. |
✔️ |
Squiz.WhiteSpace.ScopeClosingBrace Checks that the closing braces of scopes are aligned correctly. |
✔️ |
Squiz.WhiteSpace.ScopeKeywordSpacing Ensure there is a single space after scope keywords. |
✔️ |
Squiz.WhiteSpace.SuperfluousWhitespace Checks for unneeded whitespace. |
✔️ |
5️⃣ WARNINGS - Annotations and commenting |
|
Magento.Annotation.ClassAnnotationStructure Sniff to validate structure of class, interface annotations. |
✖️ |
Magento.Annotation.MethodAnnotationStructure Sniff to validate structure of public, private, protected method annotations. |
✖️ |
Magento.Annotation.MethodArguments Sniff to validate method arguments annotations. |
✖️ |
Squiz.Commenting.DocCommentAlignment Tests that the stars in a doc comment align correctly. |
✔️ |
Squiz.PHP.CommentedOutCode Warn about commented out code. |
✖️ |