dragonchain/dragonchain-sdk-python

View on GitHub

Showing 39 of 46 total issues

Function update_binance_interchain has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def update_binance_interchain(
Severity: Minor
Found in dragonchain_sdk/dragonchain_client.py - About 45 mins to fix

    Function query_blocks has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def query_blocks(
    Severity: Minor
    Found in dragonchain_sdk/dragonchain_client.py - About 45 mins to fix

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

          def __init__(
      Severity: Minor
      Found in dragonchain_sdk/dragonchain_client.py - About 45 mins to fix

        Function _build_bitcoin_transaction_body has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def _build_bitcoin_transaction_body(
            satoshis_per_byte: Optional[int] = None,
            data: Optional[str] = None,
            change_address: Optional[str] = None,
            outputs: Optional[List[Dict[str, Any]]] = None,
        Severity: Minor
        Found in dragonchain_sdk/dragonchain_client.py - About 45 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 hmac_message_string has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def hmac_message_string(self, http_verb: str, path: str, timestamp: str, content_type: str = "", content: Union[bytes, str] = "") -> str:
        Severity: Minor
        Found in dragonchain_sdk/credentials.py - About 35 mins to fix

          Function create_bitcoin_transaction has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def create_bitcoin_transaction(
          Severity: Minor
          Found in dragonchain_sdk/dragonchain_client.py - About 35 mins to fix

            Function get_authorization has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def get_authorization(self, http_verb: str, path: str, timestamp: str, content_type: str = "", content: Union[bytes, str] = "") -> str:
            Severity: Minor
            Found in dragonchain_sdk/credentials.py - About 35 mins to fix

              Function sign_binance_transaction has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def sign_binance_transaction(
              Severity: Minor
              Found in dragonchain_sdk/dragonchain_client.py - About 35 mins to fix

                Function sign_bitcoin_transaction has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def sign_bitcoin_transaction(
                Severity: Minor
                Found in dragonchain_sdk/dragonchain_client.py - About 35 mins to fix

                  Function query_blocks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def query_blocks(
                          self, redisearch_query: str, offset: int = 0, limit: int = 10, sort_by: str = "", sort_ascending: bool = True, ids_only: bool = False
                      ) -> "request_response":
                          """Perform a query on a chain's blocks
                  
                  
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 get_smart_contract has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_smart_contract(self, smart_contract_id: Optional[str] = None, transaction_type: Optional[str] = None) -> "request_response":
                          """Perform a query on a chain's smart contracts
                  
                          Args:
                              smart_contract_id (str, exclusive): Id of the contract to get
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 create_ethereum_interchain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_ethereum_interchain(
                          self, name: str, private_key: Optional[str] = None, rpc_address: Optional[str] = None, chain_id: Optional[int] = None
                      ) -> "request_response":
                          """Create (or overwrite) an ethereum wallet/network for interchain use
                  
                  
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 update_api_key has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update_api_key(
                          self, key_id: str, nickname: Optional[str] = None, permissions_document: Optional["permissions_doc"] = None
                      ) -> "request_response":
                          """Update the nickname of an existing HMAC API key
                  
                  
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 update_ethereum_interchain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update_ethereum_interchain(
                          self, name: str, private_key: Optional[str] = None, rpc_address: Optional[str] = None, chain_id: Optional[int] = None
                      ) -> "request_response":
                          """Update an existing ethereum wallet/network for interchain use
                  
                  
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 list_smart_contract_objects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def list_smart_contract_objects(self, prefix_key: Optional[str] = None, smart_contract_id: Optional[str] = None) -> "request_response":
                          """Lists all objects stored in a smart contracts heap
                          Note: When ran in an actual smart contract, smart_contract_id will be pulled automatically from the environment if not explicitly provided
                  
                          Args:
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 get_verifications has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_verifications(self, block_id: str, level: Optional[int] = None) -> "request_response":
                          """Get higher level block verifications by level 1 block id
                  
                          Args:
                              block_id (str): ID of the block to get verifications for
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 create_api_key has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_api_key(self, nickname: Optional[str] = None, permissions_document: Optional["permissions_doc"] = None) -> "request_response":
                          """Generate a new HMAC API key
                  
                          Args:
                              nickname (str, optional): The nickname to give to this new api key
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 _build_binance_transaction_body has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _build_binance_transaction_body(amount: int, to_address: str, symbol: Optional[str] = None, memo: Optional[str] = None) -> Dict[str, Any]:
                      """Build the json (dictionary) body for a binance transaction given its inputs
                  
                      Args:
                          amount (int): amount of token in transaction
                  Severity: Minor
                  Found in dragonchain_sdk/dragonchain_client.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __init__(self, credentials_obj: credentials.Credentials, endpoint: Optional[str] = None, verify: bool = True):
                          if isinstance(credentials_obj, credentials.Credentials):
                              self.credentials = credentials_obj
                          else:
                              raise TypeError('Parameter "credentials" must be of type Credentials.')
                  Severity: Minor
                  Found in dragonchain_sdk/request.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