(self, node, parent=None, index=None, **kwargs)
:param ConditionNode node:
        :param successor:
        :return:
def _handle_Condition(self, node, parent=None, index=None, **kwargs):
        """

        :param ConditionNode node:
        :param successor:
        :return:
        """

        if node.true_node is not None and node.false_node is not None:
            try:
                last_stmts = ConditionProcessor.get_last_statements(node.true_node)
            except EmptyBlockNotice:
                last_stmts = None
            if last_stmts is not None and all(self._is_statement_terminating(stmt) for stmt in last_stmts):
                # all end points in the true node are returning

                # remove the else node and make it a new node following node
                else_node = node.false_node
                node.false_node = None
                insert_node(parent, index + 1, else_node, index)

        if node.true_node is not None:
            self._handle(node.true_node, parent=node, index=0)
        if node.false_node is not None:
            self._handle(node.false_node, parent=node, index=1)
def _handle_Condition ( self , node , parent = None , index = None , * * kwargs ) : if node . true_node is not None and node . false_node is not None : try : last_stmts = ConditionProcessor . get_last_statements ( node . true_node ) except EmptyBlockNotice : last_stmts = None if last_stmts is not None and all ( self . _is_statement_terminating ( stmt ) for stmt in last_stmts ) : # all end points in the true node are returning # remove the else node and make it a new node following node else_node = node . false_node node . false_node = None insert_node ( parent , index + 1 , else_node , index ) if node . true_node is not None : self . _handle ( node . true_node , parent = node , index = 0 ) if node . false_node is not None : self . _handle ( node . false_node , parent = node , index = 1 )