Showing 97 of 2,517 total issues
Function _encode_memo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _encode_memo(memo) -> Union[Tuple[str, Union[str, int]], Tuple[None, None]]:
if memo and not isinstance(memo, NoneMemo):
if isinstance(memo, TextMemo):
memo_text = memo.memo_text.decode() # memo text cant decode?
memo_type = "MEMO_TEXT"
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
time_bounds: TimeBounds = None,
ledger_bounds: LedgerBounds = None,
min_sequence_number: int = 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_xdr_object
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_xdr_object(self) -> stellar_xdr.ClaimPredicate:
if (
self.claim_predicate_type
== ClaimPredicateType.CLAIM_PREDICATE_UNCONDITIONAL
):
- 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 from_xdr_object
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def from_xdr_object(
cls, xdr_object: stellar_xdr.ClaimPredicate
) -> "ClaimPredicate":
claim_predicate_type = xdr_object.type
if (
- 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
Avoid too many return
statements within this function. Open
return from_duration(sc_val)
Avoid too many return
statements within this function. Open
return from_symbol(sc_val)
Avoid too many return
statements within this function. Open
return asset_a.code < asset_b.code
Avoid too many return
statements within this function. Open
return from_uint64(sc_val)
Avoid too many return
statements within this function. Open
return s.decode("utf-8")
Avoid too many return
statements within this function. Open
return cls.predicate_or(left, right)
Avoid too many return
statements within this function. Open
return from_uint128(sc_val)
Avoid too many return
statements within this function. Open
return {
Avoid too many return
statements within this function. Open
return s
Avoid too many return
statements within this function. Open
return None, None
Avoid too many return
statements within this function. Open
return from_int256(sc_val)
Avoid too many return
statements within this function. Open
return from_address(sc_val)
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return ReturnHashMemo(value)
Avoid too many return
statements within this function. Open
return from_int64(sc_val)
Avoid too many return
statements within this function. Open
return from_int128(sc_val)