re: Coding Concepts! Cyclomatic Complexity VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I definitely like the write-up! I love to see software quality metrics being discussed. I do want to point out in your first example: var msg = ...
 

"Your suggested reduction in cyclomatic complexity (which I agree with) actually increases your essential complexity... though not above the structured/unstructured threshold. You add an additional exit point to the function, which is a trade off. Your second example:
"

Additional exit point will not be added since the msg variable will have a default, then you only change the content of the variable when the if statement evaluate to true, and only one return statement is needed.

 
 

You're absolutely right. I was mixing code samples in my head. Thanks for the correction!

code of conduct - report abuse