-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
362 lines (356 loc) · 19 KB
/
index.html
File metadata and controls
362 lines (356 loc) · 19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Git Analytics</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-icons.min.css" rel="stylesheet">
</head>
<body class="d-flex flex-column min-vh-100">
<!-- top menu -->
<header class="bg-dark text-white py-3 sticky-top">
<div class="container-fluid d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center">
<img src="favicon.svg" alt="Logo" width="32" height="32" class="me-2">
<h1 class="h4 mb-0">Git-Analytics</h1>
</div>
<div>
<a href="https://git-analytics.com" target="_blank" class="btn btn-outline-light">
<i class="bi bi-link-45deg"></i> Site
</a>
<a href="https://github.com/n0rfas/git-analytics" target="_blank" class="btn btn-outline-light">
<i class="bi bi-github"></i> GitHub
</a>
</div>
<div class="d-flex align-items-center gap-2">
<div class="dropdown">
<button class="btn btn-warning dropdown-toggle" type="button"
id="rangeDropdownBtn" data-bs-toggle="dropdown" aria-expanded="false">
Last month
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="rangeDropdownBtn" id="rangeMenu">
<li><a class="dropdown-item" href="#" data-type="days" data-value="7">Last week</a></li>
<li><a class="dropdown-item" href="#" data-type="days" data-value="14">Last 2 weeks</a></li>
<li><a class="dropdown-item" href="#" data-type="months" data-value="1">Last month</a></li>
<li><a class="dropdown-item" href="#" data-type="months" data-value="3">Last 3 months</a></li>
<li><a class="dropdown-item" href="#" data-type="months" data-value="6">Last 6 months</a></li>
<li><a class="dropdown-item" href="#" data-type="months" data-value="12">Last year</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#" data-type="all" data-value="all">All the time</a></li>
</ul>
</div>
</div>
</div>
</header>
<div class="d-flex flex-grow-1">
<!-- sidebar -->
<aside class="sidebar bg-light border-end p-3">
<ul class="nav flex-column" id="sidebarNav">
<li class="nav-item"><a class="nav-link active" data-view="overview" href="#overview">Overview</a></li>
<li class="nav-item"><a class="nav-link" data-view="authors" href="#authors">Authors</a></li>
<li class="nav-item"><a class="nav-link" data-view="loc" href="#loc">Lines of code</a></li>
<li class="nav-item"><a class="nav-link" data-view="commits" href="#commits">Commits</a></li>
</ul>
</aside>
<!-- content -->
<main class="flex-grow-1 p-3">
<div class="container">
<section class="view" data-view="overview">
<div class="row">
<div class="col-md-12 mb-3">
<h2>Overview</h2>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="card h-100 w-100">
<div class="card-header">
<span>General statistics</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="Summary of repository activity for the selected time range.">
</i>
</div>
<div class="card-body">
<span id="generalStatistics"></span>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Weekly commit types</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="This chart shows the number of commits per week, grouped by type (feature, fix, docs, style, refactor, test, chore, wip, merge). A single commit can belong to one or multiple types.">
</i>
</div>
<div class="card-body">
<canvas id="weeklyCommitTypes"></canvas>
</div>
</div>
</div>
</div>
</section>
<section class="view d-none" data-view="authors">
<div class="row">
<div class="col-md-12 mb-3">
<h2>Authors</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Lines insertions & deletions per author</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="This chart shows the number of lines each author has added (insertions) and removed (deletions) during the selected time interval.">
</i>
</div>
<div class="card-body">
<canvas id="chartInsDelLinesByAuthors"></canvas>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-6">
<div class="card h-100 w-100">
<div class="card-header">
<span>Code churn by author</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="This chart shows code churn: the sum of all insertions and deletions made by each author during the chosen period.">
</i>
</div>
<div class="card-body">
<canvas id="chartCodeChurnByAuthor"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card h-100 w-100">
<div class="card-header">
<span>Commit totals by author</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="Displays how many commits each author contributed in the selected interval.">
</i>
</div>
<div class="card-body">
<canvas id="chartCommitsByAuthor"></canvas>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>More by authors</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="More information on each author separately.">
</i>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div class="accordion" id="accordionAuthors"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Author contributions</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="This table shows each author’s contribution: number of commits, lines inserted, and lines deleted over the selected time range.">
</i>
</div>
<div class="card-body">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Author</th>
<th scope="col">Commits</th>
<th scope="col">Insertions</th>
<th scope="col">Deletions</th>
</tr>
</thead>
<tbody id="authorsContributionsTable">
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<section class="view d-none" data-view="loc">
<div class="row">
<div class="col-md-12 mb-3">
<h2>Lines of Code</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Lines insertions & deletions by file extension</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="Shows the total number of lines added (insertions) and removed (deletions) for each file extension within the selected time interval. This helps to understand which file types experienced the most code changes.">
</i>
</div>
<div class="card-body">
<canvas id="chartExtensions"></canvas>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Lines of code over time</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="Shows how the number of lines of code changed over the selected time interval. This is not the total lines of code! To see the overall size of the codebase, select the ‘All the time’ range.">
</i>
</div>
<div class="card-body">
<canvas id="chartLinesOfCode"></canvas>
</div>
</div>
</div>
</div>
</section>
<section class="view d-none" data-view="commits">
<div class="row">
<div class="col-md-12 mb-3">
<h2>Commits</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Commits by hour of day per author</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="Shows the distribution of commits across the hours of the day, broken down by author. Includes all commits within the selected time interval.">
</i>
</div>
<div class="card-body">
<canvas id="chartDay"></canvas>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Commit by day of week per author</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="Shows commits by day of the week, broken down by author. Includes all commits within the selected time interval.">
</i>
</div>
<div class="card-body">
<canvas id="chartWeek"></canvas>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card h-100 w-100">
<div class="card-header">
<span>Commit by day of month per author</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="This chart shows how commits are distributed across the days of the month for each author, within the selected time interval. Includes all commits within the selected time interval.">
</i>
</div>
<div class="card-body">
<canvas id="chartMonth"></canvas>
</div>
</div>
</div>
</div>
</section>
</div>
</main>
</div>
<!-- footer -->
<footer class="bg-dark text-white py-3 mt-auto">
<div class="container">
<span>© 2025 ver 0.1.13</span>
</div>
</footer>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/chart.umd.min.js"></script>
<script src="js/git-analytics.js"></script>
<script>
const views = document.querySelectorAll('.view');
const nav = document.getElementById('sidebarNav');
function showView(name) {
nav.querySelectorAll('.nav-link').forEach(a => {
a.classList.toggle('active', a.dataset.view === name);
});
views.forEach(v => v.classList.toggle('d-none', v.dataset.view !== name));
if (!initedViews.has(name)) {
initViewCharts(name);
initedViews.add(name);
}
}
nav.addEventListener('click', (e) => {
const a = e.target.closest('.nav-link');
if (!a) return;
showView(a.dataset.view);
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.forEach(function (tooltipTriggerEl) {
new bootstrap.Tooltip(tooltipTriggerEl);
});
});
</script>
<!-- Loading Modal -->
<div class="modal" id="loadingModal" tabindex="-1" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content text-center">
<div class="modal-body">
<div class="spinner-border text-primary mb-3" role="status"></div>
<p class="mb-0"><strong>Analyzing repository. Please wait...</strong></p>
</div>
</div>
</div>
</div>
</body>
</html>