holgern/beem

View on GitHub

Showing 683 of 2,332 total issues

Function btc_usd_ticker has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def btc_usd_ticker(verbose=False):
        """ Returns the BTC/USD price from bitfinex, gdax, kraken, okcoin and bitstamp. The mean price is
            weighted by the exchange volume.
        """
        prices = {}
Severity: Minor
Found in beem/market.py - About 3 hrs 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 notifications has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def notifications(account, limit, all, mark_as_read, replies, mentions, follows, votes, reblogs, reverse):
    """ Show notifications of an account
    """
    stm = shared_blockchain_instance()
    if stm.rpc is not None:
Severity: Minor
Found in beem/cli.py - About 3 hrs 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

HiveSigner has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class HiveSigner(object):
    """ HiveSigner

        :param str scope: comma separated string with scopes
            login,offline,vote,comment,delete_comment,comment_options,custom_json,claim_reward_balance
Severity: Minor
Found in beem/hivesigner.py - About 3 hrs to fix

    Function _get_operation_filter has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def _get_operation_filter(self, only_ops=[], exclude_ops=[]):
            from beembase.operationids import operations
            operation_filter_low = 0
            operation_filter_high = 0
            if len(only_ops) == 0 and len(exclude_ops) == 0:
    Severity: Minor
    Found in beem/account.py - About 3 hrs 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 steem_btc_ticker has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def steem_btc_ticker():
            """ Returns the STEEM/BTC price from bittrex, binance, huobi and upbit. The mean price is
                weighted by the exchange volume.
            """
            prices = {}
    Severity: Minor
    Found in beem/market.py - About 3 hrs 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_estimated_block_num has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_estimated_block_num(self, date, estimateForwards=False, accurate=True):
            """ This call estimates the block number based on a given date
    
                :param datetime date: block time for which a block number is estimated
    
    
    Severity: Minor
    Found in beem/blockchain.py - About 3 hrs 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 importaccount has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def importaccount(account, roles, import_coldcard, wif):
        """Import an account using a passphrase"""
        from beemgraphenebase.account import PasswordKey
        stm = shared_blockchain_instance()
        if stm.rpc is not None:
    Severity: Minor
    Found in beem/cli.py - About 3 hrs 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 import_custom_json has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def import_custom_json(jsonid, json_data):
        data = {}
        if isinstance(json_data, tuple) and len(json_data) > 1:
            key = None
            for j in json_data:
    Severity: Minor
    Found in beem/utils.py - About 3 hrs 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 url_from_tx has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def url_from_tx(self, tx, redirect_uri=None):
            """ Creates a link for broadcasting an operation
    
                :param dict tx: includes the operation, which should be broadcast
                :param str redirect_uri: Redirects to this uri, when set
    Severity: Minor
    Found in beem/hivesigner.py - About 3 hrs 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

    Steem has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Steem(BlockChainInstance):
        """ Connect to the Steem network.
    
            :param str node: Node to connect to *(optional)*
            :param str rpcuser: RPC user *(optional)*
    Severity: Minor
    Found in beem/steem.py - About 3 hrs to fix

      Blurt has 26 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Blurt(BlockChainInstance):
          """ Connect to the Blurt network.
      
              :param str node: Node to connect to *(optional)*
              :param str rpcuser: RPC user *(optional)*
      Severity: Minor
      Found in beem/blurt.py - About 3 hrs to fix

        Function get_nodes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_nodes(self, hive=False, exclude_limited=False, dev=False, testnet=False, testnetdev=False, wss=True, https=True, not_working=False, normal=True, appbase=True):
                """ Returns nodes as list
        
                    :param bool hive: When True, only HIVE nodes will be returned
                    :param bool exclude_limited: When True, limited nodes are excluded
        Severity: Minor
        Found in beem/nodelist.py - About 2 hrs 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 print_info has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def print_info(self, force_refresh=False, return_str=False, use_table=False, **kwargs):
                """ Prints import information about the account
                """
                if force_refresh:
                    self.refresh()
        Severity: Minor
        Found in beem/account.py - About 2 hrs 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 comment_history has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def comment_history(self, limit=None, start_permlink=None,
                                account=None):
                """ Stream the comments done by an account in reverse time order.
        
                    .. note:: RPC nodes keep a limited history of user comments for the
        Severity: Minor
        Found in beem/account.py - About 2 hrs 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 newaccount has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        def newaccount(accountname, account, owner, active, memo, posting, wif, create_claimed_account, import_pub, export):
            """Create a new account
               Default setting is that a fee is payed for account creation
               Use --create-claimed-account for free account creation
        
        
        Severity: Minor
        Found in beem/cli.py - About 2 hrs 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 passwordgen has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        def passwordgen(role, account, import_password, import_coldcard, wif, export_pub, export):
            """ Creates a new password based key and prints its derived private key and public key.
                The generated key is not stored. The password is used to create new keys for an account.
            """
            stm = shared_blockchain_instance()
        Severity: Minor
        Found in beem/cli.py - About 2 hrs 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 listaccounts has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        def listaccounts(role, max_account_index, max_sequence):
            """Show stored accounts
        
            Can be used with the ledger to obtain all accounts that uses pubkeys derived from this ledger
            """
        Severity: Minor
        Found in beem/cli.py - About 2 hrs 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

        File message.py has 286 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        import re
        import json
        import logging
        from binascii import hexlify, unhexlify
        Severity: Minor
        Found in beem/message.py - About 2 hrs to fix

          File sqlite.py has 286 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          # Inspired by https://raw.githubusercontent.com/xeroc/python-graphenelib/master/graphenestorage/sqlite.py
          import os
          import sqlite3
          import logging
          Severity: Minor
          Found in beemstorage/sqlite.py - About 2 hrs to fix

            Blockchain has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Blockchain(object):
                """ This class allows to access the blockchain and read data
                    from it
            
                    :param Steem/Hive blockchain_instance: Steem or Hive instance
            Severity: Minor
            Found in beem/blockchain.py - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language