{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "REQUEST_URI=\"\/docs\/code-hygiene\/7398\" REQUEST_METHOD=\"GET\" php \/var\/www\/dev.campus.systemische-tools.de\/public\/index.php 2>&1 | tail -100",
"description": "Check rest of page output"
}
}
{
"tool_response": {
"stdout": " *\/\n private function detectMagicNumbers(string $content, string $filePath): array\n {\n $issues = [];\n\n \/\/ Skip config\/constant files\n if (preg_match('\/const|config\/i', $filePath)) {\n return [];\n }\n\n foreach (self::MAGIC_NUMBER_PATTERNS as $type => $pattern) {\n if (preg_match_all($pattern, $content, $matches, PREG_OFFSET_CAPTURE)) {\n foreach ($matches[0] as $match) {\n $line = substr_count(substr($content, 0, $match[1]), "\\n") + 1;\n $issues[] = [\n 'type' => 'magic_number',\n 'rule' => 'hardcoded-magic-number',\n 'message' => "Magic Number gefunden: {$match[0]}",\n 'severity' => 'info',\n 'line' => $line,\n ];\n }\n }\n }\n\n return $issues;\n }\n\n \/**\n * Erkennt Threshold-Verletzungen.\n *\n * @param array<string, int> $metrics\n * @param array<string, array{optimal: int, max: int}> $thresholds\n * @return array<array{type: string, rule: string, message: string, severity: string}>\n *\/\n private function detectThresholdViolations(array $metrics, array $thresholds): array\n {\n $issues = [];\n\n if ($metrics['loc'] > $thresholds['loc']['max']) {\n $issues[] = [\n 'type' => 'complexity',\n 'rule' => 'file-too-long',\n 'message' => "Datei hat {$metrics['loc']} Zeilen (max: {$thresholds['loc']['max']})",\n 'severity' => 'warning',\n ];\n }\n\n if ($metrics['methods'] > $thresholds['methods']['max']) {\n $issues[] = [\n 'type' => 'srp',\n 'rule' => 'too-many-methods',\n 'message' => "Klasse hat {$metrics['methods']} Methoden (max: {$thresholds['methods']['max']})",\n 'severity' => 'warning',\n ];\n }\n\n if ($metrics['dependencies'] > $thresholds['dependencies']['max']) {\n $issues[] = [\n 'type' => 'coupling',\n 'rule' => 'too-many-dependencies',\n 'message' => "Klasse hat {$metrics['dependencies']} Dependencies (max: {$thresholds['dependencies']['max']})",\n 'severity' => 'warning',\n ];\n }\n\n return $issues;\n }\n\n \/**\n * Bestimmt den Hygiene-Status basierend auf dem Score.\n *\/\n private function determineStatus(int $score): string\n {\n foreach (self::HYGIENE_STATUS as $status => $range) {\n if ($score >= $range['min'] && $score <= $range['max']) {\n return $status;\n }\n }\n\n return 'Kritisch';\n }\n}\n<\/code><\/pre>\n\n<div style=\"margin-top: 2rem;\">\n <a href=\"\/docs\/code-hygiene\" class=\"btn btn--secondary\">← Übersicht<\/a>\n <a href=\"\/docs\/code-hygiene\/7398\/graph\" class=\"btn btn--primary\">Graph<\/a>\n <\/div>\n\n <\/main>\n\n <footer>\n <p>© 2025 Campus<\/p>\n <\/footer>\n\n <script src=\"\/js\/app.js\"><\/script>\n <script type=\"module\" src=\"\/js\/components\/data-table.js\"><\/script>\n<\/body>\n<\/html>",
"stderr": "",
"interrupted": false,
"isImage": false
}
}