fix: resolve 2 SonarQube issues (2 minor)#85
Conversation
Fixed issues: - AZyO-dSjyaSUl7CUwgcB for python:S7498 rule - AZyQPKE8lesrcteWWjE7 for python:S7498 rule Generated by SonarQube Agent (task: 237a72ab-9a29-4b3d-a8bf-f1bbb3097b7d)
SonarQube reviewer guideSummary: Code cleanup refactoring that improves readability and maintainability by extracting magic strings to constants, simplifying list comprehensions, and reformatting dictionary literals for consistency. Review Focus: Verify that the extracted constants ( Start review at:
|



This PR includes automated code changes to address 2 SonarQube issues: MINOR (2).
View Project in SonarCloud
Fixed Issues
python:S7498 - Replace this constructor call with a literal. • MINOR • View issue
Location:
src/operations/apply_filter.py:34What changed
This change replaces the use of the dict() constructor with a dictionary literal when building the payload: it changes payload=dict(message=f"{warn_message}: '{left}'") to payload={'message': f"{warn_message}: '{left}'"}. The static analysis warning was triggered because using dict() for simple dictionary initialization is less idiomatic and slightly less efficient than a literal. By switching to the literal form, the code now follows the recommended, more Pythonic style and eliminates the reported code smell.
python:S7498 - Replace this constructor call with a literal. • MINOR • View issue
Location:
src/operations/http_request/base.py:103What changed
Replaces the use of the dict() constructor to create an empty dictionary with the literal {} in async_safe_json_request. The static analysis warning was about preferring literal syntax for creating empty collections for readability, consistency, and minor performance benefits. Changing
status_code, js = None, dict()tostatus_code, js = None, {}directly addresses that concern.SonarQube Remediation Agent uses AI. Check for mistakes.