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

Method flush_fn_ref_candidates

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

Source from the content-addressed store, hash-verified

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

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