From ad8af6b24ed1b99203a9fd209fac5e269a533095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 6 Jan 2015 19:35:15 +0100 Subject: [PATCH] triage: write number of fp/tp in report --- triage/triage.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/triage/triage.py b/triage/triage.py index 780b79345..a9c351037 100644 --- a/triage/triage.py +++ b/triage/triage.py @@ -22,18 +22,15 @@ fin = open(resultfile,'rt') results = fin.read() fin.close() -fout = open('report.html','wt') -fout.write('Cppcheck results for ' + project + '\n') -fout.write('

Cppcheck results for ' + project + '

\n') -fout.write('\n') -fout.write('\n') - out = {} out['untriaged'] = '' out['fp'] = '' out['tp'] = '' out['notfound'] = '' +numberOfFalsePositives = 0 +numberOfTruePositives = 0 + for result in results.split('\n'): result = result.strip() @@ -49,9 +46,11 @@ for result in results.split('\n'): if result in truepositives: css = 'tp' classification = 'Bug' + numberOfTruePositives += 1 elif result in falsepositives: css = 'fp' classification = 'Not bug' + numberOfFalsePositives += 1 href = None html = ' ' @@ -98,7 +97,19 @@ for line in f.readlines(): f.close(); +project2 = '' +if project.find('-') > 0: + project2 = project[:project.find('-')] +else: + project2 = project +fout = open('report.html','wt') +fout.write('Cppcheck results for ' + project + '\n') +fout.write('

Cppcheck results for ' + project + '

\n') +fout.write('

Number of true positives: ' + str(numberOfTruePositives) + '

\n') +fout.write('

Number of false positives: ' + str(numberOfFalsePositives) + '

\n') +fout.write('
FilenameLineMessageClassification
\n') +fout.write('\n') fout.write(out['tp']) fout.write(out['notfound']) fout.write(out['untriaged'])
FilenameLineMessageClassification