def _post_visit(self): for root, children in self._if_children.items(): real_children_length = len(set(children)) if real_children_length > self._max_elifs: self.add_violation( TooManyElifsViolation(root, text=str(real_children_length)), )
def _check_possible_switch(self) -> None: for node, elifs in self._counter.elifs.items(): if elifs > self.options.max_elifs: self.add_violation(TooManyElifsViolation(node))