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

Method on_delete

persper/graphs/commit_graph.py:79–89  ·  view source on GitHub ↗
(self, diff, commit)

Source from the content-addressed store, hash-verified

77 self.func_commit[func_id] = sha
78
79 def on_delete(self, diff, commit):
80 fname = diff.a_blob.path
81 sha = commit.hexsha
82 if self.fname_filter(fname):
83 last_commit = commit.parents[0]
84 file_contents = get_contents(self.repo, last_commit, fname)
85 func_ids, _ = self.func_extractor(file_contents, fname)
86 for func_id in func_ids:
87 if func_id in self.func_commit:
88 add_edge(self.G, sha, self.func_commit[func_id], func_id)
89 del self.func_commit[func_id]
90
91 def on_rename(self, diff, commit):
92 # when similarity is 100%, diff.a_blob and diff.b_blob are None, so don't use them

Callers

nothing calls this directly

Calls 3

get_contentsFunction · 0.90
add_edgeFunction · 0.85
fname_filterMethod · 0.80

Tested by

no test coverage detected