A followup for D32942.
Malcolm Parsons has provided a valid testcase that the initial version of the check complained about nested if's.
As it turns out, the culprit is the partially un-intentional switch fallthrough.
So rewrite the NestingThreshold logic without ab-using+mis-using that switch with fallthrough, and add testcases with nested if' where there should be a warning and shouldn't be a warning. This results in a cleaner, simpler code, too.
I guess, now it would be actually possible to pick some reasonable default for NestingThreshold setting.