예제 #1
0
 def get_commits(self, extra_details=False):
     _commits = self.get_current_commit_objects()
     commits = []
     for commit in _commits:
         commit_id = commit.id.hex
         commit_message = commit.message
         res = re.search(
             r'\b{bug|fix|issue|error|correct|proper|deprecat|broke|optimize|patch|solve|slow|obsolete|vulnerab|debug|perf|memory|minor|wart|better|complex|break|investigat|compile|defect|inconsist|crash|problem|resol|#}\b',
             utils().stemming(commit_message), re.IGNORECASE)
         if res is not None:
             commits_buggy = 1
         else:
             commits_buggy = 0
         if len(commit.parent_ids) == 0:
             commit_parent = None
         else:
             commit_parent = commit.parent_ids[0].hex
         commit_time = commit.commit_time
         commit_time_offset = commit.commit_time_offset
         if extra_details:
             commits.append([
                 commit_id, commit_message, commit_parent, commits_buggy,
                 commit_time
             ])
         else:
             commits.append(
                 [commit_id, commit_message, commit_parent, commits_buggy])
     return commits
예제 #2
0
 def get_user_node_degree(self):
     graph_util = utils.utils()
     print("starting graph")
     connection_matrix = self.get_bug_creators(self.diffs)
     connection_matrix.to_csv('temp.csv')
     print("Done everything")
     self.repo_obj.repo_remove()
     return connection_matrix  #,connection_matrix
예제 #3
0
 def get_user_node_degree(self):
     graph_util = utils.utils()
     degree,G = graph_util.create_graph(self.create_adjacency_matrix())
     user_degree = {}
     user_mapping = self.user_map.values.tolist()
     for i in range(len(user_mapping)):
         logon  = user_mapping[i][1]
         user_name = user_mapping[i][0]
         user_id = self.user_dict[logon]
         if user_id not in degree.keys():
             continue
         user_degree[user_name] = degree[user_id]
     print('Done with social graph')
     return user_degree
     
예제 #4
0
 def get_user_node_degree(self):
     graph_util = utils.utils()
     print("starting graph")
     connection_matrix, uniq_users, user_dict, bug_creator_df_final = self.create_adjacency_matrix(
     )
     print("done graph")
     degree, G = graph_util.create_graph(connection_matrix)
     print("getting degree")
     user_degree = {}
     for i in range(len(uniq_users)):
         user_name = uniq_users[i]
         user_id = user_dict[user_name]
         if user_id not in degree.keys():
             continue
         user_degree[user_name] = degree[user_id]
     print("Done everything")
     self.repo_obj.repo_remove()
     return user_degree, bug_creator_df_final  #,connection_matrix
예제 #5
0
 def get_user_node_degree(self):
     graph_util = utils.utils()
     print(
         "starting code graph get_node_degree creation of adjacency matrix")
     connection_matrix, uniq_users, user_dict, bug_creator_df_final = self.create_adjacency_matrix(
     )
     print("done code graph get_node_degree creation of adjacency matrix")
     #TODO: We may get better performance, by not creating the graph at all, if all we need is the degree.
     degree, G = graph_util.create_graph(connection_matrix)
     print("getting degree")
     user_degree = {}
     for i in range(len(uniq_users)):
         user_name = uniq_users[i]
         user_id = user_dict[user_name]
         if user_id not in degree.keys():
             continue
         user_degree[user_name] = degree[user_id]
     print("Done everything")
     self.repo_obj.repo_remove()
     return user_degree, bug_creator_df_final  #,connection_matrix
예제 #6
0
 def isBuggyCommit(self, commit):
     res = re.search(
         r'\b{bug|fix|issue|error|correct|proper|deprecat|broke|optimize|patch|solve|slow|obsolete|vulnerab|debug|perf|memory|minor|wart|better|complex|break|investigat|compile|defect|inconsist|crash|problem|resol|#}\b',
         utils().stemming(commit), re.IGNORECASE)
     if res is not None:
         return True