gootsaud / bike-riding

if statements can be merged PTC-W0048
Anti-pattern
Major
2 years ago2 years old
Consider merging collapsible if statements
151    elif hasattr(types, "CoroutineType") and isinstance(obj, types.CoroutineType):
152        if attr in UNSAFE_COROUTINE_ATTRIBUTES:
153            return True
154    elif hasattr(types, "AsyncGeneratorType") and isinstance(155        obj, types.AsyncGeneratorType
156    ):
157        if attr in UNSAFE_ASYNC_GENERATOR_ATTRIBUTES:
Consider merging collapsible if statements
 220        todo = deque([self])
 221        while todo:
 222            node = todo.popleft()
 223            if "lineno" in node.attributes: 224                if node.lineno is None or override:
 225                    node.lineno = lineno
 226            todo.extend(node.iter_child_nodes())
Consider merging collapsible if statements
1588    # -- Expression Visitors
1589
1590    def visit_Name(self, node: nodes.Name, frame: Frame) -> None:
1591        if node.ctx == "store" and (1592            frame.toplevel or frame.loop_frame or frame.block_frame
1593        ):
1594            if self._assign_stack: