Fixing pylint R0912 too-many-branches

Posted by Moser on 18 Jun 2020