Extract methods from a setRefClass methods = list(...) call.
(
self, list_call, source: bytes, language: str, file_path: str,
nodes: list[NodeInfo], edges: list[EdgeInfo],
class_name: str,
import_map: Optional[dict[str, str]],
defined_names: Optional[set[str]],
)
| 6916 | return True |
| 6917 | |
| 6918 | def _extract_r_methods( |
| 6919 | self, list_call, source: bytes, language: str, file_path: str, |
| 6920 | nodes: list[NodeInfo], edges: list[EdgeInfo], |
| 6921 | class_name: str, |
| 6922 | import_map: Optional[dict[str, str]], |
| 6923 | defined_names: Optional[set[str]], |
| 6924 | ) -> None: |
| 6925 | """Extract methods from a setRefClass methods = list(...) call.""" |
| 6926 | for method_name, func_def in self._r_iter_args(list_call): |
| 6927 | if not method_name or func_def is None: |
| 6928 | continue |
| 6929 | if func_def.type != "function_definition": |
| 6930 | continue |
| 6931 | |
| 6932 | qualified = self._qualify(method_name, file_path, class_name) |
| 6933 | params = self._get_params(func_def, language, source) |
| 6934 | nodes.append(NodeInfo( |
| 6935 | kind="Function", |
| 6936 | name=method_name, |
| 6937 | file_path=file_path, |
| 6938 | line_start=func_def.start_point[0] + 1, |
| 6939 | line_end=func_def.end_point[0] + 1, |
| 6940 | language=language, |
| 6941 | parent_name=class_name, |
| 6942 | params=params, |
| 6943 | )) |
| 6944 | edges.append(EdgeInfo( |
| 6945 | kind="CONTAINS", |
| 6946 | source=self._qualify(class_name, file_path, None), |
| 6947 | target=qualified, |
| 6948 | file_path=file_path, |
| 6949 | line=func_def.start_point[0] + 1, |
| 6950 | )) |
| 6951 | self._extract_from_tree( |
| 6952 | func_def, source, language, file_path, nodes, edges, |
| 6953 | enclosing_class=class_name, |
| 6954 | enclosing_func=method_name, |
| 6955 | import_map=import_map, |
| 6956 | defined_names=defined_names, |
| 6957 | ) |
no test coverage detected