repo-analyser / index.html
S-Dreamer's picture
Add 3 files
7d2399f verified
<!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>