Code Inspection: Complex function should be refactored
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
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
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.