Now *that* is truly twisted! Because of the nested ifs it is possible
that this does not trigger any warnings. Despite that, it probably
contravenes even more of the OP's coding rules, but I'd give it
(mental) house room -- it is actually quite easy to reason about.
Yup, the "break" used in the if-statements breaks our coding rules.
But to many nested if's only gives a lower QA-C warning (a level 0
"'function' has a very high path count and is almost untestable" (or
even: "'function' is completely untestable and must be split into
subfunctions"). But we may decide to ignore them, which in most cases
we (have to) do, since most of those warnings are already existing
warnings (the drawback of sustaining). Whenever I see them in new code
(or when they pop-up after a change done by me) I try to solve them
(try, since sometimes it takes more dangerous effort to take it out
than to leave it in (again drawback of sustaining: if it ain't broken,
don't fix it))
But I'm going off-topic.
Everybody who replied thank you for doing so.
After we also got an answer on the mail sent to the department which
makes our coding rules (there answer was the same as already told
here: QA-C gives the warning because of the possible side-effects), we
decided to solve the issue in the tool-satisfaction way, just to
prevent that this discussion pops up everytime when this module-file
is changed.
Kind regards,
Harry