I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
Various measures of complexity come to mind, as they're often used as guideposts for when to sub-divide functions for readability.
Cyclomatic complexity is the most commonly used one, and is essentially a measure of possible paths through the control flow graph of the code, typically measured per function/subroutine. Higher cyclomatic complexity usually translates to the code being more difficult to understand, and always translates to it being harder to test.
The other big one is the Halstead complexity measures, which reason about various properties of the code based on the number of operators and operands (both total and distinct values). They're somewhat harder to calculate in a lot of languages than the cyclomatic complexity, though the 'difficulty' measure is arguably more useful for deciding on readability than the cyclomatic complexity is.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Various measures of complexity come to mind, as they're often used as guideposts for when to sub-divide functions for readability.
Cyclomatic complexity is the most commonly used one, and is essentially a measure of possible paths through the control flow graph of the code, typically measured per function/subroutine. Higher cyclomatic complexity usually translates to the code being more difficult to understand, and always translates to it being harder to test.
The other big one is the Halstead complexity measures, which reason about various properties of the code based on the number of operators and operands (both total and distinct values). They're somewhat harder to calculate in a lot of languages than the cyclomatic complexity, though the 'difficulty' measure is arguably more useful for deciding on readability than the cyclomatic complexity is.