(
&self,
function_id: &Uuid,
chains: &mut Vec<Vec<Uuid>>,
visited: &mut HashSet<Uuid>,
depth: usize,
max_depth: usize,
)
| 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 |
no test coverage detected