MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / make_calls

Function make_calls

code2flow/javascript.py:97–113  ·  view source on GitHub ↗

Given a list of lines, find all calls in this list. :param list|dict body: :rtype: list[Call]

(body)

Source from the content-addressed store, hash-verified

95
96
97def make_calls(body):
98 """
99 Given a list of lines, find all calls in this list.
100
101 :param list|dict body:
102 :rtype: list[Call]
103 """
104 calls = []
105 for element in walk(body):
106 if element['type'] == 'CallExpression':
107 call = get_call_from_func_element(element)
108 if call:
109 calls.append(call)
110 elif element['type'] == 'NewExpression' and element['callee']['type'] == 'Identifier':
111 calls.append(Call(token=element['callee']['name'],
112 line_number=lineno(element)))
113 return calls
114
115
116def process_assign(element):

Callers 2

make_nodesMethod · 0.70
make_root_nodeMethod · 0.70

Calls 4

CallClass · 0.85
walkFunction · 0.70
linenoFunction · 0.70

Tested by

no test coverage detected