CryptoLib icon indicating copy to clipboard operation
CryptoLib copied to clipboard

Consider single return per statement

Open dccutrig opened this issue 2 years ago • 3 comments

Originally layout made sense. Making issue for internal discussion of having just one return per function, perhaps utilizing gotoreturn labels. ISsue to be discussed / closed / modified as appropriate.

dccutrig avatar Jul 20 '23 21:07 dccutrig

Put a halt on this due to rapidly increasing cyclomatic complexity. If you replace the early returns with a status message that gets returned at the end, you must add a ton of 'if' statements checking if the function should be returned.

Donnie-Ice avatar Jun 11 '24 18:06 Donnie-Ice

We may want to revisit now that we've reduced complexity once (Mainly because we still have to revisit on the KMC side once open source containers are released). If we can provide single returns, and then break functions up into smaller pieces as they make sense, we can reduce complexity again, and probably improve test coverage.

rjbrown2 avatar Sep 04 '24 18:09 rjbrown2