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

Method flush_fn_ref_candidates

codegraph-kernel/src/python.rs:999–1029  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

997 }
998
999 fn flush_fn_ref_candidates(&mut self) {
1000 let cands = std::mem::take(&mut self.fn_ref_cands);
1001 if cands.is_empty() || util::is_generated_file(self.file_path) {
1002 return;
1003 }
1004 let mut seen: HashSet<(String, String)> = HashSet::new();
1005 for c in cands {
1006 if !c.name.starts_with("this.")
1007 && !c.name.contains('.')
1008 && !c.name.contains("::")
1009 && !self.defined_fn_names.contains(&c.name)
1010 && !self.imported_names.contains(&c.name)
1011 {
1012 continue;
1013 }
1014 if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) {
1015 continue;
1016 }
1017 let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte);
1018 let name_ref = self.arena.put(&c.name);
1019 self.tables.push_ref(&RefRow {
1020 from_idx: c.from,
1021 kind: FUNCTION_REF_CODE,
1022 line: c.line,
1023 column,
1024 reference_name: name_ref,
1025 candidates: NONE_STR,
1026 from_id_str: NONE_STR,
1027 });
1028 }
1029 }
1030
1031 // --- value refs -------------------------------------------------------------------
1032

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