File size: 22,040 Bytes
7d2399f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GitHub Repository Analyzer</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {
                    colors: {
                        dark: {
                            100: '#1e293b',
                            200: '#0f172a',
                            300: '#020617',
                        },
                        light: {
                            100: '#f8fafc',
                            200: '#e2e8f0',
                            300: '#cbd5e1',
                        }
                    }
                }
            }
        }
    </script>
    <style>
        .dark .gradient-bg {
            background: linear-gradient(to right, #0f172a, #1e293b);
        }
        .light .gradient-bg {
            background: linear-gradient(to right, #e2e8f0, #f8fafc);
        }
        .code-block {
            font-family: 'Courier New', monospace;
            border-radius: 0.5rem;
            overflow-x: auto;
        }
        .chart-container {
            height: 400px;
            width: 100%;
        }
        .issue-tag {
            display: inline-flex;
            align-items: center;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.875rem;
            font-weight: 600;
        }
        .transition-all {
            transition: all 0.3s ease;
        }
    </style>
</head>
<body class="bg-light-100 text-gray-800 dark:bg-dark-200 dark:text-gray-200 transition-all">
    <div class="min-h-screen flex flex-col">
        <!-- Header -->
        <header class="gradient-bg shadow-lg">
            <div class="container mx-auto px-4 py-6">
                <div class="flex justify-between items-center">
                    <div class="flex items-center space-x-2">
                        <i class="fab fa-github text-3xl"></i>
                        <h1 class="text-2xl font-bold">GitHub Repository Analyzer</h1>
                    </div>
                    <div class="flex items-center space-x-4">
                        <button id="themeToggle" class="p-2 rounded-full bg-white dark:bg-dark-100 shadow">
                            <i class="fas fa-moon dark:hidden"></i>
                            <i class="fas fa-sun hidden dark:block"></i>
                        </button>
                    </div>
                </div>
            </div>
        </header>

        <!-- Main Content -->
        <main class="flex-grow container mx-auto px-4 py-8">
            <!-- Repository Input Section -->
            <section class="mb-12">
                <div class="bg-white dark:bg-dark-100 rounded-xl shadow-md p-6">
                    <h2 class="text-xl font-semibold mb-4">Analyze a Repository</h2>
                    <div class="flex flex-col md:flex-row gap-4">
                        <input 
                            type="text" 
                            placeholder="https://github.com/username/repository" 
                            class="flex-grow px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-dark-200 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        >
                        <button class="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors">
                            Analyze
                        </button>
                    </div>
                    
                    <div class="mt-6 grid grid-cols-1 md:grid-cols-3 gap-4">
                        <!-- Analysis Level -->
                        <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                            <h3 class="font-medium mb-2">Analysis Level</h3>
                            <div class="space-y-2">
                                <label class="flex items-center space-x-2">
                                    <input type="radio" name="analysisLevel" checked class="text-blue-600">
                                    <span>Basic</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="radio" name="analysisLevel" class="text-blue-600">
                                    <span>Standard</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="radio" name="analysisLevel" class="text-blue-600">
                                    <span>Deep</span>
                                </label>
                            </div>
                        </div>
                        
                        <!-- File Types -->
                        <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                            <h3 class="font-medium mb-2">File Types</h3>
                            <div class="space-y-2">
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" checked class="text-blue-600">
                                    <span>.js</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" checked class="text-blue-600">
                                    <span>.py</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" checked class="text-blue-600">
                                    <span>.java</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" class="text-blue-600">
                                    <span>All files</span>
                                </label>
                            </div>
                        </div>
                        
                        <!-- Additional Options -->
                        <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                            <h3 class="font-medium mb-2">Additional Options</h3>
                            <div class="space-y-2">
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" class="text-blue-600">
                                    <span>Include commit history</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" checked class="text-blue-600">
                                    <span>Show improvement suggestions</span>
                                </label>
                                <label class="flex items-center space-x-2">
                                    <input type="checkbox" class="text-blue-600">
                                    <span>Compare with similar projects</span>
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

            <!-- Analysis Results (Sample) -->
            <section class="mb-12">
                <div class="bg-white dark:bg-dark-100 rounded-xl shadow-md p-6">
                    <h2 class="text-xl font-semibold mb-6">Analysis Results</h2>
                    
                    <!-- Summary Cards -->
                    <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-8">
                        <div class="bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg">
                            <div class="text-blue-600 dark:text-blue-400 font-medium">Files Analyzed</div>
                            <div class="text-2xl font-bold">142</div>
                        </div>
                        <div class="bg-green-50 dark:bg-green-900/20 p-4 rounded-lg">
                            <div class="text-green-600 dark:text-green-400 font-medium">Issues Found</div>
                            <div class="text-2xl font-bold">23</div>
                        </div>
                        <div class="bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg">
                            <div class="text-yellow-600 dark:text-yellow-400 font-medium">Code Quality</div>
                            <div class="text-2xl font-bold">78%</div>
                        </div>
                        <div class="bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg">
                            <div class="text-purple-600 dark:text-purple-400 font-medium">Complexity</div>
                            <div class="text-2xl font-bold">Medium</div>
                        </div>
                    </div>
                    
                    <!-- Charts -->
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
                        <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                            <h3 class="font-medium mb-4">Issue Types Distribution</h3>
                            <div class="chart-container">
                                <!-- Placeholder for chart -->
                                <div class="flex items-center justify-center h-full bg-gray-100 dark:bg-gray-800 rounded">
                                    <span class="text-gray-500">Chart will appear here</span>
                                </div>
                            </div>
                        </div>
                        <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                            <h3 class="font-medium mb-4">Code Quality Over Time</h3>
                            <div class="chart-container">
                                <!-- Placeholder for chart -->
                                <div class="flex items-center justify-center h-full bg-gray-100 dark:bg-gray-800 rounded">
                                    <span class="text-gray-500">Chart will appear here</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Issues List -->
                    <div class="mb-8">
                        <h3 class="text-lg font-semibold mb-4">Detected Issues</h3>
                        <div class="space-y-4">
                            <!-- Issue 1 -->
                            <div class="border-l-4 border-red-500 pl-4 py-2 bg-red-50/50 dark:bg-red-900/10 rounded-r">
                                <div class="flex justify-between items-start">
                                    <div>
                                        <span class="issue-tag bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300 mr-2">
                                            <i class="fas fa-exclamation-circle mr-1"></i> Security
                                        </span>
                                        <span class="issue-tag bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300">
                                            <i class="fas fa-bolt mr-1"></i> High Priority
                                        </span>
                                        <h4 class="font-medium mt-2">Hardcoded API Key</h4>
                                    </div>
                                    <button class="text-blue-600 dark:text-blue-400 hover:underline">View File</button>
                                </div>
                                <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">Found in: src/utils/api.js (Line 42)</p>
                                <div class="mt-3 bg-gray-800 text-gray-100 p-3 rounded code-block">
                                    <pre><code>const API_KEY = '1234-5678-9012-3456'; // Hardcoded credentials</code></pre>
                                </div>
                                <div class="mt-3 bg-green-50 dark:bg-green-900/10 p-3 rounded">
                                    <h5 class="font-medium text-green-700 dark:text-green-400 mb-1">
                                        <i class="fas fa-lightbulb mr-1"></i> Recommendation
                                    </h5>
                                    <p>Store sensitive information in environment variables instead of hardcoding them in the source files.</p>
                                    <div class="mt-2 bg-gray-800 text-gray-100 p-3 rounded code-block">
                                        <pre><code>const API_KEY = process.env.API_KEY; // Use environment variables</code></pre>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- Issue 2 -->
                            <div class="border-l-4 border-orange-500 pl-4 py-2 bg-orange-50/50 dark:bg-orange-900/10 rounded-r">
                                <div class="flex justify-between items-start">
                                    <div>
                                        <span class="issue-tag bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 mr-2">
                                            <i class="fas fa-code mr-1"></i> Maintainability
                                        </span>
                                        <h4 class="font-medium mt-2">Overly Complex Function</h4>
                                    </div>
                                    <button class="text-blue-600 dark:text-blue-400 hover:underline">View File</button>
                                </div>
                                <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">Found in: src/components/DataProcessor.js (Line 87)</p>
                                <p class="mt-2">The function <code class="bg-gray-200 dark:bg-gray-700 px-1 rounded">processUserData()</code> has a cyclomatic complexity of 12 (recommended max is 10).</p>
                                <div class="mt-3 bg-green-50 dark:bg-green-900/10 p-3 rounded">
                                    <h5 class="font-medium text-green-700 dark:text-green-400 mb-1">
                                        <i class="fas fa-lightbulb mr-1"></i> Recommendation
                                    </h5>
                                    <p>Break down this function into smaller, more focused functions that each handle a specific part of the logic.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Repository Insights -->
                    <div>
                        <h3 class="text-lg font-semibold mb-4">Repository Insights</h3>
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                                <h4 class="font-medium mb-3">Top Contributors</h4>
                                <div class="space-y-3">
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white mr-3">JD</div>
                                        <div class="flex-grow">
                                            <div class="font-medium">John Doe</div>
                                            <div class="text-sm text-gray-500 dark:text-gray-400">42 commits (56%)</div>
                                        </div>
                                    </div>
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 rounded-full bg-green-500 flex items-center justify-center text-white mr-3">AS</div>
                                        <div class="flex-grow">
                                            <div class="font-medium">Alice Smith</div>
                                            <div class="text-sm text-gray-500 dark:text-gray-400">24 commits (32%)</div>
                                        </div>
                                    </div>
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center text-white mr-3">RJ</div>
                                        <div class="flex-grow">
                                            <div class="font-medium">Robert Johnson</div>
                                            <div class="text-sm text-gray-500 dark:text-gray-400">8 commits (12%)</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="bg-gray-50 dark:bg-dark-200 p-4 rounded-lg">
                                <h4 class="font-medium mb-3">Activity Overview</h4>
                                <div class="space-y-2">
                                    <div class="flex justify-between">
                                        <span>Last Commit</span>
                                        <span class="font-medium">2 days ago</span>
                                    </div>
                                    <div class="flex justify-between">
                                        <span>Most Active Day</span>
                                        <span class="font-medium">Tuesday</span>
                                    </div>
                                    <div class="flex justify-between">
                                        <span>Average Commits/Week</span>
                                        <span class="font-medium">5.2</span>
                                    </div>
                                    <div class="flex justify-between">
                                        <span>Issue Resolution Time</span>
                                        <span class="font-medium">4.3 days</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </main>

        <!-- Footer -->
        <footer class="bg-gray-100 dark:bg-dark-100 py-6">
            <div class="container mx-auto px-4 text-center">
                <p class="text-gray-600 dark:text-gray-400">
                    GitHub Repository Analyzer &copy; 2023 | 
                    <a href="#" class="text-blue-600 dark:text-blue-400 hover:underline">Privacy Policy</a> | 
                    <a href="#" class="text-blue-600 dark:text-blue-400 hover:underline">Terms of Service</a>
                </p>
                <div class="flex justify-center space-x-4 mt-4">
                    <a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400">
                        <i class="fab fa-github text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400">
                        <i class="fab fa-twitter text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400">
                        <i class="fab fa-discord text-xl"></i>
                    </a>
                </div>
            </div>
        </footer>
    </div>

    <script>
        // Theme toggle functionality
        const themeToggle = document.getElementById('themeToggle');
        const html = document.documentElement;
        
        // Check for saved user preference or use system preference
        const savedTheme = localStorage.getItem('theme');
        if (savedTheme) {
            html.classList.add(savedTheme);
        } else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
            html.classList.add('dark');
        }
        
        themeToggle.addEventListener('click', () => {
            html.classList.toggle('dark');
            const theme = html.classList.contains('dark') ? 'dark' : 'light';
            localStorage.setItem('theme', theme);
        });
        
        // Sample data for charts (would be replaced with real data in a production app)
        function initCharts() {
            // This would be replaced with actual chart initialization using a library like Chart.js or Plotly
            console.log('Initializing charts...');
        }
        
        // Initialize when DOM is loaded
        document.addEventListener('DOMContentLoaded', initCharts);
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=S-Dreamer/repo-analyser" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>