BACK TO LIST

PHP rules

Codiga provides multiple sets of rules for 12+ languages. Below we provide a link and a description for all the rules supported by our platform. Note that not all the rules are being listed and described below.

CyclomaticComplexity

Best practice
Warning

Check cyclomatic complexity

Learn more

ExcessiveClassComplexity

Best practice
Warning

Check class complexity

ExcessiveClassLength

Best practice
Warning

Check class maximum number of lines

ExcessiveMethodLength

Best practice
Warning

Check max number of lines of functions (100 by default)

ExcessiveParameterList

Best practice
Warning

Functions should not have more than 10 parameters

ExcessivePublicCount

Best practice
Warning

Classes should not have more than 55 attributes and functions

LongVariable

Design
Warning

Avoid long variables names (more than 20 characters)

NPathComplexity

Best practice
Warning

Check function complexity

ShortMethodName

Design
Warning

Avoid short methods names (more than 3 characters)

ShortVariable

Design
Warning

Avoid short variables names (more than 3 charactrs)

TooManyFields

Best practice
Warning

Keep the number of fields for classes under 15.

TooManyMethods

Best practice
Warning

Class has too many getters

TooManyPublicMethods

Best practice
Warning

Keep number of public methods in classes under 10.

UnusedLocalVariable

Error prone
Warning

Avoid unused local variables

UnusedPrivateField

Error prone
Warning

Avoid unused private fields

UnusedPrivateMethod

Error prone
Warning

Avoid unused private methods

ErrorControlOperator

Best practice
Warning

Remove error control operator.

ShortClassName

Design
Warning

Avoid short class names.

UndefinedVariable

Best practice
Warning

Avoid using undefined variables, it will lead to PHP notices.

We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.