{
"event": "PreToolUse",
"tool_name": "mcp__mcp-docs__docs_get",
"tool_input": {
"path": "\/qualitaet\/code-hygiene-score\/gewichtung"
}
}
{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"doc\": {\n \"id\": 138,\n \"parent_id\": 135,\n \"slug\": \"gewichtung\",\n \"path\": \"\/qualitaet\/code-hygiene-score\/gewichtung\",\n \"title\": \"Gewichtung\",\n \"description\": \"Gewichtungsfaktoren für den Code Hygiene Score\",\n \"content\": \"\\n<p class=\\\"doc-meta\\\"><strong>Erstellt:<\/strong> 2025-12-25 | <strong>Aktualisiert:<\/strong> 2025-12-27<\/p>\\n<h2>Prinzip<\/h2>\\n<p>Jeder normalisierte Faktor wird gewichtet. Die Gewichte spiegeln <strong>Hygiene-Relevanz<\/strong>, nicht Architektur-Bedeutung.<\/p>\\n\\n<h2>Standard-Gewichtung<\/h2>\\n<table>\\n<tr><th>Faktor<\/th><th>Gewicht<\/th><th>Hygiene-Begründung<\/th><\/tr>\\n<tr><td>Dependencies<\/td><td><strong>25%<\/strong><\/td><td>Kopplung = Hauptursache für Hygiene-Verfall<\/td><\/tr>\\n<tr><td>Lines of Code<\/td><td>20%<\/td><td>Überschaubarkeit der Datei<\/td><\/tr>\\n<tr><td>Methoden-Anzahl<\/td><td>20%<\/td><td>Verantwortlichkeits-Klarheit<\/td><\/tr>\\n<tr><td>Hardcoded Secrets<\/td><td>15%<\/td><td>Sicherheits-Hygiene<\/td><\/tr>\\n<tr><td>Klassen pro Datei<\/td><td>10%<\/td><td>Datei-Kohäsion<\/td><\/tr>\\n<tr><td>Magic Numbers<\/td><td>10%<\/td><td>Lesbarkeit<\/td><\/tr>\\n<\/table>\\n\\n<h2>Score-Berechnung<\/h2>\\n<pre><code>hygiene_score = (\\n deps_normalized × 0.25 +\\n loc_normalized × 0.20 +\\n methods_normalized × 0.20 +\\n secrets_normalized × 0.15 +\\n classes_normalized × 0.10 +\\n magic_normalized × 0.10\\n)<\/code><\/pre>\\n\\n<h2>Beispiel: ContentController.php<\/h2>\\n<p>400 LOC, 16 Methoden, 1 Klasse, 6 Dependencies, 0 Secrets, 2 Magic Numbers<\/p>\\n\\n<table>\\n<tr><th>Faktor<\/th><th>Roh<\/th><th>Normalisiert<\/th><th>×<\/th><th>Gewicht<\/th><th>=<\/th><th>Beitrag<\/th><\/tr>\\n<tr><td>Dependencies<\/td><td>6<\/td><td>82<\/td><td>×<\/td><td>0.25<\/td><td>=<\/td><td>20.5<\/td><\/tr>\\n<tr><td>LOC<\/td><td>400<\/td><td>40<\/td><td>×<\/td><td>0.20<\/td><td>=<\/td><td>8.0<\/td><\/tr>\\n<tr><td>Methoden<\/td><td>16<\/td><td>27<\/td><td>×<\/td><td>0.20<\/td><td>=<\/td><td>5.4<\/td><\/tr>\\n<tr><td>Secrets<\/td><td>0<\/td><td>100<\/td><td>×<\/td><td>0.15<\/td><td>=<\/td><td>15.0<\/td><\/tr>\\n<tr><td>Klassen<\/td><td>1<\/td><td>100<\/td><td>×<\/td><td>0.10<\/td><td>=<\/td><td>10.0<\/td><\/tr>\\n<tr><td>Magic<\/td><td>2<\/td><td>80<\/td><td>×<\/td><td>0.10<\/td><td>=<\/td><td>8.0<\/td><\/tr>\\n<tr><td colspan=\\\"6\\\"><strong>Hygiene Score<\/strong><\/td><td><strong>66.9<\/strong><\/td><\/tr>\\n<\/table>\\n\\n<p><strong>Interpretation:<\/strong> Score 67 = „Gepflegt\\\" (60-79)<\/p>\\n\\n<h2>Dateityp-Modifikatoren<\/h2>\\n<p>Pragmatische Gewichtsanpassung nach Dateityp:<\/p>\\n\\n<h3>Controller<\/h3>\\n<table>\\n<tr><th>Faktor<\/th><th>Standard<\/th><th>Controller<\/th><\/tr>\\n<tr><td>Methoden<\/td><td>20%<\/td><td><strong>10%<\/strong><\/td><\/tr>\\n<tr><td>Dependencies<\/td><td>25%<\/td><td><strong>30%<\/strong><\/td><\/tr>\\n<\/table>\\n<p><em>Controller haben viele Actions. Dafür ist Kopplung kritischer.<\/em><\/p>\\n\\n<h3>Entity\/Model<\/h3>\\n<table>\\n<tr><th>Faktor<\/th><th>Standard<\/th><th>Entity<\/th><\/tr>\\n<tr><td>LOC<\/td><td>20%<\/td><td><strong>30%<\/strong><\/td><\/tr>\\n<tr><td>Dependencies<\/td><td>25%<\/td><td><strong>15%<\/strong><\/td><\/tr>\\n<\/table>\\n<p><em>Entities müssen schlank bleiben. Framework-Dependencies sind unvermeidbar.<\/em><\/p>\\n\\n<h3>Repository<\/h3>\\n<table>\\n<tr><th>Faktor<\/th><th>Standard<\/th><th>Repository<\/th><\/tr>\\n<tr><td>Methoden<\/td><td>20%<\/td><td><strong>10%<\/strong><\/td><\/tr>\\n<tr><td>LOC<\/td><td>20%<\/td><td><strong>30%<\/strong><\/td><\/tr>\\n<\/table>\\n<p><em>Viele CRUD-Methoden sind normal. LOC-Hygiene wichtiger.<\/em><\/p>\\n\\n<h2>Zukünftige Erweiterung<\/h2>\\n<p>Bei Integration von PHPStan:<\/p>\\n<table>\\n<tr><th>Faktor<\/th><th>Aktuell<\/th><th>Mit PHPStan<\/th><\/tr>\\n<tr><td>Dependencies<\/td><td>25%<\/td><td>20%<\/td><\/tr>\\n<tr><td>LOC<\/td><td>20%<\/td><td>15%<\/td><\/tr>\\n<tr><td>Methoden<\/td><td>20%<\/td><td>15%<\/td><\/tr>\\n<tr><td>Secrets<\/td><td>15%<\/td><td>12%<\/td><\/tr>\\n<tr><td>Klassen<\/td><td>10%<\/td><td>8%<\/td><\/tr>\\n<tr><td>Magic<\/td><td>10%<\/td><td>5%<\/td><\/tr>\\n<tr><td><strong>PHPStan<\/strong><\/td><td>-<\/td><td><strong>25%<\/strong><\/td><\/tr>\\n<\/table>\\n<p><em>PHPStan wird hoch gewichtet - statische Analyse ist Kern-Hygiene.<\/em><\/p>\",\n \"status\": \"published\",\n \"sort_order\": 3,\n \"depth\": 2,\n \"created_at\": \"2025-12-25T16:08:00\",\n \"updated_at\": \"2025-12-27T15:58:19\"\n }\n}"
}
]
}