Path 1: 1458 calls (0.96)

ClassDef (1458)

None (1458)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 2: 35 calls (0.02)

ClassDef (35)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 3: 11 calls (0.01)

ClassDef (11)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 4: 4 calls (0.0)

ClassDef (4)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 5: 3 calls (0.0)

ClassDef (3)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 6: 2 calls (0.0)

ClassDef (2)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 7: 2 calls (0.0)

ClassDef (2)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 8: 2 calls (0.0)

ClassDef (2)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 9: 1 calls (0.0)

ClassDef (1)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)
            

Path 10: 1 calls (0.0)

ClassDef (1)

1def _check_slots(self, node: nodes.ClassDef) -> None:
2        if "__slots__" not in node.locals:
3            return
4
5        for slots in node.ilookup("__slots__"):
6            # check if __slots__ is a valid type
7            if slots is astroid.Uninferable:
8                continue
9            if not is_iterable(slots) and not is_comprehension(slots):
10                self.add_message("invalid-slots", node=node)
11                continue
12
13            if isinstance(slots, nodes.Const):
14                # a string, ignore the following checks
15                self.add_message("single-string-used-for-slots", node=node)
16                continue
17            if not hasattr(slots, "itered"):
18                # we can't obtain the values, maybe a .deque?
19                continue
20
21            if isinstance(slots, nodes.Dict):
22                values = [item[0] for item in slots.items]
23            else:
24                values = slots.itered()
25            if values is astroid.Uninferable:
26                continue
27            for elt in values:
28                try:
29                    self._check_slots_elt(elt, node)
30                except astroid.InferenceError:
31                    continue
32            self._check_redefined_slots(node, slots, values)