Complexity
ID | FCNS-1 |
Title | Keep functions short and simple. |
Priority | Strongly recommended |
Severity level | 4 |
Description | Keep number of lines of code and cyclomatic complexity to an acceptable level, especially for nested functions and methods in a classdef file. Use the values of the table below. |
Rationale | Short functions are more likely to be readable, reusable and testable. |
Function type | Maximum cyclomatic complexity | Maximum number of lines of code |
---|---|---|
Main | 20 | 100 |
Local (Sub) | 15 | 50 |
Methods in a classdef | 10 | 20 |
Nested | 5 | 10 |