Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 11 additions & 20 deletions Adyen/services/disputes/disputes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,39 @@
"""
Accept a dispute
"""
endpoint = self.baseUrl + "/acceptDispute"
endpoint = self.baseUrl + f"/acceptDispute"

Check warning on line 20 in Adyen/services/disputes/disputes_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00pA63pryTICbP0-&open=AZ0K00pA63pryTICbP0-&pullRequest=452
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The f prefix on this string literal is redundant as there are no expressions to interpolate. This can be confusing for developers. For constructing URLs, it's more idiomatic to include the base URL variable within the f-string itself for better readability.

Suggested change
endpoint = self.baseUrl + f"/acceptDispute"
endpoint = f"{self.baseUrl}/acceptDispute"

method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line has become excessively long (over 100 characters), which harms readability and violates common Python style guidelines like PEP 8. The previous multi-line formatting was preferable. Please consider reformatting this call to span multiple lines.

Suggested change
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)


def defend_dispute(self, request, idempotency_key=None, **kwargs):
"""
Defend a dispute
"""
endpoint = self.baseUrl + "/defendDispute"
endpoint = self.baseUrl + f"/defendDispute"

Check warning on line 28 in Adyen/services/disputes/disputes_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00pA63pryTICbP0_&open=AZ0K00pA63pryTICbP0_&pullRequest=452
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The f prefix on this string literal is redundant as there are no expressions to interpolate. This can be confusing for developers. For constructing URLs, it's more idiomatic to include the base URL variable within the f-string itself for better readability.

Suggested change
endpoint = self.baseUrl + f"/defendDispute"
endpoint = f"{self.baseUrl}/defendDispute"

method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line has become excessively long (over 100 characters), which harms readability and violates common Python style guidelines like PEP 8. The previous multi-line formatting was preferable. Please consider reformatting this call to span multiple lines.

Suggested change
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)


def delete_dispute_defense_document(self, request, idempotency_key=None, **kwargs):
"""
Delete a defense document
"""
endpoint = self.baseUrl + "/deleteDisputeDefenseDocument"
endpoint = self.baseUrl + f"/deleteDisputeDefenseDocument"

Check warning on line 36 in Adyen/services/disputes/disputes_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00pA63pryTICbP1A&open=AZ0K00pA63pryTICbP1A&pullRequest=452
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The f prefix on this string literal is redundant as there are no expressions to interpolate. This can be confusing for developers. For constructing URLs, it's more idiomatic to include the base URL variable within the f-string itself for better readability.

Suggested change
endpoint = self.baseUrl + f"/deleteDisputeDefenseDocument"
endpoint = f"{self.baseUrl}/deleteDisputeDefenseDocument"

method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line has become excessively long (over 100 characters), which harms readability and violates common Python style guidelines like PEP 8. The previous multi-line formatting was preferable. Please consider reformatting this call to span multiple lines.

Suggested change
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)


def retrieve_applicable_defense_reasons(self, request, idempotency_key=None, **kwargs):
"""
Get applicable defense reasons
"""
endpoint = self.baseUrl + "/retrieveApplicableDefenseReasons"
endpoint = self.baseUrl + f"/retrieveApplicableDefenseReasons"

Check warning on line 44 in Adyen/services/disputes/disputes_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00pA63pryTICbP1B&open=AZ0K00pA63pryTICbP1B&pullRequest=452
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The f prefix on this string literal is redundant as there are no expressions to interpolate. This can be confusing for developers. For constructing URLs, it's more idiomatic to include the base URL variable within the f-string itself for better readability.

Suggested change
endpoint = self.baseUrl + f"/retrieveApplicableDefenseReasons"
endpoint = f"{self.baseUrl}/retrieveApplicableDefenseReasons"

method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line has become excessively long (over 100 characters), which harms readability and violates common Python style guidelines like PEP 8. The previous multi-line formatting was preferable. Please consider reformatting this call to span multiple lines.

Suggested change
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)


def supply_defense_document(self, request, idempotency_key=None, **kwargs):
"""
Supply a defense document
"""
endpoint = self.baseUrl + "/supplyDefenseDocument"
endpoint = self.baseUrl + f"/supplyDefenseDocument"

Check warning on line 52 in Adyen/services/disputes/disputes_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00pA63pryTICbP1C&open=AZ0K00pA63pryTICbP1C&pullRequest=452
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The f prefix on this string literal is redundant as there are no expressions to interpolate. This can be confusing for developers. For constructing URLs, it's more idiomatic to include the base URL variable within the f-string itself for better readability.

Suggested change
endpoint = self.baseUrl + f"/supplyDefenseDocument"
endpoint = f"{self.baseUrl}/supplyDefenseDocument"

method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line has become excessively long (over 100 characters), which harms readability and violates common Python style guidelines like PEP 8. The previous multi-line formatting was preferable. Please consider reformatting this call to span multiple lines.

Suggested change
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)


Loading