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

Method flush_fn_ref_candidates

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

Source from the content-addressed store, hash-verified

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

Callers 1

extractFunction · 0.45

Calls 4

is_generated_fileFunction · 0.85
col16Function · 0.85
putMethod · 0.80
push_refMethod · 0.45

Tested by

no test coverage detected