Skip to content

Commit e4f349a

Browse files
author
ChidcGithub
committed
fix: ruff lint errors (F541, F821, F401)
1 parent da94784 commit e4f349a

6 files changed

Lines changed: 6 additions & 7 deletions

File tree

backend/analyzers/security.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Detects SQL injection, unsafe deserialization, hardcoded secrets, etc.
44
"""
55
import ast
6+
import os
67
import re
78
from typing import List, Dict, Optional
89
from ..models.schemas import CodeIssue, SeverityLevel
@@ -376,7 +377,7 @@ def _check_command_injection(self, tree: ast.AST):
376377
id=self._generate_issue_id("legacy_command"),
377378
type="security",
378379
severity=SeverityLevel.ERROR,
379-
message=f"Legacy module 'commands' is insecure and removed in Python 3",
380+
message="Legacy module 'commands' is insecure and removed in Python 3",
380381
lineno=node.lineno,
381382
suggestion="Use subprocess.run() with shell=False"
382383
))

backend/ast_parser/node_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@link: github.com/chidcGithub
66
"""
77
import ast
8-
from typing import Dict, List, Optional, Any, Set
8+
from typing import Dict, List, Optional, Any
99

1010
from ..models.schemas import ASTNode, NodeType
1111
from .node_styles import NODE_STYLES

backend/ast_parser/relationships.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@link: github.com/chidcGithub
66
"""
77
import logging
8-
from typing import Dict, List, Optional, Set, Any
8+
from typing import Dict, List, Optional, Set
99

1010
from ..models.schemas import ASTNode, ASTEdge, NodeType, VariableInfo, CodeRelationship
1111

backend/routers/analysis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
"""
77
import ast
88
import logging
9-
from typing import Dict, List, Any
109

1110
from fastapi import APIRouter, HTTPException, status
1211
from pydantic import BaseModel
1312

1413
from ..models.schemas import (
15-
CodeInput, AnalysisResult, ComplexityMetrics, CodeIssue, SeverityLevel
14+
CodeInput, AnalysisResult, ComplexityMetrics, SeverityLevel
1615
)
1716
from ..exceptions import CodeParsingError, CodeTooLargeError, AnalysisError
1817
from ..ast_parser import ASTParser, NodeMapper

backend/routers/ast_routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
@author: Chidc
55
@link: github.com/chidcGithub
66
"""
7-
import ast
87
import logging
98
from typing import Optional
109

backend/routers/learning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@link: github.com/chidcGithub
66
"""
77
import logging
8-
from typing import Dict, Any, List
8+
from typing import Dict, Any
99

1010
from fastapi import APIRouter
1111

0 commit comments

Comments
 (0)