44Defines the interface that all language extractors must implement.
55"""
66
7- import re
87import logging
8+ import re
99from abc import ABC , abstractmethod
10- from typing import List , Optional
10+ from typing import List
1111
12- from .models import ValidationResult , ExtractionResult
12+ from .models import ExtractionResult , ValidationResult
1313
1414logger = logging .getLogger (__name__ )
1515
@@ -271,8 +271,8 @@ def get_code_statistics(self, code: str) -> dict:
271271 Dictionary with line counts and validity
272272 """
273273 lines = code .split ("\n " )
274- code_lines = [l for l in lines if l .strip () and not l .strip ().startswith ("#" )]
275- comment_lines = [l for l in lines if l .strip ().startswith ("#" )]
274+ code_lines = [line for line in lines if line .strip () and not line .strip ().startswith ("#" )]
275+ comment_lines = [line for line in lines if line .strip ().startswith ("#" )]
276276
277277 validation = self .validate_syntax (code )
278278
@@ -281,6 +281,6 @@ def get_code_statistics(self, code: str) -> dict:
281281 "total_lines" : len (lines ),
282282 "code_lines" : len (code_lines ),
283283 "comment_lines" : len (comment_lines ),
284- "blank_lines" : len ([l for l in lines if not l .strip ()]),
284+ "blank_lines" : len ([line for line in lines if not line .strip ()]),
285285 "is_valid" : validation .is_valid ,
286286 }
0 commit comments