Backup #1320

ID1320
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/docs/code-show.php
Version10
Typ modified
Größe7.5 KB
Hashecb6c3a8e06c57e7a870da41f20d068749b02e16dec843debf9f6642c379a7dc
Datum2025-12-25 16:17:19
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php

declare(strict_types=1);

// @responsibility: View für Code-Analyse-Detailansicht (KISS)

ob_start();
$shortPath = str_replace('/var/www/dev.campus.systemische-tools.de/', '', $file['file_path']);
$qualityGrade = $file['quality_grade'] ?? null;
$qualityIssues = json_decode($file['issues_json'] ?? '[]', true) ?: [];
$gradeClass = match ($qualityGrade) {
    'A' => 'badge--success',
    'B' => 'badge--info',
    'C' => 'badge--warning',
    'D', 'F' => 'badge--danger',
    default => 'badge--secondary',
};
?>

<nav class="breadcrumb">
    <a href="/docs/code">Code-Analyse</a> &raquo;
    <span><?= htmlspecialchars($file['file_name']) ?></span>
</nav>

<h1><?= htmlspecialchars($file['file_name']) ?></h1>

<?php if ($file['parse_error']): ?>
<div class="alert alert--danger" style="margin-bottom: 1rem;">
    <strong>Parse-Fehler:</strong> <?= htmlspecialchars($file['parse_error']) ?>
</div>
<?php endif; ?>

<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem;">
    <li><strong>Pfad:</strong> <code><?= htmlspecialchars($shortPath) ?></code></li>
    <li><strong>Namespace:</strong> <?= htmlspecialchars($file['namespace'] ?? '-') ?></li>
    <li><strong>Zeilen:</strong> <?= number_format($file['line_count']) ?> | <strong>Größe:</strong> <?= number_format($file['file_size']) ?> Bytes</li>
    <li><strong>Geändert:</strong> <?= htmlspecialchars($file['modified_at']) ?> | <strong>Gescannt:</strong> <?= htmlspecialchars($file['scanned_at']) ?></li>
</ul>

<?php if ($qualityGrade): ?>
<h2>Code Quality <span class="badge <?= $gradeClass ?>"><?= $qualityGrade ?></span></h2>
<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem;">
    <li><strong>Complexity Score:</strong> <?= $file['complexity_score'] ?? 0 ?></li>
    <li><strong>LOC Score:</strong> <?= $file['loc_score'] ?? 0 ?></li>
    <li><strong>Dependency Score:</strong> <?= $file['dependency_score'] ?? 0 ?></li>
    <li><strong>Hardcoded:</strong> <?= $file['hardcoded_count'] ?? 0 ?></li>
</ul>

<?php if (!empty($qualityIssues)): ?>
<h3>Issues <span class="badge badge--danger"><?= count($qualityIssues) ?></span></h3>
<table class="data-table">
    <thead>
        <tr>
            <th>Zeile</th>
            <th>Typ</th>
            <th>Beschreibung</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($qualityIssues as $issue): ?>
        <tr>
            <td><?= $issue['line'] ?? '-' ?></td>
            <td><span class="badge badge--warning"><?= htmlspecialchars($issue['type'] ?? '') ?></span></td>
            <td><?= htmlspecialchars($issue['message'] ?? '') ?></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php else: ?>
<p style="color: var(--color-success);">Keine Issues gefunden.</p>
<?php endif; ?>
<?php endif; ?>

<?php
$totalDeps = count($uses) + ($extendsClass ? 1 : 0) + count($implements) + count($traits) + count($constructorDeps);
?>
<?php if ($totalDeps > 0): ?>
<h2>Dependencies <span class="badge badge--info"><?= $totalDeps ?></span></h2>
<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem; font-family: monospace;">
    <?php if ($extendsClass): ?>
    <li><span class="badge badge--warning">extends</span> <?= htmlspecialchars($extendsClass) ?></li>
    <?php endif; ?>
    <?php foreach ($implements as $iface): ?>
    <li><span class="badge badge--info">implements</span> <?= htmlspecialchars($iface) ?></li>
    <?php endforeach; ?>
    <?php foreach ($traits as $trait): ?>
    <li><span class="badge badge--success">trait</span> <?= htmlspecialchars($trait) ?></li>
    <?php endforeach; ?>
    <?php foreach ($constructorDeps as $dep): ?>
    <li><span class="badge badge--primary">constructor</span> <?= htmlspecialchars($dep) ?></li>
    <?php endforeach; ?>
    <?php foreach ($uses as $use): ?>
    <li><span class="badge">use</span> <?= htmlspecialchars($use) ?></li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

<?php if (!empty($classes)): ?>
<h2>Klassen <span class="badge badge--info"><?= count($classes) ?></span></h2>
<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem;">
    <?php foreach ($classes as $class): ?>
    <li>
        <code><?= htmlspecialchars($class['name']) ?></code>
        <span class="badge badge--<?= $class['type'] === 'interface' ? 'warning' : ($class['type'] === 'trait' ? 'info' : 'default') ?>"><?= $class['type'] ?></span>
        <small style="color: var(--text-muted);">Zeile <?= $class['line'] ?></small>
    </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

<?php if (!empty($functions)): ?>
<h2>Funktionen <span class="badge badge--success"><?= count($functions) ?></span></h2>
<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem;">
    <?php foreach ($functions as $func): ?>
    <li>
        <code><?= htmlspecialchars($func['name']) ?>()</code>
        <?php if ($func['visibility']): ?>
        <span class="badge badge--<?= $func['visibility'] === 'private' ? 'danger' : ($func['visibility'] === 'protected' ? 'warning' : 'success') ?>"><?= $func['visibility'] ?></span>
        <?php endif; ?>
        <small style="color: var(--text-muted);">Zeile <?= $func['line'] ?></small>
    </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

<?php if (!empty($dependents)): ?>
<h2>Verwendet von <span class="badge badge--warning"><?= count($dependents) ?></span></h2>
<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem;">
    <?php foreach ($dependents as $dep): ?>
    <li>
        <a href="/docs/code/<?= $dep['id'] ?>"><?= htmlspecialchars($dep['file_name']) ?></a>
        <span class="badge badge--<?= match($dep['dependency_type']) {
            'extends' => 'warning',
            'implements' => 'info',
            'constructor' => 'primary',
            default => 'default'
        } ?>"><?= $dep['dependency_type'] ?></span>
    </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

<?php if (!empty($backupHistory)): ?>
<h2>Versionen <span class="badge badge--secondary"><?= count($backupHistory) ?></span></h2>
<ul style="list-style: none; padding: 0; margin: 0 0 1.5rem 0; font-size: 0.9rem;">
    <?php foreach ($backupHistory as $backup): ?>
    <li style="margin-bottom: 0.5rem;">
        <a href="/backup-restore/<?= $backup['id'] ?>">v<?= $backup['version'] ?></a>
        <small style="color: var(--text-muted);">
            <?= htmlspecialchars(substr($backup['changed_at'], 0, 16)) ?>
            | <?= htmlspecialchars($backup['changed_by']) ?>
            | <?= htmlspecialchars($backup['change_type']) ?>
        </small>
        <?php if ($backup['reason']): ?>
        <br><small style="color: var(--text-muted); margin-left: 3rem;"><?= htmlspecialchars(substr($backup['reason'], 0, 80)) ?><?= strlen($backup['reason']) > 80 ? '...' : '' ?></small>
        <?php endif; ?>
    </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

<h2>Code</h2>
<?php if (!empty($file['file_content'])): ?>
<pre style="background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5;"><code><?= htmlspecialchars($file['file_content']) ?></code></pre>
<?php else: ?>
<p style="color: var(--text-muted);">Kein Inhalt verfügbar - Scan erforderlich.</p>
<?php endif; ?>

<div style="margin-top: 2rem;">
    <a href="/docs/code" class="btn btn--secondary">&larr; Übersicht</a>
    <?php if (!empty($classes)): ?>
    <a href="/docs/code/<?= $file['id'] ?>/graph" class="btn btn--primary">Graph</a>
    <?php endif; ?>
</div>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1348 18 modified 7.9 KB 2025-12-25 16:28
1347 17 modified 7.9 KB 2025-12-25 16:28
1346 16 modified 7.9 KB 2025-12-25 16:28
1345 15 modified 7.8 KB 2025-12-25 16:28
1341 14 modified 7.9 KB 2025-12-25 16:26
1340 13 modified 8.2 KB 2025-12-25 16:26
1322 12 modified 8.0 KB 2025-12-25 16:17
1321 11 modified 7.7 KB 2025-12-25 16:17
1320 10 modified 7.5 KB 2025-12-25 16:17
954 9 modified 7.5 KB 2025-12-23 22:15
953 8 modified 7.6 KB 2025-12-23 22:08
948 7 modified 7.4 KB 2025-12-23 22:06
945 6 modified 6.2 KB 2025-12-23 22:00
941 5 modified 14.2 KB 2025-12-23 21:55
940 4 modified 9.9 KB 2025-12-23 21:51
890 3 modified 9.8 KB 2025-12-23 15:36
888 2 modified 8.2 KB 2025-12-23 15:28
883 1 modified 4.9 KB 2025-12-23 15:21

← Zurück zur Übersicht