Пример #1
0
def process_11():
    issues = {}
    for item in files:
        time_diff = []
        issue_data = read.get_issues(item)
        for issue in issue_data.keys():
            time_diff.append(max([x["when"] for x in issue_data[issue]]))
        time_diff = sorted(time_diff)
        tdd = []
        prev = 0
        for x in time_diff:
            if prev == 0:
                prev = x
                continue
            diff = (x - prev) / (60 * 60)
            prev = x
            tdd.append(diff)
        issues["Project " + item] = sorted(tdd)
    graph.multiple_lines(issues, "Issue time gap")
Пример #2
0
def process_11():
	issues = {}
	for item in files:
		time_diff = []
		issue_data = read.get_issues(item)
		for issue in issue_data.keys():
			time_diff.append(max([x["when"] for x in issue_data[issue]]))
		time_diff = sorted(time_diff)
		tdd = []
		prev = 0
		for x in time_diff:
			if prev == 0:
				prev = x
				continue
			diff = (x - prev)/(60*60)
			prev = x
			tdd.append(diff)
		issues["Project "+item] = sorted(tdd)
	graph.multiple_lines(issues, "Issue time gap")
Пример #3
0
def process_1():
	issues = {}
	for item in files:
		time_diff = []
		issue_data = read.get_issues(item)
		for issue in issue_data.keys():
			single_list = [x["when"] for x in issue_data[issue]]
			t = (max(single_list) - min(single_list)) / (60*60*24)
			if t == 0:
				continue
			time_diff.append(t)
		issues[item] = time_diff
		data = {"Less than a day": sum([1 for x in time_diff if x>=0 and x<1]),
				"2 to 5 days": sum([1 for x in time_diff if x>=1 and x<5]),
				"5 to 10 days": sum([1 for x in time_diff if x>=5 and x<10]),
				"10 days": sum([1 for x in time_diff if x>=10])
		}
		graph.pie_chart(data, "Issue open time of project "+item)
	graph.multiple_lines([issues[x] for x in issues.keys()])
Пример #4
0
def process_1():
    issues = {}
    for item in files:
        time_diff = []
        issue_data = read.get_issues(item)
        for issue in issue_data.keys():
            single_list = [x["when"] for x in issue_data[issue]]
            t = (max(single_list) - min(single_list)) / (60 * 60 * 24)
            if t == 0:
                continue
            time_diff.append(t)
        issues[item] = time_diff
        data = {
            "Less than a day": sum([1 for x in time_diff if x >= 0 and x < 1]),
            "2 to 5 days": sum([1 for x in time_diff if x >= 1 and x < 5]),
            "5 to 10 days": sum([1 for x in time_diff if x >= 5 and x < 10]),
            "10 days": sum([1 for x in time_diff if x >= 10])
        }
        graph.pie_chart(data, "Issue open time of project " + item)
    graph.multiple_lines([issues[x] for x in issues.keys()])
Пример #5
0
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])
Пример #6
0
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])