codelens-core 0.1.3

Core library for codelens - high performance code analysis tool
Documentation
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Codelens - Cost Estimation Comparison</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4"></script>
    <style>
        :root {
            --bg-primary: #0d1117;
            --bg-secondary: #161b22;
            --bg-tertiary: #21262d;
            --text-primary: #f0f6fc;
            --text-secondary: #8b949e;
            --accent-blue: #58a6ff;
            --accent-green: #3fb950;
            --accent-yellow: #d29922;
            --accent-purple: #a371f7;
            --accent-red: #f85149;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary); color: var(--text-primary); line-height: 1.6;
        }
        .container { max-width: 1400px; margin: 0 auto; padding: 2rem; }
        header { text-align: center; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--bg-tertiary); }
        header h1 {
            font-size: 2.5rem;
            background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
            -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
        }
        .stats-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 1.5rem; margin-bottom: 3rem;
        }
        .stat-card {
            background: var(--bg-secondary); border-radius: 12px; padding: 1.5rem; text-align: center;
            border: 1px solid var(--bg-tertiary); transition: transform 0.2s, box-shadow 0.2s;
        }
        .stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
        .stat-card .value { font-size: 2rem; font-weight: bold; }
        .stat-card .label { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.5rem; }
        .charts-section {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
            gap: 2rem; margin-bottom: 3rem;
        }
        .chart-container {
            background: var(--bg-secondary); border-radius: 12px; padding: 1.5rem;
            border: 1px solid var(--bg-tertiary);
        }
        .chart-container h3 { margin-bottom: 1rem; color: var(--text-secondary); }
        table {
            width: 100%; border-collapse: collapse; background: var(--bg-secondary);
            border-radius: 12px; overflow: hidden; margin-bottom: 2rem;
        }
        th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--bg-tertiary); }
        th { background: var(--bg-tertiary); font-weight: 600; color: var(--text-secondary); }
        tr:hover { background: var(--bg-tertiary); }
        h2 { margin-bottom: 1rem; margin-top: 2rem; }
        footer { text-align: center; padding: 2rem; color: var(--text-secondary); border-top: 1px solid var(--bg-tertiary); margin-top: 3rem; }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1>Cost Estimation Comparison</h1>
            <p style="color: var(--text-secondary)">Generated: {{ generated_at }} | Total SLOC: {{ total_sloc }}</p>
        </header>

        <section class="charts-section">
            <div class="chart-container">
                <h3>Estimated Cost by Model</h3>
                <canvas id="costChart"></canvas>
            </div>
            <div class="chart-container">
                <h3>Effort &amp; Schedule by Model</h3>
                <canvas id="effortChart"></canvas>
            </div>
        </section>

        <section>
            <h2>Model Comparison</h2>
            <table>
                <thead>
                    <tr>
                        <th>Model</th>
                        <th>Effort (PM)</th>
                        <th>Schedule (M)</th>
                        <th>People</th>
                        <th>Cost</th>
                    </tr>
                </thead>
                <tbody>
                {% for r in rows %}
                <tr>
                    <td><strong>{{ r.model }}</strong></td>
                    <td>{{ r.effort_months }}</td>
                    <td style="color: var(--accent-yellow)">{{ r.schedule_months }}</td>
                    <td style="color: var(--accent-purple)">{{ r.people_required }}</td>
                    <td style="color: var(--accent-green)">${{ r.estimated_cost }}</td>
                </tr>
                {% endfor %}
                </tbody>
            </table>
        </section>

        <footer>
            <p>Generated by <a href="https://github.com/DropFan/codelens" style="color: var(--accent-blue)"><strong>Codelens</strong></a> by <a href="https://github.com/DropFan" style="color: var(--accent-blue)">Tiger</a> | High-performance code analysis tool powered by Rust</p>
        </footer>
    </div>

    <script>
        const data = [
            {% for r in rows %}
            { model: "{{ r.model }}", effort: {{ r.effort_months }}, schedule: {{ r.schedule_months }}, people: {{ r.people_required }}, cost: {{ r.cost_raw }} },
            {% endfor %}
        ];
        const colors = ['#58a6ff', '#3fb950', '#d29922', '#a371f7'];

        new Chart(document.getElementById('costChart'), {
            type: 'bar',
            data: {
                labels: data.map(d => d.model),
                datasets: [{
                    label: 'Estimated Cost ($)',
                    data: data.map(d => d.cost),
                    backgroundColor: colors,
                    borderRadius: 4,
                }]
            },
            options: {
                responsive: true,
                plugins: { legend: { display: false } },
                scales: {
                    y: { ticks: { color: '#8b949e', callback: v => '$' + v.toLocaleString() }, grid: { color: '#21262d' } },
                    x: { ticks: { color: '#f0f6fc' }, grid: { display: false } }
                }
            }
        });

        new Chart(document.getElementById('effortChart'), {
            type: 'bar',
            data: {
                labels: data.map(d => d.model),
                datasets: [
                    { label: 'Effort (PM)', data: data.map(d => d.effort), backgroundColor: '#58a6ff', borderRadius: 4 },
                    { label: 'Schedule (M)', data: data.map(d => d.schedule), backgroundColor: '#d29922', borderRadius: 4 },
                ]
            },
            options: {
                responsive: true,
                scales: {
                    y: { ticks: { color: '#8b949e' }, grid: { color: '#21262d' } },
                    x: { ticks: { color: '#f0f6fc' }, grid: { display: false } }
                },
                plugins: { legend: { labels: { color: '#f0f6fc' } } }
            }
        });
    </script>
</body>
</html>