-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
419 lines (407 loc) · 22.3 KB
/
Copy pathindex.html
File metadata and controls
419 lines (407 loc) · 22.3 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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Git-Analytics</title>
<meta name="description" content="Advanced analytics for Git repositories — commits, authors, code churn, lines of code, trends, and visual dashboards.">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<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">
<script src="js/bootstrap.bundle.min.js" defer></script>
<script src="js/chart.umd.min.js" defer></script>
<script src="js/git-analytics.js" defer></script>
</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 class="d-flex align-items-center gap-2">
<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>
<button id="scanBtn" class="btn btn-success d-none" onclick="scanRepository()">
<i class="bi bi-arrow-repeat" id="scanIcon"></i> Scan
</button>
<button id="openFolderBtn" class="btn btn-outline-light d-none"
title="" onclick="openDbFolder()" style="font-size:0.8rem;">
<i class="bi bi-folder2-open"></i>
<span id="dbFolderLabel" class="ms-1"></span>
</button>
</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">
<!-- first-run banner, shown when DB has no data -->
<div id="noDataBanner" class="d-none mb-4">
<div class="card border-warning">
<div class="card-body text-center py-5">
<i class="bi bi-database-x display-4 text-warning mb-3 d-block"></i>
<h4>No data yet</h4>
<p class="text-muted mb-4">Scan your repository to populate the database and view analytics.</p>
<button class="btn btn-success btn-lg" onclick="scanRepository()">
<i class="bi bi-arrow-repeat"></i> Scan repository
</button>
</div>
</div>
</div>
<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 class="col-md-2">
<div class="card h-100 w-100">
<div class="card-header">
<span>Bus Factor</span>
<i class="bi bi-info-circle"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="The bus factor is a measurement of the risk resulting from information and capabilities not being shared among team members. It indicates the minimum number of developers that have to leave a project before the project becomes incapacitated.">
</i>
</div>
<div class="card-body">
<span id="busFactor"></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="chartCommitsByHour"></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="chartCommitsByWeekday"></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="chartCommitsByDayOfMonth"></canvas>
</div>
</div>
</div>
</div>
</section>
</div>
</main>
</div>
<!-- footer -->
<footer class="bg-dark text-white py-3 mt-auto">
<div class="container">
<span>© 2026 ver 0.1.14</span>
</div>
</footer>
<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>
<!-- Scanning Modal -->
<div class="modal" id="scanningModal" 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-success mb-3" role="status"></div>
<p class="mb-0"><strong>Scanning repository. This may take a moment...</strong></p>
</div>
</div>
</div>
</div>
</body>
</html>