def count_stats(): issue = 0 commit = 0 comment = 0 milestone = 0 for item in files: print item issue_data = read.get_issues(item) issue += len(issue_data.keys()) print "ISSUE: " + str(len(issue_data.keys())) milestone_data = read.get_milestones(item) milestone += len(milestone_data) print "milestone: " + str(len(milestone_data)) comment_data = read.get_comments(item) comment += len(comment_data) print "comment: " + str(len(comment_data)) commit_data = read.get_commits(item) commit += len(commit_data) print "commit: " + str(len(commit_data)) print print "Total" print "ISSUE: " + str(issue) print "commit: " + str(commit) print "comment: " + str(comment) print "milestone: " + str(milestone) print
def process_6(): for item in files: commits = read.get_commits(item) c_dict = {} for commit in commits: tt = datetime.fromtimestamp(commit["time"]).strftime('%m/%d') if tt in c_dict: c_dict[tt][1] += 1 else: c_dict[tt] = [commit["time"], 1] c_dict = c_dict.items() c_dict = sorted(c_dict, key=lambda x:x[1][0]) graph.bar_chart([x[1][1] for x in c_dict], [x[0] for x in c_dict], "Commit Timeline")
def process_6(): for item in files: commits = read.get_commits(item) c_dict = {} for commit in commits: tt = datetime.fromtimestamp(commit["time"]).strftime('%m/%d') if tt in c_dict: c_dict[tt][1] += 1 else: c_dict[tt] = [commit["time"], 1] c_dict = c_dict.items() c_dict = sorted(c_dict, key=lambda x: x[1][0]) graph.bar_chart([x[1][1] for x in c_dict], [x[0] for x in c_dict], "Commit Timeline")
def early_det(): for item in files: commits = read.get_commits(item) c_dict = {} r_dict = {} for commit in commits: if commit["user"] not in r_dict: r_dict[commit["user"]] = [] tt = datetime.fromtimestamp(commit["time"]).strftime('%m/%d') if tt in c_dict: c_dict[tt][1].append(commit["user"]) else: c_dict[tt] = [commit["time"], [commit["user"]]] c_dict = c_dict.items() c_dict = sorted(c_dict, key=lambda x:x[1][0]) for x in c_dict: for u in r_dict.keys(): c = sum([1 for y in x[1][1] if y==u]) r_dict[u].append(c) graph.multiple_lines(r_dict, "Commits in project "+item, [x[0] for x in c_dict])
def early_det(): for item in files: commits = read.get_commits(item) c_dict = {} r_dict = {} for commit in commits: if commit["user"] not in r_dict: r_dict[commit["user"]] = [] tt = datetime.fromtimestamp(commit["time"]).strftime('%m/%d') if tt in c_dict: c_dict[tt][1].append(commit["user"]) else: c_dict[tt] = [commit["time"], [commit["user"]]] c_dict = c_dict.items() c_dict = sorted(c_dict, key=lambda x: x[1][0]) for x in c_dict: for u in r_dict.keys(): c = sum([1 for y in x[1][1] if y == u]) r_dict[u].append(c) graph.multiple_lines(r_dict, "Commits in project " + item, [x[0] for x in c_dict])
def process_7(): for item in files: commits = read.get_commits(item) users = [x["user"] for x in commits] users = Counter(users) graph.pie_chart(users, "Project " + item)
def process_7(): for item in files: commits = read.get_commits(item) users = [x["user"] for x in commits] users = Counter(users) graph.pie_chart(users, "Project "+item)