diff --git a/triage/triage-report.py b/triage/triage-report.py index a9c351037..abf4eec94 100644 --- a/triage/triage-report.py +++ b/triage/triage-report.py @@ -24,12 +24,13 @@ fin.close() out = {} out['untriaged'] = '' +out['fn'] = '' out['fp'] = '' out['tp'] = '' -out['notfound'] = '' numberOfFalsePositives = 0 numberOfTruePositives = 0 +numberOfFalseNegatives = 0 for result in results.split('\n'): result = result.strip() @@ -45,11 +46,11 @@ for result in results.split('\n'): classification = 'Untriaged' if result in truepositives: css = 'tp' - classification = 'Bug' + classification = 'True Positive' numberOfTruePositives += 1 elif result in falsepositives: css = 'fp' - classification = 'Not bug' + classification = 'False Positive' numberOfFalsePositives += 1 href = None @@ -80,11 +81,13 @@ for line in f.readlines(): if line in results: continue + numberOfFalseNegatives += 1 + filename = res.group(1) linenr = res.group(2) message = res.group(3) - classification = 'Not Found' - css = 'notfound' + classification = 'False Negative' + css = 'fn' html = ' ' html += ''+filename+'' @@ -106,14 +109,15 @@ else: fout = open('report.html','wt') fout.write('Cppcheck results for ' + project + '\n') fout.write('

Cppcheck results for ' + project + '

\n') +fout.write('

Number of false negatives: ' + str(numberOfFalseNegatives) + '

\n') fout.write('

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

\n') fout.write('

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

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