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('Filename | Line | Message | Classification |
\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('\n')
+fout.write('Filename | Line | Message | Classification |
\n')
fout.write(out['tp'])
fout.write(out['notfound'])
fout.write(out['untriaged'])