metripy 0.2.7__py3-none-any.whl → 0.3.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of metripy might be problematic. Click here for more details.

Files changed (67) hide show
  1. metripy/Application/Analyzer.py +23 -3
  2. metripy/Application/Application.py +16 -2
  3. metripy/Application/Config/Config.py +34 -0
  4. metripy/Application/Config/File/ConfigFileReaderFactory.py +6 -5
  5. metripy/Application/Config/File/ConfigFileReaderInterface.py +70 -3
  6. metripy/Application/Config/File/JsonConfigFileReader.py +5 -70
  7. metripy/Application/Config/File/YamlConfigFileReader.py +17 -0
  8. metripy/Application/Config/Parser.py +24 -11
  9. metripy/Application/Config/ProjectConfig.py +64 -0
  10. metripy/Application/Info.py +61 -0
  11. metripy/Dependency/Dependency.py +17 -1
  12. metripy/Dependency/Pip/Pip.py +21 -31
  13. metripy/Dependency/Pip/PyPi.py +1 -0
  14. metripy/Git/GitAnalyzer.py +0 -3
  15. metripy/Import/Json/JsonImporter.py +17 -0
  16. metripy/LangAnalyzer/AbstractLangAnalyzer.py +4 -3
  17. metripy/LangAnalyzer/Php/PhpAnalyzer.py +2 -1
  18. metripy/LangAnalyzer/Python/PythonAnalyzer.py +31 -9
  19. metripy/LangAnalyzer/Python/PythonHalSteadAnalyzer.py +55 -0
  20. metripy/LangAnalyzer/Typescript/TypescriptAnalyzer.py +12 -9
  21. metripy/LangAnalyzer/Typescript/TypescriptAstParser.py +1 -1
  22. metripy/Metric/Code/AggregatedMetrics.py +12 -5
  23. metripy/Metric/Code/FileMetrics.py +32 -1
  24. metripy/Metric/Code/ModuleMetrics.py +5 -5
  25. metripy/Metric/Code/SegmentedMetrics.py +72 -36
  26. metripy/Metric/Code/Segmentor.py +44 -0
  27. metripy/Metric/FileTree/FileTreeParser.py +0 -4
  28. metripy/Metric/Git/GitMetrics.py +1 -1
  29. metripy/Metric/ProjectMetrics.py +29 -0
  30. metripy/Metric/Trend/AggregatedTrendMetric.py +101 -0
  31. metripy/Metric/Trend/ClassTrendMetric.py +20 -0
  32. metripy/Metric/Trend/FileTrendMetric.py +46 -0
  33. metripy/Metric/Trend/FunctionTrendMetric.py +28 -0
  34. metripy/Metric/Trend/SegmentedTrendMetric.py +29 -0
  35. metripy/Report/Html/DependencyPageRenderer.py +21 -0
  36. metripy/Report/Html/FilesPageRenderer.py +28 -0
  37. metripy/Report/Html/GitAnalysisPageRenderer.py +55 -0
  38. metripy/Report/Html/IndexPageRenderer.py +47 -0
  39. metripy/Report/Html/PageRenderer.py +43 -0
  40. metripy/Report/Html/PageRendererFactory.py +37 -0
  41. metripy/Report/Html/Reporter.py +78 -137
  42. metripy/Report/Html/TopOffendersPageRenderer.py +84 -0
  43. metripy/Report/Html/TrendsPageRenderer.py +137 -0
  44. metripy/Report/Json/GitJsonReporter.py +3 -0
  45. metripy/Report/Json/JsonReporter.py +6 -2
  46. metripy/Report/ReporterFactory.py +6 -3
  47. metripy/Tree/ClassNode.py +21 -0
  48. metripy/Tree/FunctionNode.py +66 -1
  49. metripy/Trend/TrendAnalyzer.py +150 -0
  50. metripy/templates/html_report/css/styles.css +1386 -0
  51. metripy/templates/html_report/dependencies.html +411 -0
  52. metripy/templates/html_report/files.html +1080 -0
  53. metripy/templates/html_report/git_analysis.html +325 -0
  54. metripy/templates/html_report/images/logo.svg +31 -0
  55. metripy/templates/html_report/index.html +374 -0
  56. metripy/templates/html_report/js/charts.js +313 -0
  57. metripy/templates/html_report/js/dashboard.js +546 -0
  58. metripy/templates/html_report/js/git_analysis.js +383 -0
  59. metripy/templates/html_report/top_offenders.html +267 -0
  60. metripy/templates/html_report/trends.html +468 -0
  61. {metripy-0.2.7.dist-info → metripy-0.3.6.dist-info}/METADATA +27 -9
  62. metripy-0.3.6.dist-info/RECORD +96 -0
  63. {metripy-0.2.7.dist-info → metripy-0.3.6.dist-info}/licenses/LICENSE +1 -1
  64. metripy-0.2.7.dist-info/RECORD +0 -66
  65. {metripy-0.2.7.dist-info → metripy-0.3.6.dist-info}/WHEEL +0 -0
  66. {metripy-0.2.7.dist-info → metripy-0.3.6.dist-info}/entry_points.txt +0 -0
  67. {metripy-0.2.7.dist-info → metripy-0.3.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,325 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Git Analysis - Code Metrics Dashboard</title>
7
+ <link rel="stylesheet" href="css/styles.css">
8
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ </head>
11
+ <body>
12
+ <div class="dashboard">
13
+ <!-- Sidebar -->
14
+ <aside class="sidebar">
15
+ <div class="sidebar-header">
16
+ <div class="logo">
17
+ <img src="images/logo.svg" alt="Metripy Logo" class="logo-icon">
18
+ <h2>Metripy</h2>
19
+ </div>
20
+ </div>
21
+
22
+ <nav class="sidebar-nav">
23
+ <ul>
24
+ <li class="nav-item">
25
+ <a href="index.html" class="nav-link">
26
+ <i class="fas fa-tachometer-alt"></i>
27
+ <span>Overview</span>
28
+ </a>
29
+ </li>
30
+ <li class="nav-item">
31
+ <a href="files.html" class="nav-link">
32
+ <i class="fas fa-file-code"></i>
33
+ <span>Files</span>
34
+ </a>
35
+ </li>
36
+ <li class="nav-item">
37
+ <a href="top_offenders.html" class="nav-link">
38
+ <i class="fa-solid fa-stethoscope"></i>
39
+ <span>Top Offenders</span>
40
+ </a>
41
+ </li>
42
+ <li class="nav-item active">
43
+ <a href="git_analysis.html" class="nav-link">
44
+ <i class="fab fa-git-alt"></i>
45
+ <span>Git Analysis</span>
46
+ </a>
47
+ </li>
48
+ <li class="nav-item">
49
+ <a href="dependencies.html" class="nav-link">
50
+ <i class="fas fa-cubes"></i>
51
+ <span>Dependencies</span>
52
+ </a>
53
+ </li>
54
+ <li class="nav-item">
55
+ <a href="trends.html" class="nav-link">
56
+ <i class="fas fa-chart-line"></i>
57
+ <span>Trends</span>
58
+ </a>
59
+ </li>
60
+ </ul>
61
+ </nav>
62
+
63
+ <div class="sidebar-footer">
64
+ <div class="project-info">
65
+ <h4>Project: {{project_name}}</h4>
66
+ <p>Last updated: {{last_updated}}</p>
67
+ </div>
68
+ </div>
69
+ </aside>
70
+
71
+ <!-- Main Content -->
72
+ <main class="main-content">
73
+ <header class="page-header">
74
+ <div class="header-content">
75
+ <h1>Git Analysis</h1>
76
+ <p class="subtitle">Repository insights, code hotspots, and team collaboration patterns</p>
77
+ </div>
78
+ </header>
79
+
80
+ {{#IF has_git_analysis_data}}
81
+
82
+ <!-- Git Metrics Cards Row -->
83
+ <section class="git-metrics-grid">
84
+ <div class="metric-card">
85
+ <div class="metric-header">
86
+ <div class="metric-icon" style="background: linear-gradient(135deg, #10b981, #059669);">
87
+ <i class="fas fa-code-commit"></i>
88
+ </div>
89
+ <div class="metric-title">
90
+ <h3>Total Commits</h3>
91
+ <p>Last 12 months</p>
92
+ </div>
93
+ </div>
94
+ <div class="metric-value">
95
+ <span class="value">{{git_analysis.total_commits}}</span>
96
+ <span class="unit">commits</span>
97
+ </div>
98
+ <div class="metric-description">
99
+ <p>Total commits made since {{git_analysis.analysis_start_date}}</p>
100
+ </div>
101
+ </div>
102
+
103
+ <div class="metric-card">
104
+ <div class="metric-header">
105
+ <div class="metric-icon" style="background: linear-gradient(135deg, #3b82f6, #2563eb);">
106
+ <i class="fas fa-users"></i>
107
+ </div>
108
+ <div class="metric-title">
109
+ <h3>Active Contributors</h3>
110
+ <p>Since {{git_analysis.analysis_start_date}}</p>
111
+ </div>
112
+ </div>
113
+ <div class="metric-value">
114
+ <span class="value">{{git_analysis.active_contributors}}</span>
115
+ <span class="unit">developers</span>
116
+ </div>
117
+ <div class="metric-description">
118
+ <p>{{git_analysis.core_contributors}} core developers make up {{git_analysis.core_percentage}}% of all commits</p>
119
+ </div>
120
+ </div>
121
+
122
+ <div class="metric-card">
123
+ <div class="metric-header">
124
+ <div class="metric-icon" style="background: linear-gradient(135deg, #8b5cf6, #7c3aed);">
125
+ <i class="fas fa-balance-scale"></i>
126
+ </div>
127
+ <div class="metric-title">
128
+ <h3>Avg. Commit Size</h3>
129
+ <p>Lines changed per commit</p>
130
+ </div>
131
+ </div>
132
+ <div class="metric-value">
133
+ <span class="value">{{git_analysis.avg_commit_size}}</span>
134
+ <span class="unit">lines</span>
135
+ </div>
136
+ <div class="metric-description">
137
+ <p>Average number of lines changed per commit</p>
138
+ </div>
139
+ </div>
140
+ </section>
141
+
142
+ <!-- Charts Section -->
143
+ <section class="two-column-section">
144
+ <div class="chart-container">
145
+ <div class="chart-header">
146
+ <h3>Commit Activity Timeline</h3>
147
+ <p>Monthly commits over time</p>
148
+ </div>
149
+ <div class="chart-content">
150
+ <canvas id="gitCommitsChart"></canvas>
151
+ </div>
152
+ </div>
153
+
154
+ <div class="chart-container">
155
+ <div class="chart-header">
156
+ <h3>Code Churn Analysis</h3>
157
+ <p>Lines added vs removed over time</p>
158
+ </div>
159
+ <div class="chart-content">
160
+ <canvas id="gitChurnChart"></canvas>
161
+ </div>
162
+ </div>
163
+ </section>
164
+
165
+ <div class="section-divider"></div>
166
+
167
+ <!-- Risk Analysis Section -->
168
+ <section class="two-column-section">
169
+ <div class="info-card">
170
+ <h4><i class="fas fa-exclamation-triangle text-warning"></i> Code Hotspots</h4>
171
+ <p style="color: var(--text-secondary); margin-bottom: var(--spacing-md);">
172
+ Files that change frequently often indicate quality issues or architectural problems.
173
+ </p>
174
+
175
+ <div class="table-container">
176
+ <table class="hotspot-table">
177
+ <thead>
178
+ <tr>
179
+ <th>File</th>
180
+ <th>Changes</th>
181
+ <th>Risk</th>
182
+ <th>Contributors</th>
183
+ </tr>
184
+ </thead>
185
+ <tbody id="hotspots-table-body">
186
+ {{#EACH git_hotspots_data AS hotspot}}
187
+ <tr>
188
+ <td><strong>{{hotspot.file_path}}</strong></td>
189
+ <td><span class="stat-highlight">{{hotspot.changes_count}}</span></td>
190
+ <td><span class="risk-badge risk-{{hotspot.risk_level}}">{{hotspot.risk_label}}</span></td>
191
+ <td>{{hotspot.contributors_count}}</td>
192
+ </tr>
193
+ {{/EACH}}
194
+ </tbody>
195
+ </table>
196
+ </div>
197
+ </div>
198
+
199
+ <div class="info-card">
200
+ <h4><i class="fas fa-shield-alt text-info"></i> Knowledge Silos</h4>
201
+ <p style="color: var(--text-secondary); margin-bottom: var(--spacing-md);">
202
+ Files touched by only one person create knowledge risks and bottlenecks.
203
+ </p>
204
+
205
+ <div class="table-container">
206
+ <table class="hotspot-table">
207
+ <thead>
208
+ <tr>
209
+ <th>File</th>
210
+ <th>Owner</th>
211
+ <th>Commits</th>
212
+ <th>Risk</th>
213
+ </tr>
214
+ </thead>
215
+ <tbody id="silos-table-body">
216
+ {{#EACH git_silos_data AS silo}}
217
+ <tr>
218
+ <td><strong>{{silo.file_path}}</strong></td>
219
+ <td>{{silo.owner}}</td>
220
+ <td><span class="stat-highlight">{{silo.commits_count}}</span></td>
221
+ <td><span class="risk-badge risk-{{silo.risk_level}}">{{silo.risk_label}}</span></td>
222
+ </tr>
223
+ {{/EACH}}
224
+ </tbody>
225
+ </table>
226
+ </div>
227
+ </div>
228
+ </section>
229
+
230
+ <div class="section-divider"></div>
231
+
232
+ <!-- Team Insights Section -->
233
+ <section class="two-column-section">
234
+ <div class="info-card">
235
+ <h4><i class="fas fa-trophy text-success"></i> Top Contributors</h4>
236
+ <p style="color: var(--text-secondary); margin-bottom: var(--spacing-md);">
237
+ Most active developers by commits and lines of code.
238
+ </p>
239
+
240
+ <div class="table-container">
241
+ <table class="contributor-table">
242
+ <thead>
243
+ <tr>
244
+ <th>Developer</th>
245
+ <th>Commits</th>
246
+ <th>Lines</th>
247
+ <th>Share</th>
248
+ </tr>
249
+ </thead>
250
+ <tbody id="contributors-table-body">
251
+ {{#EACH git_contributors AS contributor}}
252
+ <tr>
253
+ <td>
254
+ <div class="author-avatar">{{contributor.initials}}</div>
255
+ <strong>{{contributor.name}}</strong>
256
+ </td>
257
+ <td><span class="stat-highlight">{{contributor.commits_count}}</span></td>
258
+ <td>+{{contributor.lines_added}} / -{{contributor.lines_removed}}</td>
259
+ <td>
260
+ {{contributor.contribution_percentage}}%
261
+ <div class="progress-bar">
262
+ <div class="progress-fill" style="width: {{contributor.contribution_percentage}}%;"></div>
263
+ </div>
264
+ </td>
265
+ </tr>
266
+ {{/EACH}}
267
+ </tbody>
268
+ </table>
269
+ </div>
270
+ </div>
271
+
272
+ <div class="info-card">
273
+ <h4><i class="fas fa-clock text-primary"></i> Development Patterns - Not implemented</h4>
274
+ <p style="color: var(--text-secondary); margin-bottom: var(--spacing-lg);">
275
+ Key insights about development velocity and code quality patterns.
276
+ </p>
277
+
278
+ <div style="margin-bottom: var(--spacing-lg);">
279
+ <h5 style="color: var(--text-primary); margin-bottom: var(--spacing-sm);">📅 Most Active Days</h5>
280
+ <div id="active-days-content" style="margin-left: var(--spacing-md); color: var(--text-secondary);">
281
+ <!-- Active days will be populated by JavaScript -->
282
+ </div>
283
+ </div>
284
+
285
+ <div style="margin-bottom: var(--spacing-lg);">
286
+ <h5 style="color: var(--text-primary); margin-bottom: var(--spacing-sm);">⚡ Commit Quality</h5>
287
+ <div id="commit-quality-content" style="margin-left: var(--spacing-md); color: var(--text-secondary);">
288
+ <!-- Commit quality stats will be populated by JavaScript -->
289
+ </div>
290
+ </div>
291
+
292
+ <div>
293
+ <h5 style="color: var(--text-primary); margin-bottom: var(--spacing-sm);">🎯 Recommendations</h5>
294
+ <div id="recommendations-content" style="margin-left: var(--spacing-md); color: var(--text-secondary);">
295
+ <!-- Recommendations will be populated by JavaScript -->
296
+ </div>
297
+ </div>
298
+ </div>
299
+ </section>
300
+
301
+
302
+
303
+ <!-- No Git Analysis Data State -->
304
+ {{#ELSE}}
305
+ <div class="empty-state">
306
+ <i class="fas fa-chart-line"></i>
307
+ <h3>No Git Analysis Data Available</h3>
308
+ <p>Enable analysis of git history in your config file.</p>
309
+ </div>
310
+ {{/IF}}
311
+
312
+ </main>
313
+ </div>
314
+
315
+ <!-- Scripts -->
316
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
317
+ <script>
318
+ // Embed data directly from template engine
319
+ window.GIT_STATS_DATA = {{git_stats_data}};
320
+ window.GIT_CHURN_DATA = {{git_churn_data}};
321
+ window.GIT_ANALYSIS_DATA = {{git_analysis_json}};
322
+ </script>
323
+ <script src="js/git_analysis.js"></script>
324
+ </body>
325
+ </html>
@@ -0,0 +1,31 @@
1
+ <svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <linearGradient id="blueGradient" x1="0%" y1="0%" x2="0%" y2="100%">
4
+ <stop offset="0%" style="stop-color:#3b82f6;stop-opacity:1" />
5
+ <stop offset="100%" style="stop-color:#2563eb;stop-opacity:1" />
6
+ </linearGradient>
7
+ </defs>
8
+
9
+ <g fill="url(#blueGradient)">
10
+ <!-- Left angle bracket < -->
11
+ <path d="M 40 70 L 5 100 L 40 130"
12
+ stroke="url(#blueGradient)"
13
+ stroke-width="6"
14
+ stroke-linecap="round"
15
+ stroke-linejoin="round"
16
+ fill="none"/>
17
+
18
+ <!-- Right angle bracket > -->
19
+ <path d="M 160 70 L 195 100 L 160 130"
20
+ stroke="url(#blueGradient)"
21
+ stroke-width="6"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ fill="none"/>
25
+
26
+ <!-- Rising bar chart -->
27
+ <rect x="65" y="90" width="20" height="50" rx="2"/>
28
+ <rect x="92" y="80" width="20" height="60" rx="2"/>
29
+ <rect x="119" y="55" width="20" height="85" rx="2"/>
30
+ </g>
31
+ </svg>