MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / flush_fn_ref_candidates

Method flush_fn_ref_candidates

codegraph-kernel/src/php.rs:1378–1413  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1376 }
1377
1378 fn flush_fn_ref_candidates(&mut self) {
1379 let cands = std::mem::take(&mut self.fn_ref_cands);
1380 if cands.is_empty() || util::is_generated_file(self.file_path) {
1381 return;
1382 }
1383 let mut seen: HashSet<(String, String)> = HashSet::new();
1384 for c in cands {
1385 // `this.<m>` and `Cls::m` shapes always flush; HOF-position string
1386 // callables skip the gate (unique-or-drop at resolution); the rest
1387 // gate on defined-in-file ∪ bare single-segment `use` imports
1388 // (path-shaped and `::`-shaped import refs match neither regex).
1389 if !c.name.starts_with("this.") && !c.name.contains("::") {
1390 let skip = c.skip_gate;
1391 if !skip
1392 && !self.defined_fn_names.contains(&c.name)
1393 && !self.imported_names.contains(&c.name)
1394 {
1395 continue;
1396 }
1397 }
1398 if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) {
1399 continue;
1400 }
1401 let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte);
1402 let name_ref = self.arena.put(&c.name);
1403 self.tables.push_ref(&RefRow {
1404 from_idx: c.from,
1405 kind: FUNCTION_REF_CODE,
1406 line: c.line,
1407 column,
1408 reference_name: name_ref,
1409 candidates: NONE_STR,
1410 from_id_str: NONE_STR,
1411 });
1412 }
1413 }
1414
1415 // --- value references ------------------------------------------------------------
1416

Callers 1

extractFunction · 0.45

Calls 5

is_generated_fileFunction · 0.85
col16Function · 0.85
putMethod · 0.65
takeFunction · 0.50
push_refMethod · 0.45

Tested by

no test coverage detected