MCPcopy Create free account
hub / github.com/Persper/code-analytics / aggregate_id_map

Method aggregate_id_map

persper/graphs/analyzer.py:186–196  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

184 self.autosave(phase, 0, 1)
185
186 def aggregate_id_map(self):
187 final_map = bidict()
188 for sha in self.ordered_shas:
189 for old_fid, new_fid in self.id_map[sha].items():
190 if old_fid in final_map.inverse:
191 # Make a copy so as not to remove list elements during iteration
192 existing_fids = final_map.inverse[old_fid].copy()
193 for ex_fid in existing_fids:
194 final_map[ex_fid] = new_fid
195 final_map[old_fid] = new_fid
196 return dict(final_map)
197
198 def cache_graph(self):
199 self.graph = self.graph_server.get_graph()

Callers 2

test_map_idFunction · 0.95
compute_commit_shareMethod · 0.95

Calls 2

bidictClass · 0.90
itemsMethod · 0.80

Tested by 1

test_map_idFunction · 0.76