{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/CodeAnalysis\/CodeQualityChecker.php",
"offset": 285,
"limit": 40
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/CodeAnalysis\/CodeQualityChecker.php",
"content": " return $issues;\n }\n\n \/**\n * Erkennt Magic Numbers im Code.\n *\n * @return array<array{type: string, rule: string, message: string, severity: string, line?: int}>\n *\/\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",
"numLines": 40,
"startLine": 285,
"totalLines": 361
}
}
}