MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / _get_call_chain_recursive

Method _get_call_chain_recursive

rust-core/src/codegraph/graph.rs:124–152  ·  view source on GitHub ↗
(
        &self,
        function_id: &Uuid,
        chains: &mut Vec<Vec<Uuid>>,
        visited: &mut HashSet<Uuid>,
        depth: usize,
        max_depth: usize,
    )

Source from the content-addressed store, hash-verified

122 }
123
124 fn _get_call_chain_recursive(
125 &self,
126 function_id: &Uuid,
127 chains: &mut Vec<Vec<Uuid>>,
128 visited: &mut HashSet<Uuid>,
129 depth: usize,
130 max_depth: usize,
131 ) {
132 if depth >= max_depth || visited.contains(function_id) {
133 return;
134 }
135
136 visited.insert(*function_id);
137 let callees = self.get_callees(function_id);
138
139 if callees.is_empty() {
140 chains.push(vec![*function_id]);
141 } else {
142 for callee in callees {
143 let mut sub_chains = Vec::new();
144 self._get_call_chain_recursive(&callee.callee_id, &mut sub_chains, visited, depth + 1, max_depth);
145
146 for mut chain in sub_chains {
147 chain.insert(0, *function_id);
148 chains.push(chain);
149 }
150 }
151 }
152 }
153
154
155

Callers 1

get_call_chainMethod · 0.45

Calls 2

insertMethod · 0.80
get_calleesMethod · 0.45

Tested by

no test coverage detected