StellarCN/py-stellar-base

View on GitHub

Showing 2,412 of 2,412 total issues

Function __init__ has 6 arguments (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(
Severity: Minor
Found in stellar_sdk/operation/liquidity_pool_deposit.py - About 35 mins to fix

    Function trade_aggregations has 6 arguments (exceeds 5 allowed). Consider refactoring.
    Open

        def trade_aggregations(
    Severity: Minor
    Found in stellar_sdk/server.py - About 35 mins to fix

      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"
      Severity: Minor
      Found in stellar_sdk/sep/stellar_uri.py - About 35 mins to fix

      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 _decode_memo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _decode_memo(
              memo_type: Optional[str], memo_value: Optional[str]
          ) -> Optional[Memo]:
              if memo_type is None:
                  return None
      Severity: Minor
      Found in stellar_sdk/sep/stellar_uri.py - About 35 mins to fix

      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,
      Severity: Minor
      Found in stellar_sdk/preconditions.py - About 35 mins to fix

      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
              ):
      Severity: Minor
      Found in stellar_sdk/operation/create_claimable_balance.py - About 35 mins to fix

      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,
          ) -> Union[stellar_xdr.Transaction, stellar_xdr.TransactionV0]:
              """Get an XDR object representation of this :class:`Transaction`.
      
      
      Severity: Minor
      Found in stellar_sdk/transaction.py - About 35 mins to fix

      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 (
      Severity: Minor
      Found in stellar_sdk/operation/create_claimable_balance.py - About 35 mins to fix

      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,
              source: Union[MuxedAccount, Keypair, str],
              sequence: int,
              fee: int,
      Severity: Minor
      Found in stellar_sdk/transaction.py - About 35 mins to fix

      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 ReturnHashMemo(value)
      Severity: Major
      Found in stellar_sdk/sep/stellar_uri.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return stellar_xdr.ClaimPredicate(
        Severity: Major
        Found in stellar_sdk/operation/create_claimable_balance.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return cls.predicate_and(left, right)
          Severity: Major
          Found in stellar_sdk/operation/create_claimable_balance.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return cls.predicate_or(left, right)
            Severity: Major
            Found in stellar_sdk/operation/create_claimable_balance.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return False
              Severity: Major
              Found in stellar_sdk/liquidity_pool_asset.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return asset_a.code < asset_b.code
                Severity: Major
                Found in stellar_sdk/liquidity_pool_asset.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return None, None
                  Severity: Major
                  Found in stellar_sdk/sep/stellar_uri.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return stellar_xdr.ClaimPredicate(
                    Severity: Major
                    Found in stellar_sdk/operation/create_claimable_balance.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return asset_a.issuer < asset_b.issuer
                      Severity: Major
                      Found in stellar_sdk/liquidity_pool_asset.py - About 30 mins to fix

                        Function append_create_contract_op has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def append_create_contract_op(
                                self,
                                wasm_id: Union[bytes, str],
                                address: Union[str, Address],
                                salt: Optional[bytes] = None,
                        Severity: Minor
                        Found in stellar_sdk/transaction_builder.py - About 25 mins to fix

                        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 is_fee_bump_transaction_envelope has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def is_fee_bump_transaction_envelope(xdr: Union[str, bytes]) -> bool:
                                if isinstance(xdr, str):
                                    xdr_object = stellar_xdr.TransactionEnvelope.from_xdr(xdr)
                                else:
                                    xdr_object = stellar_xdr.TransactionEnvelope.from_xdr_bytes(xdr)
                        Severity: Minor
                        Found in stellar_sdk/fee_bump_transaction_envelope.py - About 25 mins to fix

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language