A very old idea more programmers should be aware of: https://en.wikipedia.org/wiki/Cyclomatic_complexity
This is the actual rationale behind "your functions shouldn't have too many lines of code", and it's the reason why seniors sometimes overrule this trivial rule.