Showing 11 of 48 total issues
Function create_qr_code
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def create_qr_code(self, data=None, **kwargs):
if data is None:
data = {}
url = self.base_url
if "requestedAt" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function auth_header
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def auth_header(self, api_key, api_secret,
Function pre_authorize_create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def pre_authorize_create(self, data={}, **kwargs):
url = "{}/{}".format(self.base_url, 'preauthorize')
if "requestedAt" not in data:
data['requestedAt'] = int(datetime.datetime.now().timestamp())
if "merchantPaymentId" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function capture_payment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def capture_payment(self, data=None, **kwargs):
if data is None:
data = {}
url = "{}/{}".format('/v2/payments', 'capture')
if "requestedAt" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function encode_jwt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def encode_jwt(self, secret=str, scope="direct_debit",
Function create_continuous_payment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_continuous_payment(self, data=None, **kwargs):
if data is None:
data = {}
url = "{}/{}".format('/v1/subscription', 'payments')
if "requestedAt" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function give_cashback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def give_cashback(self, data=None, **kwargs):
if data is None:
data = {}
url = "{}".format(self.give_base_url)
if "merchantCashbackId" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function refund_payment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def refund_payment(self, data={}, **kwargs):
url = "{}/".format('/v2/refunds')
if "requestedAt" not in data:
data['requestedAt'] = int(datetime.datetime.now().timestamp())
if "merchantRefundId" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function reverse_cashback
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reverse_cashback(self, data=None, **kwargs):
if data is None:
data = {}
url = "{}".format(self.reverse_base_url)
if "merchantCashbackReversalId" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function create_pending_payment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_pending_payment(self, data={}, **kwargs):
url = self.base_url
if "requestedAt" not in data:
data['requestedAt'] = int(datetime.datetime.now().timestamp())
if "merchantPaymentId" not in data:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function refund_payment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def refund_payment(self, data={}, **kwargs):
url = "{}".format(URL.REFUNDS)
if "merchantRefundId" not in data:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS "
"\x1b[0m for merchantRefundId")
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"