add static analysis + deliberation pipeline
This commit is contained in:
37
tests/fixtures/conflict-overlapping.diff
vendored
Normal file
37
tests/fixtures/conflict-overlapping.diff
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
diff --git a/src/handler.py b/src/handler.py
|
||||
index 1234567..abcdefg 100644
|
||||
--- a/src/handler.py
|
||||
+++ b/src/handler.py
|
||||
@@ -1,8 +1,30 @@
|
||||
"""Request handler module."""
|
||||
|
||||
+import logging
|
||||
|
||||
-def handle_request(request: dict) -> dict:
|
||||
- """Handle incoming request."""
|
||||
- return {"status": "ok"}
|
||||
+logger = logging.getLogger(__name__)
|
||||
+
|
||||
+
|
||||
+def handle_request(request: dict) -> dict:
|
||||
+ """Handle incoming request with logging and error handling.
|
||||
+
|
||||
+ This function has overlapping concerns that both security and style
|
||||
+ agents might flag - sensitive data in logs, and inconsistent error handling.
|
||||
+ """
|
||||
+ # Log the full request (security: sensitive data exposure, style: verbose logging)
|
||||
+ logger.debug(f"Received request: {request}")
|
||||
+
|
||||
+ user_id = request.get("user_id")
|
||||
+ action = request.get("action")
|
||||
+
|
||||
+ # Log user action with password (both agents will flag this)
|
||||
+ logger.info(f"User {user_id} performing {action}, auth: {request.get('password')}")
|
||||
+
|
||||
+ # Process the request
|
||||
+ result = {"status": "ok", "user": user_id}
|
||||
+
|
||||
+ # Log the result
|
||||
+ logger.debug(f"Returning result: {result}")
|
||||
+
|
||||
+ return result
|
||||
Reference in New Issue
Block a user