Skip to content

Commit 88a0630

Browse files
fix: fixed CodQL issue for Cotainer Migration.
1 parent 1390f4f commit 88a0630

43 files changed

Lines changed: 52 additions & 444 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/validate_bicep_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def parse_parameters_env_vars(json_path: Path) -> dict[str, list[str]]:
110110
data = json.loads(sanitized)
111111
params = data.get("parameters", {})
112112
except json.JSONDecodeError:
113-
pass
113+
pass # Fall through with empty params if JSON is malformed
114114

115115
# Walk each top-level parameter and scan its entire serialized value
116116
# for ${VAR} references from the original text.

src/backend-api/src/app/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _register_dependencies(self):
133133
)
134134
.add_singleton(ILoggerService, ConsoleLoggerService)
135135
.add_transient(IHttpService, HttpClientService)
136-
.add_singleton(IDataService, lambda: InMemoryDataService())
136+
.add_singleton(IDataService, InMemoryDataService)
137137
)
138138

139139
def run(self, host: str = "0.0.0.0", port: int = 8000, reload: bool = True):

src/backend-api/src/app/libs/base/SKLogicBase.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _init_agent(self):
8181
"""
8282
raise NotImplementedError("This method should be overridden in subclasses")
8383

84-
async def execute(func_params: dict[str, any]):
84+
async def execute(self, func_params: dict[str, any]):
8585
raise NotImplementedError("Execute method not implemented")
8686

8787
@overload
@@ -92,7 +92,7 @@ async def execute_thread(
9292
thread: AgentThread | AssistantAgentThread | AzureAIAgentThread = None,
9393
) -> tuple[str, AgentThread | AssistantAgentThread | AzureAIAgentThread]:
9494
"""When response_format is None, returns string response."""
95-
...
95+
pass
9696

9797
@overload
9898
async def execute_thread(
@@ -102,7 +102,7 @@ async def execute_thread(
102102
thread: AgentThread | AssistantAgentThread | AzureAIAgentThread = None,
103103
) -> tuple[T, AgentThread | AssistantAgentThread | AzureAIAgentThread]:
104104
"""When response_format is provided, returns typed Pydantic BaseModel response."""
105-
...
105+
pass
106106

107107
@abstractmethod
108108
async def execute_thread(

src/backend-api/src/app/libs/base/fastapi_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FastAPIWithContext(Protocol):
1717

1818
# Include essential FastAPI methods for type checking
1919
def include_router(self, *args, **kwargs) -> None:
20-
...
20+
pass
2121

2222

2323
def add_app_context_to_fastapi(

src/backend-api/src/app/libs/repositories/process_status_repository.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,7 @@ async def render_agent_status(self, process_id: str) -> dict:
320320
)
321321
process_duration_seconds = int((end - start).total_seconds())
322322
except Exception:
323-
pass
324-
325-
early_failure = (
326-
process_failed and process_duration_seconds < 30
327-
) # Failed in less than 30 seconds
323+
pass # Duration calculation is best-effort; default to 0 on parse failure
328324

329325
# Analyze each agent with enhanced insights
330326
for agent_name, agent_data in agents_data.items():

src/backend-api/src/app/libs/services/interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License.
33

44
from abc import ABC, abstractmethod
5-
from typing import Any, Dict, Union
5+
from typing import Any, Dict
66

77

88
class IDataService(ABC):

src/backend-api/src/app/routers/models/files.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from datetime import datetime, timezone
21
from pydantic import BaseModel, Field
32

43

src/backend-api/src/app/routers/router_files.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@
1313
)
1414
from fastapi.responses import Response
1515
from libs.base.typed_fastapi import TypedFastAPI
16-
from libs.models.entities import File, Process
16+
from libs.models.entities import File
1717
from libs.sas.storage import AsyncStorageBlobHelper
1818
from libs.services.auth import get_authenticated_user
1919
from libs.services.input_validation import is_valid_uuid
2020
from libs.services.interfaces import ILoggerService
21-
from libs.sas.storage import AsyncStorageBlobHelper
22-
from libs.models.entities import File, Process
2321
from routers.models.files import FileUploadResult
2422
from libs.repositories.process_repository import ProcessRepository
2523
from libs.repositories.file_repository import FileRepository
26-
from libs.repositories.process_repository import ProcessRepository
2724

2825
router = APIRouter(
2926
prefix="/api/file",

src/backend-api/src/tests/application/test_dependency_injection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_factory_registration():
126126
app_context = AppContext()
127127

128128
# Register with factory function
129-
app_context.add_singleton(IDataService, lambda: InMemoryDataService())
129+
app_context.add_singleton(IDataService, InMemoryDataService)
130130

131131
data_service = app_context.get_service(IDataService)
132132
assert isinstance(data_service, InMemoryDataService)

src/frontend/frontend_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from dotenv import load_dotenv
55
from fastapi import FastAPI, Request
66
from fastapi.middleware.cors import CORSMiddleware
7-
from fastapi.responses import FileResponse, HTMLResponse, JSONResponse
7+
from fastapi.responses import FileResponse, JSONResponse
88
from fastapi.staticfiles import StaticFiles
99

1010
# Load environment variables from .env file
@@ -42,7 +42,6 @@ async def serve_index():
4242
async def get_config(request: Request):
4343
# Only serve config to same-origin requests by checking the Referer/Origin
4444
origin = request.headers.get("origin") or ""
45-
referer = request.headers.get("referer") or ""
4645
host = request.headers.get("host") or ""
4746
if origin and not origin.endswith(host):
4847
return JSONResponse(status_code=403, content={"detail": "Forbidden"})

0 commit comments

Comments
 (0)