|
|
|
|
|
|
714
|
|
714
|
|
|
715
|
self.printNav(f)
|
715
|
self.printNav(f)
|
|
716
|
|
716
|
|
|
717
|
- f.write('<dl>')
|
|
|
|
|
|
717
|
+ f.write('<div><div class="card-body"><dl>')
|
|
718
|
f.write('<dt>Project name</dt><dd>%s</dd>' % (data.projectname))
|
718
|
f.write('<dt>Project name</dt><dd>%s</dd>' % (data.projectname))
|
|
719
|
f.write('<dt>Generated</dt><dd>%s (in %d seconds)</dd>' % (datetime.datetime.now().strftime(format), time.time() - data.getStampCreated()))
|
719
|
f.write('<dt>Generated</dt><dd>%s (in %d seconds)</dd>' % (datetime.datetime.now().strftime(format), time.time() - data.getStampCreated()))
|
|
720
|
f.write('<dt>Generator</dt><dd><a href="http://gitstats.sourceforge.net/">GitStats</a> (version %s), %s, %s</dd>' % (getversion(), getgitversion(), getgnuplotversion()))
|
720
|
f.write('<dt>Generator</dt><dd><a href="http://gitstats.sourceforge.net/">GitStats</a> (version %s), %s, %s</dd>' % (getversion(), getgitversion(), getgnuplotversion()))
|
|
|
|
|
|
|
724
|
f.write('<dt>Total Lines of Code</dt><dd>%s (%d added, %d removed)</dd>' % (data.getTotalLOC(), data.total_lines_added, data.total_lines_removed))
|
724
|
f.write('<dt>Total Lines of Code</dt><dd>%s (%d added, %d removed)</dd>' % (data.getTotalLOC(), data.total_lines_added, data.total_lines_removed))
|
|
725
|
f.write('<dt>Total Commits</dt><dd>%s (average %.1f commits per active day, %.1f per all days)</dd>' % (data.getTotalCommits(), float(data.getTotalCommits()) / len(data.getActiveDays()), float(data.getTotalCommits()) / data.getCommitDeltaDays()))
|
725
|
f.write('<dt>Total Commits</dt><dd>%s (average %.1f commits per active day, %.1f per all days)</dd>' % (data.getTotalCommits(), float(data.getTotalCommits()) / len(data.getActiveDays()), float(data.getTotalCommits()) / data.getCommitDeltaDays()))
|
|
726
|
f.write('<dt>Authors</dt><dd>%s (average %.1f commits per author)</dd>' % (data.getTotalAuthors(), (1.0 * data.getTotalCommits()) / data.getTotalAuthors()))
|
726
|
f.write('<dt>Authors</dt><dd>%s (average %.1f commits per author)</dd>' % (data.getTotalAuthors(), (1.0 * data.getTotalCommits()) / data.getTotalAuthors()))
|
|
727
|
- f.write('</dl>')
|
|
|
|
|
|
727
|
+ f.write('</dl></div')
|
|
728
|
|
728
|
|
|
729
|
f.write('</body>\n</html>')
|
729
|
f.write('</body>\n</html>')
|
|
730
|
f.close()
|
730
|
f.close()
|
|
|
|
|
|
|
755
|
stampcur -= deltaweek
|
755
|
stampcur -= deltaweek
|
|
756
|
|
756
|
|
|
757
|
# top row: commits & bar
|
757
|
# top row: commits & bar
|
|
758
|
- f.write('<table class="noborders"><tr>')
|
|
|
|
|
|
758
|
+ f.write('<div><div class="card-body"><table class="noborders"><tr>')
|
|
759
|
for i in range(0, WEEKS):
|
759
|
for i in range(0, WEEKS):
|
|
760
|
commits = 0
|
760
|
commits = 0
|
|
761
|
if weeks[i] in data.activity_by_year_week:
|
761
|
if weeks[i] in data.activity_by_year_week:
|
|
|
|
|
|
|
771
|
f.write('</tr><tr>')
|
771
|
f.write('</tr><tr>')
|
|
772
|
for i in range(0, WEEKS):
|
772
|
for i in range(0, WEEKS):
|
|
773
|
f.write('<td>%s</td>' % (WEEKS - i))
|
773
|
f.write('<td>%s</td>' % (WEEKS - i))
|
|
774
|
- f.write('</tr></table>')
|
|
|
|
|
|
774
|
+ f.write('</tr></table></div>')
|
|
775
|
|
775
|
|
|
776
|
# Hour of Day
|
776
|
# Hour of Day
|
|
777
|
f.write(html_header(2, 'Hour of Day'))
|
777
|
f.write(html_header(2, 'Hour of Day'))
|
|
778
|
hour_of_day = data.getActivityByHourOfDay()
|
778
|
hour_of_day = data.getActivityByHourOfDay()
|
|
779
|
- f.write('<table><tr><th>Hour</th>')
|
|
|
|
|
|
779
|
+ f.write('<div><div class="card-body"><table><tr><th>Hour</th>')
|
|
780
|
for i in range(0, 24):
|
780
|
for i in range(0, 24):
|
|
781
|
f.write('<th>%d</th>' % i)
|
781
|
f.write('<th>%d</th>' % i)
|
|
782
|
f.write('</tr>\n<tr><th>Commits</th>')
|
782
|
f.write('</tr>\n<tr><th>Commits</th>')
|
|
|
|
|
|
|
798
|
f.write('<td style="background-color: rgb(%d, 0, 0)">%.2f</td>' % (r, (100.0 * hour_of_day[i]) / totalcommits))
|
798
|
f.write('<td style="background-color: rgb(%d, 0, 0)">%.2f</td>' % (r, (100.0 * hour_of_day[i]) / totalcommits))
|
|
799
|
else:
|
799
|
else:
|
|
800
|
f.write('<td>0.00</td>')
|
800
|
f.write('<td>0.00</td>')
|
|
801
|
- f.write('</tr></table>')
|
|
|
|
|
|
801
|
+ f.write('</tr></table></div>')
|
|
802
|
f.write('<img src="hour_of_day.png" alt="Hour of Day" />')
|
802
|
f.write('<img src="hour_of_day.png" alt="Hour of Day" />')
|
|
803
|
fg = open(path + '/hour_of_day.dat', 'w')
|
803
|
fg = open(path + '/hour_of_day.dat', 'w')
|
|
804
|
for i in range(0, 24):
|
804
|
for i in range(0, 24):
|
|
|
|
|
|
|
832
|
|
832
|
|
|
833
|
# Hour of Week
|
833
|
# Hour of Week
|
|
834
|
f.write(html_header(2, 'Hour of Week'))
|
834
|
f.write(html_header(2, 'Hour of Week'))
|
|
835
|
- f.write('<table>')
|
|
|
|
|
|
835
|
+ f.write('<div><div class="card-body"><table>')
|
|
836
|
|
836
|
|
|
837
|
f.write('<tr><th>Weekday</th>')
|
837
|
f.write('<tr><th>Weekday</th>')
|
|
838
|
for hour in range(0, 24):
|
838
|
for hour in range(0, 24):
|
|
|
|
|
|
|
855
|
f.write('<td></td>')
|
855
|
f.write('<td></td>')
|
|
856
|
f.write('</tr>')
|
856
|
f.write('</tr>')
|
|
857
|
|
857
|
|
|
858
|
- f.write('</table>')
|
|
|
|
|
|
858
|
+ f.write('</table></div>')
|
|
859
|
|
859
|
|
|
860
|
# Month of Year
|
860
|
# Month of Year
|
|
861
|
f.write(html_header(2, 'Month of Year'))
|
861
|
f.write(html_header(2, 'Month of Year'))
|
|
|
|
|
|
|
898
|
|
898
|
|
|
899
|
# Commits by timezone
|
899
|
# Commits by timezone
|
|
900
|
f.write(html_header(2, 'Commits by Timezone'))
|
900
|
f.write(html_header(2, 'Commits by Timezone'))
|
|
901
|
- f.write('<table><tr>')
|
|
|
|
|
|
901
|
+ f.write('<div><div class="card-body"><table><tr>')
|
|
902
|
f.write('<th>Timezone</th><th>Commits</th>')
|
902
|
f.write('<th>Timezone</th><th>Commits</th>')
|
|
903
|
max_commits_on_tz = max(data.commits_by_timezone.values())
|
903
|
max_commits_on_tz = max(data.commits_by_timezone.values())
|
|
904
|
for i in sorted(data.commits_by_timezone.keys(), key = lambda n : int(n)):
|
904
|
for i in sorted(data.commits_by_timezone.keys(), key = lambda n : int(n)):
|
|
905
|
commits = data.commits_by_timezone[i]
|
905
|
commits = data.commits_by_timezone[i]
|
|
906
|
r = 127 + int((float(commits) / max_commits_on_tz) * 128)
|
906
|
r = 127 + int((float(commits) / max_commits_on_tz) * 128)
|
|
907
|
f.write('<tr><th>%s</th><td style="background-color: rgb(%d, 0, 0)">%d</td></tr>' % (i, r, commits))
|
907
|
f.write('<tr><th>%s</th><td style="background-color: rgb(%d, 0, 0)">%d</td></tr>' % (i, r, commits))
|
|
908
|
- f.write('</tr></table>')
|
|
|
|
|
|
908
|
+ f.write('</tr></table></div>')
|
|
909
|
|
909
|
|
|
910
|
f.write('</body></html>')
|
910
|
f.write('</body></html>')
|
|
911
|
f.close()
|
911
|
f.close()
|
|
|
|
|
|
|
921
|
# Authors :: List of authors
|
921
|
# Authors :: List of authors
|
|
922
|
f.write(html_header(2, 'List of Authors'))
|
922
|
f.write(html_header(2, 'List of Authors'))
|
|
923
|
|
923
|
|
|
924
|
- f.write('<table class="authors sortable" id="authors">')
|
|
|
|
|
|
924
|
+ f.write('<div><div class="card-body"><table class="authors sortable" id="authors">')
|
|
925
|
f.write('<tr><th>Author</th><th>Commits (%)</th><th>+ lines</th><th>- lines</th><th>First commit</th><th>Last commit</th><th class="unsortable">Age</th><th>Active days</th><th># by commits</th></tr>')
|
925
|
f.write('<tr><th>Author</th><th>Commits (%)</th><th>+ lines</th><th>- lines</th><th>First commit</th><th>Last commit</th><th class="unsortable">Age</th><th>Active days</th><th># by commits</th></tr>')
|
|
926
|
for author in data.getAuthors(conf['max_authors']):
|
926
|
for author in data.getAuthors(conf['max_authors']):
|
|
927
|
info = data.getAuthorInfo(author)
|
927
|
info = data.getAuthorInfo(author)
|
|
928
|
f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%d</td></tr>' % (author, info['commits'], info['commits_frac'], info['lines_added'], info['lines_removed'], info['date_first'], info['date_last'], info['timedelta'], len(info['active_days']), info['place_by_commits']))
|
928
|
f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%d</td></tr>' % (author, info['commits'], info['commits_frac'], info['lines_added'], info['lines_removed'], info['date_first'], info['date_last'], info['timedelta'], len(info['active_days']), info['place_by_commits']))
|
|
929
|
- f.write('</table>')
|
|
|
|
|
|
929
|
+ f.write('</table></div>')
|
|
930
|
|
930
|
|
|
931
|
allauthors = data.getAuthors()
|
931
|
allauthors = data.getAuthors()
|
|
932
|
if len(allauthors) > conf['max_authors']:
|
932
|
if len(allauthors) > conf['max_authors']:
|
|
|
|
|
|
|
977
|
|
977
|
|
|
978
|
# Authors :: Author of Month
|
978
|
# Authors :: Author of Month
|
|
979
|
f.write(html_header(2, 'Author of Month'))
|
979
|
f.write(html_header(2, 'Author of Month'))
|
|
980
|
- f.write('<table class="sortable" id="aom">')
|
|
|
|
|
|
980
|
+ f.write('<div><div class="card-body"><table class="sortable" id="aom">')
|
|
981
|
f.write('<tr><th>Month</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
|
981
|
f.write('<tr><th>Month</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
|
|
982
|
for yymm in reversed(sorted(data.author_of_month.keys())):
|
982
|
for yymm in reversed(sorted(data.author_of_month.keys())):
|
|
983
|
authordict = data.author_of_month[yymm]
|
983
|
authordict = data.author_of_month[yymm]
|
|
|
|
|
|
|
987
|
next = ', '.join(authors[1:conf['authors_top']+1])
|
987
|
next = ', '.join(authors[1:conf['authors_top']+1])
|
|
988
|
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td><td>%d</td></tr>' % (yymm, authors[0], commits, (100.0 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm], next, len(authors)))
|
988
|
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td><td>%d</td></tr>' % (yymm, authors[0], commits, (100.0 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm], next, len(authors)))
|
|
989
|
|
989
|
|
|
990
|
- f.write('</table>')
|
|
|
|
|
|
990
|
+ f.write('</table></div>')
|
|
991
|
|
991
|
|
|
992
|
f.write(html_header(2, 'Author of Year'))
|
992
|
f.write(html_header(2, 'Author of Year'))
|
|
993
|
- f.write('<table class="sortable" id="aoy"><tr><th>Year</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
|
|
|
|
|
|
993
|
+ f.write('<div><div class="card-body"><table class="sortable" id="aoy"><tr><th>Year</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th><th>Number of authors</th></tr>' % conf['authors_top'])
|
|
994
|
for yy in reversed(sorted(data.author_of_year.keys())):
|
994
|
for yy in reversed(sorted(data.author_of_year.keys())):
|
|
995
|
authordict = data.author_of_year[yy]
|
995
|
authordict = data.author_of_year[yy]
|
|
996
|
authors = getkeyssortedbyvalues(authordict)
|
996
|
authors = getkeyssortedbyvalues(authordict)
|
|
|
|
|
|
|
998
|
commits = data.author_of_year[yy][authors[0]]
|
998
|
commits = data.author_of_year[yy][authors[0]]
|
|
999
|
next = ', '.join(authors[1:conf['authors_top']+1])
|
999
|
next = ', '.join(authors[1:conf['authors_top']+1])
|
|
1000
|
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td><td>%d</td></tr>' % (yy, authors[0], commits, (100.0 * commits) / data.commits_by_year[yy], data.commits_by_year[yy], next, len(authors)))
|
1000
|
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td><td>%d</td></tr>' % (yy, authors[0], commits, (100.0 * commits) / data.commits_by_year[yy], data.commits_by_year[yy], next, len(authors)))
|
|
1001
|
- f.write('</table>')
|
|
|
|
|
|
1001
|
+ f.write('</table></div>')
|
|
1002
|
|
1002
|
|
|
1003
|
# Domains
|
1003
|
# Domains
|
|
1004
|
f.write(html_header(2, 'Commits by Domains'))
|
1004
|
f.write(html_header(2, 'Commits by Domains'))
|
|
|
|
|
|
|
1060
|
|
1060
|
|
|
1061
|
# Files :: Extensions
|
1061
|
# Files :: Extensions
|
|
1062
|
f.write(html_header(2, 'Extensions'))
|
1062
|
f.write(html_header(2, 'Extensions'))
|
|
1063
|
- f.write('<table class="sortable" id="ext"><tr><th>Extension</th><th>Files (%)</th><th>Lines (%)</th><th>Lines/file</th></tr>')
|
|
|
|
|
|
1063
|
+ f.write('<div><div class="card-body"><table class="sortable" id="ext"><tr><th>Extension</th><th>Files (%)</th><th>Lines (%)</th><th>Lines/file</th></tr>')
|
|
1064
|
for ext in sorted(data.extensions.keys()):
|
1064
|
for ext in sorted(data.extensions.keys()):
|
|
1065
|
files = data.extensions[ext]['files']
|
1065
|
files = data.extensions[ext]['files']
|
|
1066
|
lines = data.extensions[ext]['lines']
|
1066
|
lines = data.extensions[ext]['lines']
|
|
|
|
|
|
|
1069
|
except ZeroDivisionError:
|
1069
|
except ZeroDivisionError:
|
|
1070
|
loc_percentage = 0
|
1070
|
loc_percentage = 0
|
|
1071
|
f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d (%.2f%%)</td><td>%d</td></tr>' % (ext, files, (100.0 * files) / data.getTotalFiles(), lines, loc_percentage, lines / files))
|
1071
|
f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d (%.2f%%)</td><td>%d</td></tr>' % (ext, files, (100.0 * files) / data.getTotalFiles(), lines, loc_percentage, lines / files))
|
|
1072
|
- f.write('</table>')
|
|
|
|
|
|
1072
|
+ f.write('</table></div>')
|
|
1073
|
|
1073
|
|
|
1074
|
f.write('</body></html>')
|
1074
|
f.write('</body></html>')
|
|
1075
|
f.close()
|
1075
|
f.close()
|
|
|
|
|
|
|
1109
|
f.write('<dt>Average commits per tag</dt><dd>%.2f</dd>' % (1.0 * data.getTotalCommits() / len(data.tags)))
|
1109
|
f.write('<dt>Average commits per tag</dt><dd>%.2f</dd>' % (1.0 * data.getTotalCommits() / len(data.tags)))
|
|
1110
|
f.write('</dl>')
|
1110
|
f.write('</dl>')
|
|
1111
|
|
1111
|
|
|
1112
|
- f.write('<table class="tags">')
|
|
|
|
|
|
1112
|
+ f.write('<div><div class="card-body"><table class="tags">')
|
|
1113
|
f.write('<tr><th>Name</th><th>Date</th><th>Commits</th><th>Authors</th></tr>')
|
1113
|
f.write('<tr><th>Name</th><th>Date</th><th>Commits</th><th>Authors</th></tr>')
|
|
1114
|
# sort the tags by date desc
|
1114
|
# sort the tags by date desc
|
|
1115
|
tags_sorted_by_date_desc = map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items()))))
|
1115
|
tags_sorted_by_date_desc = map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items()))))
|
|
|
|
|
|
|
1119
|
for i in reversed(self.authors_by_commits):
|
1119
|
for i in reversed(self.authors_by_commits):
|
|
1120
|
authorinfo.append('%s (%d)' % (i, data.tags[tag]['authors'][i]))
|
1120
|
authorinfo.append('%s (%d)' % (i, data.tags[tag]['authors'][i]))
|
|
1121
|
f.write('<tr><td>%s</td><td>%s</td><td>%d</td><td>%s</td></tr>' % (tag, data.tags[tag]['date'], data.tags[tag]['commits'], ', '.join(authorinfo)))
|
1121
|
f.write('<tr><td>%s</td><td>%s</td><td>%d</td><td>%s</td></tr>' % (tag, data.tags[tag]['date'], data.tags[tag]['commits'], ', '.join(authorinfo)))
|
|
1122
|
- f.write('</table>')
|
|
|
|
|
|
1122
|
+ f.write('</table></div>')
|
|
1123
|
|
1123
|
|
|
1124
|
f.write('</body></html>')
|
1124
|
f.write('</body></html>')
|
|
1125
|
f.close()
|
1125
|
f.close()
|
|
|
|
|
|
|
1338
|
|
1338
|
|
|
1339
|
def printNav(self, f):
|
1339
|
def printNav(self, f):
|
|
1340
|
f.write("""
|
1340
|
f.write("""
|
|
1341
|
-<div class="nav">
|
|
|
|
1342
|
-<ul>
|
|
|
|
1343
|
-<li><a href="index.html">General</a></li>
|
|
|
|
1344
|
-<li><a href="activity.html">Activity</a></li>
|
|
|
|
1345
|
-<li><a href="authors.html">Authors</a></li>
|
|
|
|
1346
|
-<li><a href="files.html">Files</a></li>
|
|
|
|
1347
|
-<li><a href="lines.html">Lines</a></li>
|
|
|
|
1348
|
-<li><a href="tags.html">Tags</a></li>
|
|
|
|
1349
|
-</ul>
|
|
|
|
1350
|
-</div>
|
|
|
|
|
|
1341
|
+<nav aria-label="breadcrumb">
|
|
|
|
1342
|
+<ol class="breadcrumb">
|
|
|
|
1343
|
+ <li class="breadcrumb-item" aria-current="page"><a href="index.html">General</a></li>
|
|
|
|
1344
|
+ <li class="breadcrumb-item" aria-current="page"><a href="activity.html">Activity</a></li>
|
|
|
|
1345
|
+ <li class="breadcrumb-item" aria-current="page"><a href="authors.html">Authors</a></li>
|
|
|
|
1346
|
+ <li class="breadcrumb-item" aria-current="page"><a href="files.html">Files</a></li>
|
|
|
|
1347
|
+ <li class="breadcrumb-item" aria-current="page"><a href="lines.html">Lines</a></li>
|
|
|
|
1348
|
+ <li class="breadcrumb-item" aria-current="page"><a href="tags.html">Tags</a></li>
|
|
|
|
1349
|
+</ol>
|
|
|
|
1350
|
+</nav>
|
|
1351
|
""")
|
1351
|
""")
|
|
1352
|
|
1352
|
|
|
1353
|
|
1353
|
|