Method: pylint.pyreverse.diagrams.ClassDiagram.get_attrs
Calls: 158, Exceptions: 0, Paths: 5Back
Path 1: 77 calls (0.49)
ClassDef (77)
[] (77)
1def get_attrs(self, node: nodes.ClassDef) -> list[str]:
2 """Return visible attributes, possibly with class name."""
3 attrs = []
4 properties = [
5 (n, m)
6 for n, m in node.items()
7 if isinstance(m, nodes.FunctionDef) and decorated_with_property(m)
8 ]
9 for node_name, associated_nodes in (
10 list(node.instance_attrs_type.items())
11 + list(node.locals_type.items())
12 + properties
13 ):
14 if not self.show_attr(node_name):
15 continue
16 names = self.class_names(associated_nodes)
17 if names:
18 node_name = f"{node_name} : {', '.join(names)}"
19 attrs.append(node_name)
20 return sorted(attrs)
Path 2: 38 calls (0.24)
ClassDef (38)
['attr : str', 'cls_member'] (18) ['TYPE : str', 'relation', 'relation2', 'top : str'] (17) ['msgs : dict', 'name : str', 'options : tuple'] (1) ['msg...
1def get_attrs(self, node: nodes.ClassDef) -> list[str]:
2 """Return visible attributes, possibly with class name."""
3 attrs = []
4 properties = [
5 (n, m)
6 for n, m in node.items()
7 if isinstance(m, nodes.FunctionDef) and decorated_with_property(m)
8 ]
9 for node_name, associated_nodes in (
10 list(node.instance_attrs_type.items())
11 + list(node.locals_type.items())
12 + properties
13 ):
14 if not self.show_attr(node_name):
15 continue
16 names = self.class_names(associated_nodes)
17 if names:
18 node_name = f"{node_name} : {', '.join(names)}"
19 attrs.append(node_name)
20 return sorted(attrs)
Path 3: 22 calls (0.14)
ClassDef (22)
['my_int : Optional[int]', 'my_int_2 : Optional[int]', 'my_string : str'] (17) ['alternative_union_syntax : str | int', 'class_attr : list[Dummy]', 'o...
1def get_attrs(self, node: nodes.ClassDef) -> list[str]:
2 """Return visible attributes, possibly with class name."""
3 attrs = []
4 properties = [
5 (n, m)
6 for n, m in node.items()
7 if isinstance(m, nodes.FunctionDef) and decorated_with_property(m)
8 ]
9 for node_name, associated_nodes in (
10 list(node.instance_attrs_type.items())
11 + list(node.locals_type.items())
12 + properties
13 ):
14 if not self.show_attr(node_name):
15 continue
16 names = self.class_names(associated_nodes)
17 if names:
18 node_name = f"{node_name} : {', '.join(names)}"
19 attrs.append(node_name)
20 return sorted(attrs)
Path 4: 19 calls (0.12)
ClassDef (19)
['prop1', 'prop2'] (19)
1def get_attrs(self, node: nodes.ClassDef) -> list[str]:
2 """Return visible attributes, possibly with class name."""
3 attrs = []
4 properties = [
5 (n, m)
6 for n, m in node.items()
7 if isinstance(m, nodes.FunctionDef) and decorated_with_property(m)
8 ]
9 for node_name, associated_nodes in (
10 list(node.instance_attrs_type.items())
11 + list(node.locals_type.items())
12 + properties
13 ):
14 if not self.show_attr(node_name):
15 continue
16 names = self.class_names(associated_nodes)
17 if names:
18 node_name = f"{node_name} : {', '.join(names)}"
19 attrs.append(node_name)
20 return sorted(attrs)
Path 5: 2 calls (0.01)
ClassDef (2)
['checker1', 'checker2', 'checker3'] (1) ['a', 'b'] (1)
1def get_attrs(self, node: nodes.ClassDef) -> list[str]:
2 """Return visible attributes, possibly with class name."""
3 attrs = []
4 properties = [
5 (n, m)
6 for n, m in node.items()
7 if isinstance(m, nodes.FunctionDef) and decorated_with_property(m)
8 ]
9 for node_name, associated_nodes in (
10 list(node.instance_attrs_type.items())
11 + list(node.locals_type.items())
12 + properties
13 ):
14 if not self.show_attr(node_name):
15 continue
16 names = self.class_names(associated_nodes)
17 if names:
18 node_name = f"{node_name} : {', '.join(names)}"
19 attrs.append(node_name)
20 return sorted(attrs)