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

Method on_add

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

Source from the content-addressed store, hash-verified

68 self.G.add_node(commit.hexsha)
69
70 def on_add(self, diff, commit):
71 fname = diff.b_blob.path
72 sha = commit.hexsha
73 if self.fname_filter(fname):
74 file_contents = get_contents(self.repo, commit, fname)
75 func_ids, _ = self.func_extractor(file_contents, fname)
76 for func_id in func_ids:
77 self.func_commit[func_id] = sha
78
79 def on_delete(self, diff, commit):
80 fname = diff.a_blob.path

Callers

nothing calls this directly

Calls 2

get_contentsFunction · 0.90
fname_filterMethod · 0.80

Tested by

no test coverage detected