I don't think it
should affect testing, as the code should be exercised whether as a result of an
if
clause or a bit shift. There
may be some code coverage tools that are confused by such tricks (especially the second one), but that's why you employ humans, right? I wouldn't say it's arbitrary; if you have a single method with a cyclomatic complexity over, say, 50, that's probably too high and your method is likely doing too much. However, as a code reviewer, if I see a ton of code with tricks like those shown, I'd be making sure the test suite is
very comprehensive. —
Heretic Monkey 6 secs ago