Protokoll #16183

ID16183
Zeitstempel2025-12-25 17:00:24.490030
Clientroot
IP145.224.72.140
Modellclaude-sonnet-4-20250514
Statuspending
Tokens5,569 (Input: 5,569, Output: 0)
Dauer-
Request-Zeit2025-12-25 17:00:24.490030
Response-Zeit-

Request

{
    "event": "PostToolUse",
    "tool_name": "TaskOutput",
    "tool_response": {
        "retrieval_status": "success",
        "task": {
            "task_id": "ad329ec",
            "task_type": "local_agent",
            "status": "completed",
            "description": "Refactor post_rules.py split",
            "output": "[Tool: Read] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/post_rules.py\"}\n[Tool: mcp__mcp-tasks__tasks_get] {\"id\":358}\n[Tool: mcp__mcp-tasks__tasks_get] {\"id\":358}\n[Tool: Bash] {\"command\":\"ls -la \/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/\",\"description\":\"List quality directory contents\"}\n[Tool: Bash] {\"command\":\"ls -la \/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/\",\"description\":\"List quality directory contents\"}\n[Tool: Write] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/rule_base.py\",\"content\":\"#!\/usr\/bin\/env python3\\n\\\"\\\"\\\"\\nBasis-Klasse für Quality-Gate-Regeln.\\nStellt gemeinsame Funktionalität für alle Regel-Module bereit.\\n\\\"\\\"\\\"\\n\\nimport re\\nfrom pathlib import Path\\nfrom typing import List, Callable\\n\\n\\n# =============================================================================\\n# ALLOWLIST DEFINITIONS\\n# =============================================================================\\n\\nGLOBAL_ALLOWLIST = [\\n    \\\"\/vendor\/\\\",\\n    \\\"\/tests\/\\\",\\n    \\\"\/Test\/\\\",\\n]\\n\\nDTO_ALLOWLIST = [\\n    \\\"\/Infrastructure\/DTO\/\\\",\\n    \\\"\/DTO\/\\\",\\n]\\n\\nMIGRATION_ALLOWLIST = [\\n    \\\"\/migrations\/\\\",\\n    \\\"\/Migration\/\\\",\\n]\\n\\n\\n# =============================================================================\\n# COMMON NUMBERS - Erlaubte Magic Numbers\\n# =============================================================================\\n\\nCOMMON_NUMBERS = {\\n    '0', '1', '2',\\n    '10', '100', '1000',\\n    '60', '24', '365',\\n    '30', '31', '28', '29',\\n    '12', '52', '7',\\n    '200', '201', '204',\\n    '301', '302', '304',\\n    '400', '401', '403', '404', '500',\\n}\\n\\n\\n# =============================================================================\\n# HELPER FUNCTIONS\\n# =============================================================================\\n\\ndef is_in_allowlist(file_path: str, allowlist: list) -> bool:\\n    \\\"\\\"\\\"Prüft ob Pfad in Allowlist ist.\\\"\\\"\\\"\\n    return any(allowed in file_path for allowed in allowlist)\\n\\n\\ndef count_non_empty_lines(content: str) -> int:\\n    \\\"\\\"\\\"Zählt nicht-leere Zeilen.\\\"\\\"\\\"\\n    return len([line for line in content.split('\\\\n') if line.strip()])\\n\\n\\n# =============================================================================\\n# RULE BASE CLASS\\n# =============================================================================\\n\\nclass Rule:\\n    \\\"\\\"\\\"\\n    Basis-Klasse für alle Quality-Gate-Regeln.\\n\\n    Jede Regel ist eine Callable-Klasse die file_path und content nimmt\\n    und eine Liste von Warnings zurückgibt.\\n    \\\"\\\"\\\"\\n\\n    def __init__(self, allowlist: List[str] = None):\\n        \\\"\\\"\\\"\\n        Args:\\n            allowlist: Zusätzliche Allowlist-Pfade für diese Regel\\n        \\\"\\\"\\\"\\n        self.allowlist = allowlist or []\\n\\n    def should_skip(self, file_path: str) -> bool:\\n        \\\"\\\"\\\"\\n        Prüft ob diese Datei übersprungen werden soll.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n\\n        Returns:\\n            True wenn Datei übersprungen werden soll\\n        \\\"\\\"\\\"\\n        return is_in_allowlist(file_path, GLOBAL_ALLOWLIST + self.allowlist)\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Führt die Regel-Prüfung aus.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        raise NotImplementedError(\\\"Subclasses must implement check()\\\")\\n\\n    def __call__(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Macht die Regel-Klasse callable.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        if self.should_skip(file_path):\\n            return []\\n        return self.check(file_path, content)\\n\\n\\n# =============================================================================\\n# RULE COLLECTION\\n# =============================================================================\\n\\ndef collect_rules(rule_list: List[Callable]) -> List[Callable]:\\n    \\\"\\\"\\\"\\n    Sammelt alle Regeln aus einem Modul.\\n\\n    Args:\\n        rule_list: Liste von Regel-Funktionen oder Regel-Klassen\\n\\n    Returns:\\n        Liste von callables\\n    \\\"\\\"\\\"\\n    return rule_list\\n\"}\n[Tool: Write] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/rule_base.py\",\"content\":\"#!\/usr\/bin\/env python3\\n\\\"\\\"\\\"\\nBasis-Klasse für Quality-Gate-Regeln.\\nStellt gemeinsame Funktionalität für alle Regel-Module bereit.\\n\\\"\\\"\\\"\\n\\nimport re\\nfrom pathlib import Path\\nfrom typing import List, Callable\\n\\n\\n# =============================================================================\\n# ALLOWLIST DEFINITIONS\\n# =============================================================================\\n\\nGLOBAL_ALLOWLIST = [\\n    \\\"\/vendor\/\\\",\\n    \\\"\/tests\/\\\",\\n    \\\"\/Test\/\\\",\\n]\\n\\nDTO_ALLOWLIST = [\\n    \\\"\/Infrastructure\/DTO\/\\\",\\n    \\\"\/DTO\/\\\",\\n]\\n\\nMIGRATION_ALLOWLIST = [\\n    \\\"\/migrations\/\\\",\\n    \\\"\/Migration\/\\\",\\n]\\n\\n\\n# =============================================================================\\n# COMMON NUMBERS - Erlaubte Magic Numbers\\n# =============================================================================\\n\\nCOMMON_NUMBERS = {\\n    '0', '1', '2',\\n    '10', '100', '1000',\\n    '60', '24', '365',\\n    '30', '31', '28', '29',\\n    '12', '52', '7',\\n    '200', '201', '204',\\n    '301', '302', '304',\\n    '400', '401', '403', '404', '500',\\n}\\n\\n\\n# =============================================================================\\n# HELPER FUNCTIONS\\n# =============================================================================\\n\\ndef is_in_allowlist(file_path: str, allowlist: list) -> bool:\\n    \\\"\\\"\\\"Prüft ob Pfad in Allowlist ist.\\\"\\\"\\\"\\n    return any(allowed in file_path for allowed in allowlist)\\n\\n\\ndef count_non_empty_lines(content: str) -> int:\\n    \\\"\\\"\\\"Zählt nicht-leere Zeilen.\\\"\\\"\\\"\\n    return len([line for line in content.split('\\\\n') if line.strip()])\\n\\n\\n# =============================================================================\\n# RULE BASE CLASS\\n# =============================================================================\\n\\nclass Rule:\\n    \\\"\\\"\\\"\\n    Basis-Klasse für alle Quality-Gate-Regeln.\\n\\n    Jede Regel ist eine Callable-Klasse die file_path und content nimmt\\n    und eine Liste von Warnings zurückgibt.\\n    \\\"\\\"\\\"\\n\\n    def __init__(self, allowlist: List[str] = None):\\n        \\\"\\\"\\\"\\n        Args:\\n            allowlist: Zusätzliche Allowlist-Pfade für diese Regel\\n        \\\"\\\"\\\"\\n        self.allowlist = allowlist or []\\n\\n    def should_skip(self, file_path: str) -> bool:\\n        \\\"\\\"\\\"\\n        Prüft ob diese Datei übersprungen werden soll.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n\\n        Returns:\\n            True wenn Datei übersprungen werden soll\\n        \\\"\\\"\\\"\\n        return is_in_allowlist(file_path, GLOBAL_ALLOWLIST + self.allowlist)\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Führt die Regel-Prüfung aus.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        raise NotImplementedError(\\\"Subclasses must implement check()\\\")\\n\\n    def __call__(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Macht die Regel-Klasse callable.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        if self.should_skip(file_path):\\n            return []\\n        return self.check(file_path, content)\\n\\n\\n# =============================================================================\\n# RULE COLLECTION\\n# =============================================================================\\n\\ndef collect_rules(rule_list: List[Callable]) -> List[Callable]:\\n    \\\"\\\"\\\"\\n    Sammelt alle Regeln aus einem Modul.\\n\\n    Args:\\n        rule_list: Liste von Regel-Funktionen oder Regel-Klassen\\n\\n    Returns:\\n        Liste von callables\\n    \\\"\\\"\\\"\\n    return rule_list\\n\"}\n[Tool: Write] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/rules_quality.py\",\"content\":\"#!\/usr\/bin\/env python3\\n\\\"\\\"\\\"\\nQuality Rules (W1, W4, W6) - SRP, KISS, OOP, SOLID.\\n\\nRegeln für Code-Qualität: Klassengröße, Single Responsibility,\\nOOP-Prinzipien, Encapsulation, Interface Segregation.\\n\\\"\\\"\\\"\\n\\nimport re\\nfrom pathlib import Path\\nfrom typing import List\\nfrom .rule_base import Rule, DTO_ALLOWLIST\\n\\n\\n# =============================================================================\\n# W1: SRP + KISS - Single Responsibility & Keep It Simple\\n# =============================================================================\\n\\nclass W1_1_ClassSize(Rule):\\n    \\\"\\\"\\\"W1.1: Klassengröße (max 300 LOC).\\\"\\\"\\\"\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        from .rule_base import count_non_empty_lines\\n        loc = count_non_empty_lines(content)\\n        warnings = []\\n\\n        if loc > 300:\\n            warnings.append(f\\\"W1.1: Class has {loc} lines (max 300). Consider splitting.\\\")\\n        elif loc > 200:\\n            warnings.append(f\\\"W1.1: Class has {loc} lines (approaching limit of 300).\\\")\\n\\n        return warnings\\n\\n\\nclass W1_2_PublicMethodCount(Rule):\\n    \\\"\\\"\\\"W1.2: Anzahl public methods (max 10).\\\"\\\"\\\"\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        public_methods = re.findall(r\\\"public\\\\s+function\\\\s+\\\\w+\\\", content)\\n        count = len(public_methods)\\n\\n        if count > 10:\\n            return [f\\\"W1.2: Class has {count} public methods (max 10). Consider splitting.\\\"]\\n\\n        return []\\n\\n\\nclass W1_3_ConstructorParams(Rule):\\n    \\\"\\\"\\\"W1.3: Construc... [TRUNCATED-9fd44b326bbbe333]",
            "prompt": "Lese \/var\/www\/CLAUDE.md für Projektkontext.\n\n**Task #358: post_rules.py - Regelmodule trennen**\n\n1. Analysiere `\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/post_rules.py` (468 LOC)\n2. Erstelle separate Module:\n   - `rules_security.py` - Sicherheitsregeln\n   - `rules_quality.py` - Qualitätsregeln\n   - `rules_style.py` - Style-Regeln\n3. Extrahiere gemeinsame Rule-Basisklasse\n4. Führe `\/var\/www\/scripts\/python-check.sh` aus\n\nMax 150 LOC pro Modul. Einheitliches Rule-Interface.",
            "result": "[Tool: Read] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/post_rules.py\"}\n[Tool: mcp__mcp-tasks__tasks_get] {\"id\":358}\n[Tool: mcp__mcp-tasks__tasks_get] {\"id\":358}\n[Tool: Bash] {\"command\":\"ls -la \/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/\",\"description\":\"List quality directory contents\"}\n[Tool: Bash] {\"command\":\"ls -la \/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/\",\"description\":\"List quality directory contents\"}\n[Tool: Write] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/rule_base.py\",\"content\":\"#!\/usr\/bin\/env python3\\n\\\"\\\"\\\"\\nBasis-Klasse für Quality-Gate-Regeln.\\nStellt gemeinsame Funktionalität für alle Regel-Module bereit.\\n\\\"\\\"\\\"\\n\\nimport re\\nfrom pathlib import Path\\nfrom typing import List, Callable\\n\\n\\n# =============================================================================\\n# ALLOWLIST DEFINITIONS\\n# =============================================================================\\n\\nGLOBAL_ALLOWLIST = [\\n    \\\"\/vendor\/\\\",\\n    \\\"\/tests\/\\\",\\n    \\\"\/Test\/\\\",\\n]\\n\\nDTO_ALLOWLIST = [\\n    \\\"\/Infrastructure\/DTO\/\\\",\\n    \\\"\/DTO\/\\\",\\n]\\n\\nMIGRATION_ALLOWLIST = [\\n    \\\"\/migrations\/\\\",\\n    \\\"\/Migration\/\\\",\\n]\\n\\n\\n# =============================================================================\\n# COMMON NUMBERS - Erlaubte Magic Numbers\\n# =============================================================================\\n\\nCOMMON_NUMBERS = {\\n    '0', '1', '2',\\n    '10', '100', '1000',\\n    '60', '24', '365',\\n    '30', '31', '28', '29',\\n    '12', '52', '7',\\n    '200', '201', '204',\\n    '301', '302', '304',\\n    '400', '401', '403', '404', '500',\\n}\\n\\n\\n# =============================================================================\\n# HELPER FUNCTIONS\\n# =============================================================================\\n\\ndef is_in_allowlist(file_path: str, allowlist: list) -> bool:\\n    \\\"\\\"\\\"Prüft ob Pfad in Allowlist ist.\\\"\\\"\\\"\\n    return any(allowed in file_path for allowed in allowlist)\\n\\n\\ndef count_non_empty_lines(content: str) -> int:\\n    \\\"\\\"\\\"Zählt nicht-leere Zeilen.\\\"\\\"\\\"\\n    return len([line for line in content.split('\\\\n') if line.strip()])\\n\\n\\n# =============================================================================\\n# RULE BASE CLASS\\n# =============================================================================\\n\\nclass Rule:\\n    \\\"\\\"\\\"\\n    Basis-Klasse für alle Quality-Gate-Regeln.\\n\\n    Jede Regel ist eine Callable-Klasse die file_path und content nimmt\\n    und eine Liste von Warnings zurückgibt.\\n    \\\"\\\"\\\"\\n\\n    def __init__(self, allowlist: List[str] = None):\\n        \\\"\\\"\\\"\\n        Args:\\n            allowlist: Zusätzliche Allowlist-Pfade für diese Regel\\n        \\\"\\\"\\\"\\n        self.allowlist = allowlist or []\\n\\n    def should_skip(self, file_path: str) -> bool:\\n        \\\"\\\"\\\"\\n        Prüft ob diese Datei übersprungen werden soll.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n\\n        Returns:\\n            True wenn Datei übersprungen werden soll\\n        \\\"\\\"\\\"\\n        return is_in_allowlist(file_path, GLOBAL_ALLOWLIST + self.allowlist)\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Führt die Regel-Prüfung aus.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        raise NotImplementedError(\\\"Subclasses must implement check()\\\")\\n\\n    def __call__(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Macht die Regel-Klasse callable.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        if self.should_skip(file_path):\\n            return []\\n        return self.check(file_path, content)\\n\\n\\n# =============================================================================\\n# RULE COLLECTION\\n# =============================================================================\\n\\ndef collect_rules(rule_list: List[Callable]) -> List[Callable]:\\n    \\\"\\\"\\\"\\n    Sammelt alle Regeln aus einem Modul.\\n\\n    Args:\\n        rule_list: Liste von Regel-Funktionen oder Regel-Klassen\\n\\n    Returns:\\n        Liste von callables\\n    \\\"\\\"\\\"\\n    return rule_list\\n\"}\n[Tool: Write] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/rule_base.py\",\"content\":\"#!\/usr\/bin\/env python3\\n\\\"\\\"\\\"\\nBasis-Klasse für Quality-Gate-Regeln.\\nStellt gemeinsame Funktionalität für alle Regel-Module bereit.\\n\\\"\\\"\\\"\\n\\nimport re\\nfrom pathlib import Path\\nfrom typing import List, Callable\\n\\n\\n# =============================================================================\\n# ALLOWLIST DEFINITIONS\\n# =============================================================================\\n\\nGLOBAL_ALLOWLIST = [\\n    \\\"\/vendor\/\\\",\\n    \\\"\/tests\/\\\",\\n    \\\"\/Test\/\\\",\\n]\\n\\nDTO_ALLOWLIST = [\\n    \\\"\/Infrastructure\/DTO\/\\\",\\n    \\\"\/DTO\/\\\",\\n]\\n\\nMIGRATION_ALLOWLIST = [\\n    \\\"\/migrations\/\\\",\\n    \\\"\/Migration\/\\\",\\n]\\n\\n\\n# =============================================================================\\n# COMMON NUMBERS - Erlaubte Magic Numbers\\n# =============================================================================\\n\\nCOMMON_NUMBERS = {\\n    '0', '1', '2',\\n    '10', '100', '1000',\\n    '60', '24', '365',\\n    '30', '31', '28', '29',\\n    '12', '52', '7',\\n    '200', '201', '204',\\n    '301', '302', '304',\\n    '400', '401', '403', '404', '500',\\n}\\n\\n\\n# =============================================================================\\n# HELPER FUNCTIONS\\n# =============================================================================\\n\\ndef is_in_allowlist(file_path: str, allowlist: list) -> bool:\\n    \\\"\\\"\\\"Prüft ob Pfad in Allowlist ist.\\\"\\\"\\\"\\n    return any(allowed in file_path for allowed in allowlist)\\n\\n\\ndef count_non_empty_lines(content: str) -> int:\\n    \\\"\\\"\\\"Zählt nicht-leere Zeilen.\\\"\\\"\\\"\\n    return len([line for line in content.split('\\\\n') if line.strip()])\\n\\n\\n# =============================================================================\\n# RULE BASE CLASS\\n# =============================================================================\\n\\nclass Rule:\\n    \\\"\\\"\\\"\\n    Basis-Klasse für alle Quality-Gate-Regeln.\\n\\n    Jede Regel ist eine Callable-Klasse die file_path und content nimmt\\n    und eine Liste von Warnings zurückgibt.\\n    \\\"\\\"\\\"\\n\\n    def __init__(self, allowlist: List[str] = None):\\n        \\\"\\\"\\\"\\n        Args:\\n            allowlist: Zusätzliche Allowlist-Pfade für diese Regel\\n        \\\"\\\"\\\"\\n        self.allowlist = allowlist or []\\n\\n    def should_skip(self, file_path: str) -> bool:\\n        \\\"\\\"\\\"\\n        Prüft ob diese Datei übersprungen werden soll.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n\\n        Returns:\\n            True wenn Datei übersprungen werden soll\\n        \\\"\\\"\\\"\\n        return is_in_allowlist(file_path, GLOBAL_ALLOWLIST + self.allowlist)\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Führt die Regel-Prüfung aus.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        raise NotImplementedError(\\\"Subclasses must implement check()\\\")\\n\\n    def __call__(self, file_path: str, content: str) -> List[str]:\\n        \\\"\\\"\\\"\\n        Macht die Regel-Klasse callable.\\n\\n        Args:\\n            file_path: Pfad zur zu prüfenden Datei\\n            content: Dateiinhalt\\n\\n        Returns:\\n            Liste von Warning-Messages\\n        \\\"\\\"\\\"\\n        if self.should_skip(file_path):\\n            return []\\n        return self.check(file_path, content)\\n\\n\\n# =============================================================================\\n# RULE COLLECTION\\n# =============================================================================\\n\\ndef collect_rules(rule_list: List[Callable]) -> List[Callable]:\\n    \\\"\\\"\\\"\\n    Sammelt alle Regeln aus einem Modul.\\n\\n    Args:\\n        rule_list: Liste von Regel-Funktionen oder Regel-Klassen\\n\\n    Returns:\\n        Liste von callables\\n    \\\"\\\"\\\"\\n    return rule_list\\n\"}\n[Tool: Write] {\"file_path\":\"\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/rules_quality.py\",\"content\":\"#!\/usr\/bin\/env python3\\n\\\"\\\"\\\"\\nQuality Rules (W1, W4, W6) - SRP, KISS, OOP, SOLID.\\n\\nRegeln für Code-Qualität: Klassengröße, Single Responsibility,\\nOOP-Prinzipien, Encapsulation, Interface Segregation.\\n\\\"\\\"\\\"\\n\\nimport re\\nfrom pathlib import Path\\nfrom typing import List\\nfrom .rule_base import Rule, DTO_ALLOWLIST\\n\\n\\n# =============================================================================\\n# W1: SRP + KISS - Single Responsibility & Keep It Simple\\n# =============================================================================\\n\\nclass W1_1_ClassSize(Rule):\\n    \\\"\\\"\\\"W1.1: Klassengröße (max 300 LOC).\\\"\\\"\\\"\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        from .rule_base import count_non_empty_lines\\n        loc = count_non_empty_lines(content)\\n        warnings = []\\n\\n        if loc > 300:\\n            warnings.append(f\\\"W1.1: Class has {loc} lines (max 300). Consider splitting.\\\")\\n        elif loc > 200:\\n            warnings.append(f\\\"W1.1: Class has {loc} lines (approaching limit of 300).\\\")\\n\\n        return warnings\\n\\n\\nclass W1_2_PublicMethodCount(Rule):\\n    \\\"\\\"\\\"W1.2: Anzahl public methods (max 10).\\\"\\\"\\\"\\n\\n    def check(self, file_path: str, content: str) -> List[str]:\\n        public_methods = re.findall(r\\\"public\\\\s+function\\\\s+\\\\w+\\\", content)\\n        count = len(public_methods)\\n\\n        if count > 10:\\n            return [f\\\"W1.2: Class has {count} public methods (max 10). Consider splitting.\\\"]\\n\\n        return []\\n\\n\\nclass W1_3_ConstructorParams(Rule):\\n    \\\"\\\"\\\"W1.3: Construc... [TRUNCATED-9fd44b326bbbe333]"
        }
    }
}

Response

-
← Vorheriger Zur Liste Nächster →