Inspectopedia Help

Complex function should be refactored

Reports the functions or methods that are too complex.

Complexity is evaluated based on four metrics:

  • Lines of code — the number of code lines in a function/method (less is better)

  • Maximum Nesting depth — the maximum number of nested statements in a function/method body (less is better)

  • Cyclomatic complexity — the function/method cyclomatic complexity (less is better)

  • Number of variables — the number of variables used in function/method body

Inspection options

Option

Type

Default

Lines of code

Number

150

Max nesting depth

Number

4

Cyclomatic complexity

Number

15

Number of used variables

Number

8

Inspection Details

Available in:

PhpStorm 2023.3, Qodana for PHP 2023.3

Plugin:

PHP Architecture, 233.SNAPSHOT

Last modified: 13 July 2023