import os import sys import subprocess def readdate(data): datepos = -1 if data[:5] == 'DATE ': datepos = 0 else: datepos = data.find('\nDATE ') if datepos >= 0: datepos = datepos + 1 if datepos < 0: return None datestr = '' datepos = datepos + 5 while True: if datepos >= len(data): return None d = data[datepos] if d >= '0' and d <= '9': datestr = datestr + d elif d == '\n' or d == '\r': if len(datestr) == 8: return datestr[:4] + '-' + datestr[4:6] + '-' + datestr[6:] return None elif d != ' ' and d != '-': return None datepos = datepos + 1 path = '.' if len(sys.argv) == 2: path = sys.argv[1] mainpage = open(path + '/daca2.html', 'wt') mainpage.write('\n') mainpage.write('\n') mainpage.write('
\n') mainpage.write('\n') mainpage.write('Results when running latest (git head) Cppcheck on Debian.
\n') mainpage.write('For performance reasons the analysis is limited. Files larger than 1mb are skipped. If analysis of a file takes more than 10 minutes it may be stopped.
\n') mainpage.write('Name | ' + 'Date | ' + 'Error | ' + 'Warning | ' + 'Performance | ' + 'Portability | ' + 'Style | ' + 'Crashes | ' + 'VarID 0 |
---|---|---|---|---|---|---|---|---|
' + a + ' | ' + '' + datestr + ' | ' + '' + str(data.count('(error)')) + ' | ' + '' + str(data.count('(warning)')) + ' | ' + '' + str(data.count('(performance)')) + ' | ' + '' + str(data.count('(portability)')) + ' | ' + '' + str(data.count('(style)')) + ' | ' + '' + str(data.count('Crash?')) + ' | ' + '' + str(data.count('with varid 0.')) + ' | ' + '
Last update: ' + lastupdate + '
') allrecent = '' for r in recent: allrecent = allrecent + ' ' + r + '' mainpage.write('Most recently updated:' + allrecent + '
') mainpage.write('\n') mainpage.write('\n')