News for hackers. Stuff that matters.
Re:Bypassing GitHub's OAuth Flow with a Head Request by jacquesm on Thursday November 07, 2019 @04:22PM (#21477417)
A cascading if/else construct can have up to 2^(N+1) possible combinations where N is the number of if-else constructs. That can become very hard to test. If you have more than two levels of nested if-else's you should probably refactor especially if it is security sensitive code. The mental model you have of your code is as complex as the code itself and there is no way that you will be able to accurately model some more complex than what you can see all at once. Scope reduction is super important if you want reliable code and function extraction is one way to achieve this. It also allows for much cleaner test setups.

There are no comments on this comment yet.