| 317 | |
| 318 | |
| 319 | class FunctionCallCollector(cst.CSTVisitor): |
| 320 | def __init__(self): |
| 321 | super().__init__() |
| 322 | self._calls = [] |
| 323 | |
| 324 | @property |
| 325 | def calls(self): |
| 326 | return self._calls |
| 327 | |
| 328 | def visit_Call(self, node: cst.Call) -> bool | None: |
| 329 | code = cst.Module([]).code_for_node |
| 330 | func_name = code(node.func) |
| 331 | args = [(f"{code(arg.keyword)}=" if arg.keyword else "") + code(arg.value) for arg in node.args] |
| 332 | self._calls.append((func_name, args)) |
| 333 | |
| 334 | |
| 335 | def get_class_docstring(node: cst.ClassDef) -> str | None: |
no outgoing calls
no test coverage detected
searching dependent graphs…