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

Method read_data_from_jira_file

persper/extractor.py:53–87  ·  view source on GitHub ↗

return dataset, a list of dict data points

(self, parseFile, issueId)

Source from the content-addressed store, hash-verified

51
52 # Read the useful information from a Jira issue file (Title, Description, Comments, Type, Priority)
53 def read_data_from_jira_file(self, parseFile, issueId):
54 """return dataset, a list of dict data points"""
55 dp = {}
56 dp['issue'] = issueId
57
58 title = parseFile.getElementsByTagName('title')
59 data = title[1].firstChild.data
60 data = re.sub(r'\[.*?\]\s', "", data)
61 data = self.remove_useless_data(data)
62 dp['title'] = data
63
64 description = parseFile.getElementsByTagName('description')
65 des_str = ''
66 for i, des in enumerate(description):
67 if i != 0 and des.firstChild != None:
68 data = self.remove_useless_data(des.firstChild.data)
69 des_str = des_str + data
70 dp['description'] = des_str
71
72 comments = parseFile.getElementsByTagName('comment')
73 comment_str = ''
74 for i, com in enumerate(comments):
75 if com.firstChild:
76 data = self.remove_useless_data(com.firstChild.data)
77 comment_str = comment_str + data
78 dp['comment'] = comment_str
79
80 type = parseFile.getElementsByTagName('type')
81 dp['type'] = type[0].firstChild.data
82
83 priority = parseFile.getElementsByTagName('priority')
84 for i, pri in enumerate(priority):
85 dp['priority'] = pri.firstChild.data
86
87 return dp
88
89 # Read all useful information from all files under a jira issues dir
90 # Each issue data structure : (issue id) -> (title, description, comments, priority, type)

Callers 1

generate_datasetMethod · 0.95

Calls 1

remove_useless_dataMethod · 0.95

Tested by

no test coverage detected