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

Method analyze

persper/graphs/analyzer.py:79–119  ·  view source on GitHub ↗
(self, rev=None,
                from_beginning=False,
                num_commits=None,
                continue_iter=False,
                end_commit_sha=None,
                into_branches=False,
                max_branch_length=100,
                min_branch_date=None,
                checkpoint_interval=1000,
                verbose=False)

Source from the content-addressed store, hash-verified

77 self.graph = None
78
79 def analyze(self, rev=None,
80 from_beginning=False,
81 num_commits=None,
82 continue_iter=False,
83 end_commit_sha=None,
84 into_branches=False,
85 max_branch_length=100,
86 min_branch_date=None,
87 checkpoint_interval=1000,
88 verbose=False):
89
90 if not continue_iter:
91 self.reset_state()
92 self.graph_server.reset_graph()
93
94 commits, branch_commits = \
95 self.ri.iter(rev=rev,
96 from_beginning=from_beginning,
97 num_commits=num_commits,
98 continue_iter=continue_iter,
99 end_commit_sha=end_commit_sha,
100 into_branches=into_branches,
101 max_branch_length=max_branch_length,
102 min_branch_date=min_branch_date)
103
104 print_overview(commits, branch_commits)
105 start_time = time.time()
106
107 for idx, commit in enumerate(reversed(commits), 1):
108 phase = 'main'
109 print_commit_info(phase, idx, commit, start_time, verbose)
110 self.analyze_master_commit(commit)
111 self.autosave(phase, idx, checkpoint_interval)
112
113 for idx, commit in enumerate(branch_commits, 1):
114 phase = 'branch'
115 print_commit_info(phase, idx, commit, start_time, verbose)
116 self.analyze_branch_commit(commit)
117 self.autosave(phase, idx, checkpoint_interval)
118
119 self.autosave('finished', 0, 1)
120
121 def _analyze_commit(self, commit, ccg_func):
122 sha = commit.hexsha

Callers 13

test_analyze_interfaceFunction · 0.95
testFeatureBranchFunction · 0.95
testCppTestRepoFunction · 0.95
test_black_setFunction · 0.95
test_az_basicFunction · 0.45
test_saveFunction · 0.45
test_azFunction · 0.45
test_analzyer_goFunction · 0.45
test_analzyer_goFunction · 0.45
test_analzyer_goFunction · 0.45

Calls 8

reset_stateMethod · 0.95
analyze_master_commitMethod · 0.95
autosaveMethod · 0.95
analyze_branch_commitMethod · 0.95
print_overviewFunction · 0.70
print_commit_infoFunction · 0.70
reset_graphMethod · 0.45
iterMethod · 0.45

Tested by 13

test_analyze_interfaceFunction · 0.76
testFeatureBranchFunction · 0.76
testCppTestRepoFunction · 0.76
test_black_setFunction · 0.76
test_az_basicFunction · 0.36
test_saveFunction · 0.36
test_azFunction · 0.36
test_analzyer_goFunction · 0.36
test_analzyer_goFunction · 0.36
test_analzyer_goFunction · 0.36