Showing 97 of 2,517 total issues
Function example_verify_challenge_tx_threshold
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def example_verify_challenge_tx_threshold():
# Server builds challenge transaction
challenge_tx = build_challenge_transaction(
server_keypair.secret,
client_master_keypair.public_key,
- 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 __init__
has 9 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 9 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function build_challenge_transaction
has 9 arguments (exceeds 5 allowed). Consider refactoring. Open
def build_challenge_transaction(
Function __init__
has 9 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function _assemble_transaction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _assemble_transaction(
transaction_envelope: TransactionEnvelope,
simulation: SimulateTransactionResponse,
) -> TransactionEnvelope:
# TODO: add support for FeeBumpTransactionEnvelope
- 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 to_uri
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def to_uri(self) -> str:
"""Generate the request URI.
:return: Stellar Pay URI.
"""
- 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 best_rational_approximation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def best_rational_approximation(x) -> Dict[str, int]:
x = Decimal(x)
int32_max = Decimal(2147483647)
fractions = [[Decimal(0), Decimal(1)], [Decimal(1), Decimal(0)]]
i = 2
- 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 _to_operation_body
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _to_operation_body(self) -> stellar_xdr.OperationBody:
inflation_dest = (
Keypair.from_public_key(self.inflation_dest).xdr_account_id()
if self.inflation_dest is not None
else None
- 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 to_txrep
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def to_txrep(
transaction_envelope: Union[TransactionEnvelope, FeeBumpTransactionEnvelope],
) -> str:
"""Generate a human-readable format for Stellar transactions.
- 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 __init__
has 8 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function verify_challenge_transaction_threshold
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def verify_challenge_transaction_threshold(
Function append_path_payment_strict_receive_op
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def append_path_payment_strict_receive_op(
Function __init__
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function append_path_payment_strict_send_op
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def append_path_payment_strict_send_op(
Function __check_memo_required_sync
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __check_memo_required_sync(
self, transaction: Union[Transaction, FeeBumpTransaction]
) -> None:
if isinstance(transaction, FeeBumpTransaction):
transaction = transaction.inner_transaction_envelope.transaction
- 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"