Beispiel #1
0
 def getBugData(self, bugId):
     params = (bugId,)
     bugData = self.executeAndFetchOne("SELECT bpe.line_begin, bpe.col_begin, bpe.line_end, bpe.col_end, f.filepath FROM bug_path_events bpe JOIN files f ON bpe.file_id=f.id WHERE bpe.report_id=? ORDER BY bpe.`order` DESC LIMIT 1", params)
     checkerData = self.executeAndFetchOne("SELECT checker_id, detection_status, checker_message, line, bug_id FROM reports WHERE id=? LIMIT 1", params)
     params2 = (checkerData[4],)
     reviewData = self.executeAndFetchOne("SELECT status FROM review_statuses WHERE bug_hash=? LIMIT 1", params2)
     allBugData = BugData(bugData[0], bugData[2], bugData[4], checkerData[0], checkerData[1], checkerData[2], checkerData[3], reviewData)
     return allBugData
 def getIncorrectBugDataLineBoundariesSwap(self):
     bugStartLine = 9
     bugEndLine = 7
     filepath = config.getRepoDir() + '/bugcode.cpp'
     return BugData(bugStartLine, bugEndLine, filepath, '', '')
 def getIncorrectBugDataLineOutOfRange(self):
     bugStartLine = 20
     bugEndLine = 21
     filepath = config.getRepoDir() + '/bugcode.cpp'
     return BugData(bugStartLine, bugEndLine, filepath, '', '')
 def getIncorrectBugDataFileNotExist(self):
     bugStartLine = 8
     bugEndLine = 8
     filepath = config.getRepoDir() + '/bugcode_notexists.cpp'
     return BugData(bugStartLine, bugEndLine, filepath, '', '')
 def getCorrectBugDataFileMultiLine(self):
     bugStartLine = 7
     bugEndLine = 9
     filepath = config.getRepoDir() + '/bugcode.cpp'
     return BugData(bugStartLine, bugEndLine, filepath, '', '')
 def getCorrectBugDataFileBegin(self):
     bugStartLine = 1
     bugEndLine = 1
     filepath = config.getRepoDir() + '/bugcode.cpp'
     return BugData(bugStartLine, bugEndLine, filepath, '', '')
 def getBugData3(self):
     bugStartLine = 9
     bugEndLine = 9
     filepath = 'bugcode2.cpp'
     return BugData(bugStartLine, bugEndLine, filepath, '', '')