holgern/beem

View on GitHub
beem/blockchaininstance.py

Summary

Maintainability
F
1 mo
Test Coverage
D
67%

File blockchaininstance.py has 1891 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
import json
import logging
import re
import os
Severity: Major
Found in beem/blockchaininstance.py - About 5 days to fix

    BlockChainInstance has 76 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class BlockChainInstance(object):
        """ Connect to a Graphene network.
    
            :param str node: Node to connect to *(optional)*
            :param str rpcuser: RPC user *(optional)*
    Severity: Major
    Found in beem/blockchaininstance.py - About 1 day to fix

      Function refresh_data has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
      Open

          def refresh_data(self, chain_property, force_refresh=False, data_refresh_time_seconds=None):
              """ Read and stores steem blockchain parameters
                  If the last data refresh is older than data_refresh_time_seconds, data will be refreshed
      
                  :param bool force_refresh: if True, a refresh of the data is enforced
      Severity: Minor
      Found in beem/blockchaininstance.py - About 1 day 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 post has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

          def post(self,
                   title,
                   body,
                   author=None,
                   permlink=None,
      Severity: Minor
      Found in beem/blockchaininstance.py - About 1 day 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

      Cyclomatic complexity is too high in method refresh_data. (40)
      Open

          def refresh_data(self, chain_property, force_refresh=False, data_refresh_time_seconds=None):
              """ Read and stores steem blockchain parameters
                  If the last data refresh is older than data_refresh_time_seconds, data will be refreshed
      
                  :param bool force_refresh: if True, a refresh of the data is enforced
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method post. (36)
      Open

          def post(self,
                   title,
                   body,
                   author=None,
                   permlink=None,
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method create_claimed_account. (28)
      Open

          def create_claimed_account(
              self,
              account_name,
              creator=None,
              owner_key=None,
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method update_account. (27)
      Open

          def update_account(
              self,
              account,
              owner_key=None,
              active_key=None,
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method create_account. (26)
      Open

          def create_account(
              self,
              account_name,
              creator=None,
              owner_key=None,
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function update_account has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_account(
              self,
              account,
              owner_key=None,
              active_key=None,
      Severity: Minor
      Found in beem/blockchaininstance.py - About 5 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 create_claimed_account has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_claimed_account(
              self,
              account_name,
              creator=None,
              owner_key=None,
      Severity: Minor
      Found in beem/blockchaininstance.py - About 4 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 create_account has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_account(
              self,
              account_name,
              creator=None,
              owner_key=None,
      Severity: Minor
      Found in beem/blockchaininstance.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

      Cyclomatic complexity is too high in method __init__. (13)
      Open

          def __init__(self,
                       node="",
                       rpcuser=None,
                       rpcpassword=None,
                       debug=False,
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function _build_comment_options_op has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _build_comment_options_op(self, author, permlink, options,
                                        beneficiaries):
              options = remove_from_dict(options or {}, [
                  'max_accepted_payout', 'percent_steem_dollars', 'percent_hbd',
                  'allow_votes', 'allow_curation_rewards', 'extensions'
      Severity: Minor
      Found in beem/blockchaininstance.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

      Cyclomatic complexity is too high in method _build_comment_options_op. (11)
      Open

          def _build_comment_options_op(self, author, permlink, options,
                                        beneficiaries):
              options = remove_from_dict(options or {}, [
                  'max_accepted_payout', 'percent_steem_dollars', 'percent_hbd',
                  'allow_votes', 'allow_curation_rewards', 'extensions'
      Severity: Minor
      Found in beem/blockchaininstance.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function create_claimed_account has 19 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def create_claimed_account(
      Severity: Major
      Found in beem/blockchaininstance.py - About 2 hrs to fix

        Cyclomatic complexity is too high in method get_default_nodes. (9)
        Open

            def get_default_nodes(self):
                """Returns the default nodes"""
                if "node" in self.config:
                    nodes = self.config["node"]
                elif "nodes" in self.config:
        Severity: Minor
        Found in beem/blockchaininstance.py by radon

        Cyclomatic Complexity

        Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

        Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

        Construct Effect on CC Reasoning
        if +1 An if statement is a single decision.
        elif +1 The elif statement adds another decision.
        else +0 The else statement does not cause a new decision. The decision is at the if.
        for +1 There is a decision at the start of the loop.
        while +1 There is a decision at the while statement.
        except +1 Each except branch adds a new conditional path of execution.
        finally +0 The finally block is unconditionally executed.
        with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
        assert +1 The assert statement internally roughly equals a conditional statement.
        Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
        Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

        Source: http://radon.readthedocs.org/en/latest/intro.html

        Cyclomatic complexity is too high in method connect. (8)
        Open

            def connect(self,
                        node="",
                        rpcuser="",
                        rpcpassword="",
                        **kwargs):
        Severity: Minor
        Found in beem/blockchaininstance.py by radon

        Cyclomatic Complexity

        Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

        Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

        Construct Effect on CC Reasoning
        if +1 An if statement is a single decision.
        elif +1 The elif statement adds another decision.
        else +0 The else statement does not cause a new decision. The decision is at the if.
        for +1 There is a decision at the start of the loop.
        while +1 There is a decision at the while statement.
        except +1 Each except branch adds a new conditional path of execution.
        finally +0 The finally block is unconditionally executed.
        with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
        assert +1 The assert statement internally roughly equals a conditional statement.
        Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
        Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

        Source: http://radon.readthedocs.org/en/latest/intro.html

        Cyclomatic complexity is too high in method finalizeOp. (8)
        Open

            def finalizeOp(self, ops, account, permission, **kwargs):
                """ This method obtains the required private keys if present in
                    the wallet, finalizes the transaction, signs it and
                    broadacasts it
        
        
        Severity: Minor
        Found in beem/blockchaininstance.py by radon

        Cyclomatic Complexity

        Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

        Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

        Construct Effect on CC Reasoning
        if +1 An if statement is a single decision.
        elif +1 The elif statement adds another decision.
        else +0 The else statement does not cause a new decision. The decision is at the if.
        for +1 There is a decision at the start of the loop.
        while +1 There is a decision at the while statement.
        except +1 Each except branch adds a new conditional path of execution.
        finally +0 The finally block is unconditionally executed.
        with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
        assert +1 The assert statement internally roughly equals a conditional statement.
        Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
        Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

        Source: http://radon.readthedocs.org/en/latest/intro.html

        Function create_account has 17 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def create_account(
        Severity: Major
        Found in beem/blockchaininstance.py - About 2 hrs to fix

          Function update_account has 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def update_account(
          Severity: Major
          Found in beem/blockchaininstance.py - About 2 hrs to fix

            Cyclomatic complexity is too high in method switch_blockchain. (7)
            Open

                def switch_blockchain(self, blockchain, update_nodes=False):
                    """ Switches the connected blockchain. Can be either hive or steem.
            
                        :param str blockchain: can be "hive" or "steem"
                        :param bool update_nodes: When true, the nodes are updated, using
            Severity: Minor
            Found in beem/blockchaininstance.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Cyclomatic complexity is too high in method vote. (6)
            Open

                def vote(self, weight, identifier, account=None, **kwargs):
                    """ Vote for a post
            
                        :param float weight: Voting weight. Range: -100.0 - +100.0.
                        :param str identifier: Identifier for the post to vote. Takes the
            Severity: Minor
            Found in beem/blockchaininstance.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Cyclomatic complexity is too high in method get_reward_funds. (6)
            Open

                def get_reward_funds(self, use_stored_data=True):
                    """ Get details for a reward fund.
            
                        :param bool use_stored_data: if True, stored data will be returned. If stored data are
                            empty or old, refresh_data() is used.
            Severity: Minor
            Found in beem/blockchaininstance.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Cyclomatic complexity is too high in method witness_update. (6)
            Open

                def witness_update(self, signing_key, url, props, account=None, **kwargs):
                    """ Creates/updates a witness
            
                        :param str signing_key: Public signing key
                        :param str url: URL
            Severity: Minor
            Found in beem/blockchaininstance.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Cyclomatic complexity is too high in method move_current_node_to_front. (6)
            Open

                def move_current_node_to_front(self):
                    """Returns the default node list, until the first entry
                        is equal to the current working node url
                    """
                    node = self.get_default_nodes()
            Severity: Minor
            Found in beem/blockchaininstance.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Function post has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def post(self,
            Severity: Major
            Found in beem/blockchaininstance.py - About 1 hr to fix

              Function create_account has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def create_account(
                      self,
                      account_name,
                      creator=None,
                      owner_key=None,
              Severity: Minor
              Found in beem/blockchaininstance.py - About 1 hr to fix

                Function create_claimed_account has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def create_claimed_account(
                        self,
                        account_name,
                        creator=None,
                        owner_key=None,
                Severity: Minor
                Found in beem/blockchaininstance.py - About 1 hr to fix

                  Function finalizeOp has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def finalizeOp(self, ops, account, permission, **kwargs):
                          """ This method obtains the required private keys if present in
                              the wallet, finalizes the transaction, signs it and
                              broadacasts it
                  
                  
                  Severity: Minor
                  Found in beem/blockchaininstance.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __init__(self,
                                   node="",
                                   rpcuser=None,
                                   rpcpassword=None,
                                   debug=False,
                  Severity: Minor
                  Found in beem/blockchaininstance.py - About 1 hr 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_reward_funds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_reward_funds(self, use_stored_data=True):
                          """ Get details for a reward fund.
                  
                              :param bool use_stored_data: if True, stored data will be returned. If stored data are
                                  empty or old, refresh_data() is used.
                  Severity: Minor
                  Found in beem/blockchaininstance.py - About 55 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self,
                  Severity: Minor
                  Found in beem/blockchaininstance.py - About 45 mins to fix

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

                        def token_power_to_token_backed_dollar(self, token_power, post_rshares=0, voting_power=STEEM_100_PERCENT, vote_pct=STEEM_100_PERCENT, not_broadcasted_vote=True, use_stored_data=True):
                    Severity: Minor
                    Found in beem/blockchaininstance.py - About 45 mins to fix

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

                          def custom_json(self,
                      Severity: Minor
                      Found in beem/blockchaininstance.py - About 35 mins to fix

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

                            def witness_update(self, signing_key, url, props, account=None, **kwargs):
                        Severity: Minor
                        Found in beem/blockchaininstance.py - About 35 mins to fix

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

                              def vests_to_rshares(self, vests, voting_power=STEEM_100_PERCENT, vote_pct=STEEM_100_PERCENT, subtract_dust_threshold=True, use_stored_data=True):
                          Severity: Minor
                          Found in beem/blockchaininstance.py - About 35 mins to fix

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

                                def comment_options(self, options, identifier, beneficiaries=[],
                            Severity: Minor
                            Found in beem/blockchaininstance.py - About 35 mins to fix

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

                                  def connect(self,
                                              node="",
                                              rpcuser="",
                                              rpcpassword="",
                                              **kwargs):
                              Severity: Minor
                              Found in beem/blockchaininstance.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_current_median_history has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def get_current_median_history(self, use_stored_data=True):
                                      """ Returns the current median price
                              
                                          :param bool use_stored_data: if True, stored data will be returned. If stored data are
                                                                       empty or old, refresh_data() is used.
                              Severity: Minor
                              Found in beem/blockchaininstance.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 ret
                              Severity: Major
                              Found in beem/blockchaininstance.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                        return
                                Severity: Major
                                Found in beem/blockchaininstance.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                          return
                                  Severity: Major
                                  Found in beem/blockchaininstance.py - About 30 mins to fix

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

                                        def get_default_nodes(self):
                                            """Returns the default nodes"""
                                            if "node" in self.config:
                                                nodes = self.config["node"]
                                            elif "nodes" in self.config:
                                    Severity: Minor
                                    Found in beem/blockchaininstance.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 vote has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def vote(self, weight, identifier, account=None, **kwargs):
                                            """ Vote for a post
                                    
                                                :param float weight: Voting weight. Range: -100.0 - +100.0.
                                                :param str identifier: Identifier for the post to vote. Takes the
                                    Severity: Minor
                                    Found in beem/blockchaininstance.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 switch_blockchain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def switch_blockchain(self, blockchain, update_nodes=False):
                                            """ Switches the connected blockchain. Can be either hive or steem.
                                    
                                                :param str blockchain: can be "hive" or "steem"
                                                :param bool update_nodes: When true, the nodes are updated, using
                                    Severity: Minor
                                    Found in beem/blockchaininstance.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

                                    Refactor this function to reduce its Cognitive Complexity from 72 to the 15 allowed.
                                    Open

                                        def refresh_data(self, chain_property, force_refresh=False, data_refresh_time_seconds=None):
                                    Severity: Critical
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                    See

                                    Method "create_claimed_account" has 20 parameters, which is greater than the 7 authorized.
                                    Open

                                            self,
                                            account_name,
                                            creator=None,
                                            owner_key=None,
                                            active_key=None,
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                    Noncompliant Code Example

                                    With a maximum number of 4 parameters:

                                    def do_something(param1, param2, param3, param4, param5):
                                        ...
                                    

                                    Compliant Solution

                                    def do_something(param1, param2, param3, param4):
                                        ...
                                    

                                    Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed.
                                    Open

                                        def create_account(
                                    Severity: Critical
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                    See

                                    Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed.
                                    Open

                                        def update_account(
                                    Severity: Critical
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                    See

                                    Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed.
                                    Open

                                        def _build_comment_options_op(self, author, permlink, options,
                                    Severity: Critical
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                    See

                                    Method "post" has 15 parameters, which is greater than the 7 authorized.
                                    Open

                                        def post(self,
                                                 title,
                                                 body,
                                                 author=None,
                                                 permlink=None,
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                    Noncompliant Code Example

                                    With a maximum number of 4 parameters:

                                    def do_something(param1, param2, param3, param4, param5):
                                        ...
                                    

                                    Compliant Solution

                                    def do_something(param1, param2, param3, param4):
                                        ...
                                    

                                    Refactor this function to reduce its Cognitive Complexity from 59 to the 15 allowed.
                                    Open

                                        def post(self,
                                    Severity: Critical
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                    See

                                    Refactor this function to reduce its Cognitive Complexity from 30 to the 15 allowed.
                                    Open

                                        def create_claimed_account(
                                    Severity: Critical
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                    See

                                    Method "update_account" has 17 parameters, which is greater than the 7 authorized.
                                    Open

                                            self,
                                            account,
                                            owner_key=None,
                                            active_key=None,
                                            memo_key=None,
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                    Noncompliant Code Example

                                    With a maximum number of 4 parameters:

                                    def do_something(param1, param2, param3, param4, param5):
                                        ...
                                    

                                    Compliant Solution

                                    def do_something(param1, param2, param3, param4):
                                        ...
                                    

                                    Method "create_account" has 18 parameters, which is greater than the 7 authorized.
                                    Open

                                            self,
                                            account_name,
                                            creator=None,
                                            owner_key=None,
                                            active_key=None,
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                    Noncompliant Code Example

                                    With a maximum number of 4 parameters:

                                    def do_something(param1, param2, param3, param4, param5):
                                        ...
                                    

                                    Compliant Solution

                                    def do_something(param1, param2, param3, param4):
                                        ...
                                    

                                    Either merge this branch with the identical one on line "1940" or change one of the implementations.
                                    Open

                                                        image.append(url)
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Having two branches in the same if structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

                                    Noncompliant Code Example

                                    if 0 <= a < 10:
                                        do_the_thing()
                                    elif 10 <= a < 20:
                                        do_the_other_thing()
                                    elif 20 <= a < 50:
                                        do_the_thing()  # Noncompliant; duplicates first condition
                                    else:
                                        do_the_rest()
                                    
                                    b = 4 if a > 12 else 4
                                    

                                    Compliant Solution

                                    if (0 <= a < 10) or (20 <= a < 50):
                                        do_the_thing()
                                    elif 10 <= a < 20:
                                        do_the_other_thing()
                                    else:
                                        do_the_rest()
                                    
                                    b = 4
                                    

                                    or

                                    if 0 <= a < 10:
                                        do_the_thing()
                                    elif 10 <= a < 20:
                                        do_the_other_thing()
                                    elif 20 <= a < 50:
                                        do_the_third_thing()
                                    else:
                                        do_the_rest()
                                    
                                    b = 8 if a > 12 else 4
                                    

                                    Either merge this branch with the identical one on line "841" or change one of the implementations.
                                    Open

                                                nodes = self.config["node"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Having two branches in the same if structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

                                    Noncompliant Code Example

                                    if 0 <= a < 10:
                                        do_the_thing()
                                    elif 10 <= a < 20:
                                        do_the_other_thing()
                                    elif 20 <= a < 50:
                                        do_the_thing()  # Noncompliant; duplicates first condition
                                    else:
                                        do_the_rest()
                                    
                                    b = 4 if a > 12 else 4
                                    

                                    Compliant Solution

                                    if (0 <= a < 10) or (20 <= a < 50):
                                        do_the_thing()
                                    elif 10 <= a < 20:
                                        do_the_other_thing()
                                    else:
                                        do_the_rest()
                                    
                                    b = 4
                                    

                                    or

                                    if 0 <= a < 10:
                                        do_the_thing()
                                    elif 10 <= a < 20:
                                        do_the_other_thing()
                                    elif 20 <= a < 50:
                                        do_the_third_thing()
                                    else:
                                        do_the_rest()
                                    
                                    b = 8 if a > 12 else 4
                                    

                                    Merge this if statement with the enclosing one.
                                    Open

                                                        if (datetime.utcnow() - self.data['last_refresh_hardfork_properties']).total_seconds() < self.data_refresh_time_seconds:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Merge this if statement with the enclosing one.
                                    Open

                                                        if (datetime.utcnow() - self.data['last_refresh_config']).total_seconds() < self.data_refresh_time_seconds:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Merge this if statement with the enclosing one.
                                    Open

                                                        if (datetime.utcnow() - self.data['last_refresh_feed_history']).total_seconds() < self.data_refresh_time_seconds:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Merge this if statement with the enclosing one.
                                    Open

                                                        if (datetime.utcnow() - self.data['last_refresh_witness_schedule']).total_seconds() < 3:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Remove this commented out code.
                                    Open

                                            # conf = self.get_config()
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Programmers should not comment out code as it bloats programs and reduces readability.

                                    Unused code should be deleted and can be retrieved from source control history if required.

                                    See

                                    • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
                                    • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
                                    • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
                                    • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

                                    Merge this if statement with the enclosing one.
                                    Open

                                                        if (datetime.utcnow() - self.data['last_refresh_reward_funds']).total_seconds() < self.data_refresh_time_seconds:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Merge this if statement with the enclosing one.
                                    Open

                                                if "default_account" in self.config:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Remove this commented out code.
                                    Open

                                            # (effective_vote_rshares * effective_vote_rshares) + effective_vote_rshares * (-post_rshares_curve_after_vote + 2 * post_rshares_normalized) + ((post_rshares_normalized * post_rshares_normalized - SQUARED_CURVE_CONSTANT)  - post_rshares_curve_after_vote * (post_rshares + CURVE_CONSTANT_X4)) = 0
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Programmers should not comment out code as it bloats programs and reduces readability.

                                    Unused code should be deleted and can be retrieved from source control history if required.

                                    See

                                    • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
                                    • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
                                    • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
                                    • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

                                    Merge this if statement with the enclosing one.
                                    Open

                                                        if (datetime.utcnow() - self.data['last_refresh_dynamic_global_properties']).total_seconds() < self.data_refresh_time_seconds:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py by sonar-python

                                    Merging collapsible if statements increases the code's readability.

                                    Noncompliant Code Example

                                    if condition1:
                                        if condition2:
                                            # ...
                                    

                                    Compliant Solution

                                    if condition1 and condition2:
                                        # ...
                                    

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if password:
                                                active_key = PasswordKey(account_name, password, role="active", prefix=self.prefix)
                                                owner_key = PasswordKey(account_name, password, role="owner", prefix=self.prefix)
                                                posting_key = PasswordKey(account_name, password, role="posting", prefix=self.prefix)
                                                memo_key = PasswordKey(account_name, password, role="memo", prefix=self.prefix)
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 3 days to fix
                                    beem/blockchaininstance.py on lines 1371..1405

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 333.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if password:
                                                active_key = PasswordKey(account_name, password, role="active", prefix=self.prefix)
                                                owner_key = PasswordKey(account_name, password, role="owner", prefix=self.prefix)
                                                posting_key = PasswordKey(account_name, password, role="posting", prefix=self.prefix)
                                                memo_key = PasswordKey(account_name, password, role="memo", prefix=self.prefix)
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 3 days to fix
                                    beem/blockchaininstance.py on lines 1174..1208

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 333.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            elif chain_property == "reward_funds":
                                                if not self.offline:
                                                    if self.data['last_refresh_reward_funds'] is not None and not force_refresh and self.data["last_node"] == self.rpc.url:
                                                        if (datetime.utcnow() - self.data['last_refresh_reward_funds']).total_seconds() < self.data_refresh_time_seconds:
                                                            return
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 day to fix
                                    beem/blockchaininstance.py on lines 291..299

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 162.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if chain_property == "dynamic_global_properties":
                                                if not self.offline:
                                                    if self.data['last_refresh_dynamic_global_properties'] is not None and not force_refresh and self.data["last_node"] == self.rpc.url:
                                                        if (datetime.utcnow() - self.data['last_refresh_dynamic_global_properties']).total_seconds() < self.data_refresh_time_seconds:
                                                            return            
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 day to fix
                                    beem/blockchaininstance.py on lines 346..355

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 162.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 4 locations. Consider refactoring.
                                    Open

                                        @property
                                        def hardfork(self):
                                            if self.offline or self.rpc is None:
                                                versions = known_chains['HIVE']['min_version']
                                            else:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 3 other locations - About 6 hrs to fix
                                    beem/blurt.py on lines 416..426
                                    beem/hive.py on lines 407..417
                                    beem/steem.py on lines 426..436

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 104.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        def _calc_resulting_vote(self, voting_power=STEEM_100_PERCENT, vote_pct=STEEM_100_PERCENT, use_stored_data=True):
                                            # determine voting power used
                                            used_power = int((voting_power * abs(vote_pct)) / STEEM_100_PERCENT * (60 * 60 * 24))
                                            max_vote_denom = self._max_vote_denom(use_stored_data=use_stored_data)
                                            used_power = int((used_power + max_vote_denom - 1) / max_vote_denom)
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 6 hrs to fix
                                    beem/blurt.py on lines 254..259
                                    beem/steem.py on lines 264..269

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 99.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        def get_dust_threshold(self, use_stored_data=True):
                                            """Returns the vote dust threshold"""
                                            props = self.get_config(use_stored_data=use_stored_data)
                                            dust_threshold = 0
                                            if props is None:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 4 hrs to fix
                                    beem/blockchaininstance.py on lines 512..522

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 79.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if self.is_hive:
                                                comment_op = operations.Comment_options(
                                                    **{
                                                        "author":
                                                        author,
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 4 hrs to fix
                                    beem/blockchaininstance.py on lines 2131..2171

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 79.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        def get_block_interval(self, use_stored_data=True):
                                            """Returns the block interval in seconds"""
                                            props = self.get_config(use_stored_data=use_stored_data)
                                            block_interval = 3
                                            if props is None:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 4 hrs to fix
                                    beem/blockchaininstance.py on lines 546..555

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 79.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        def get_feed_history(self, use_stored_data=True):
                                            """ Returns the feed_history
                                    
                                                :param bool use_stored_data: if True, stored data will be returned. If stored data are
                                                    empty or old, refresh_data() is used.
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 4 hrs to fix
                                    beem/blockchaininstance.py on lines 359..372
                                    beem/blockchaininstance.py on lines 718..729

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 75.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        def get_witness_schedule(self, use_stored_data=True):
                                            """ Return witness elected chain properties
                                    
                                            """
                                            if use_stored_data:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 4 hrs to fix
                                    beem/blockchaininstance.py on lines 359..372
                                    beem/blockchaininstance.py on lines 393..406

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 75.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        def get_dynamic_global_properties(self, use_stored_data=True):
                                            """ This call returns the *dynamic global properties*
                                    
                                                :param bool use_stored_data: if True, stored data will be returned. If stored data are
                                                    empty or old, refresh_data() is used.
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 4 hrs to fix
                                    beem/blockchaininstance.py on lines 393..406
                                    beem/blockchaininstance.py on lines 718..729

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 75.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            while not offline and node[0] != self.rpc.url and len(node) > 1:
                                                node = node[1:] + [node[0]]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 3 hrs to fix
                                    beem/cli.py on lines 445..446

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 65.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                op = {
                                                    "fee": Amount(fee, blockchain_instance=self),
                                                    "creator": creator["name"],
                                                    "prefix": self.prefix,
                                                    "json_str": not bool(self.config["use_condenser"]),
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1062..1066

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                            if additional_owner_accounts is not None:
                                                for k in additional_owner_accounts:
                                                    addaccount = Account(k, blockchain_instance=self)
                                                    owner_accounts_authority.append([addaccount["name"], 1])
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1611..1614
                                    beem/blockchaininstance.py on lines 1615..1618

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        def _max_vote_denom(self, use_stored_data=True):
                                            # get props
                                            global_properties = self.get_dynamic_global_properties(use_stored_data=use_stored_data)
                                            vote_power_reserve_rate = global_properties['vote_power_reserve_rate']
                                            max_vote_denom = vote_power_reserve_rate * STEEM_VOTE_REGENERATION_SECONDS
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 1 hr to fix
                                    beem/blurt.py on lines 247..252
                                    beem/steem.py on lines 257..262

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                            if additional_active_accounts is not None:
                                                for k in additional_active_accounts:
                                                    addaccount = Account(k, blockchain_instance=self)
                                                    active_accounts_authority.append([addaccount["name"], 1])
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1607..1610
                                    beem/blockchaininstance.py on lines 1615..1618

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            op = {
                                                "fee": Amount(fee, blockchain_instance=self),
                                                "creator": creator["name"],
                                                "prefix": self.prefix,
                                                "json_str": not bool(self.config["use_condenser"]),
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1241..1245

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                            if additional_posting_accounts is not None:
                                                for k in additional_posting_accounts:
                                                    addaccount = Account(k, blockchain_instance=self)
                                                    posting_accounts_authority.append([addaccount["name"], 1])
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 2 other locations - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1607..1610
                                    beem/blockchaininstance.py on lines 1611..1614

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                def get_hashtags(mdstring):
                                                    hashtags = []
                                                    for t in re.findall(r'(^|\s)(#[-a-z\d]+)', mdstring):
                                                        hashtags.append(list(t)[-1])
                                                    return hashtags
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1922..1926

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 46.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                def get_users(mdstring):
                                                    users = []
                                                    for u in re.findall(r'(^|[^a-zA-Z0-9_!#$%&*@@\/]|(^|[^a-zA-Z0-9_+~.-\/#]))[@@]([a-z][-\.a-z\d]+[a-z\d])', mdstring):
                                                        users.append(list(u)[-1])
                                                    return users
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 1928..1932

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 46.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 4 locations. Consider refactoring.
                                    Open

                                        @property
                                        def chain_params(self):
                                            if self.offline or self.rpc is None:
                                                return known_chains["HIVE"]
                                            else:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 3 other locations - About 1 hr to fix
                                    beem/blurt.py on lines 409..414
                                    beem/hive.py on lines 400..405
                                    beem/steem.py on lines 419..424

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 44.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        @property
                                        def backed_token_symbol(self):
                                            """ get the current chains symbol for SBD (e.g. "TBD" on testnet) """
                                            # some networks (e.g. whaleshares) do not have SBD
                                            try:
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/steem.py on lines 445..453

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 43.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        @property
                                        def is_steem(self):
                                            config = self.get_config(use_stored_data=True)
                                            if config is None:
                                                return False
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 769..774

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 43.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        @property
                                        def is_hive(self):
                                            config = self.get_config(use_stored_data=True)
                                            if config is None:
                                                return False
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 1 other location - About 1 hr to fix
                                    beem/blockchaininstance.py on lines 776..781

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 43.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                try:
                                                    self.data['hardfork_properties'] = self.get_hardfork_properties(False)
                                                except:
                                                    self.data['hardfork_properties'] = None
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 1 other location - About 55 mins to fix
                                    beem/blockchaininstance.py on lines 309..312

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 37.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                try:
                                                    self.data['feed_history'] = self.get_feed_history(False)
                                                except:
                                                    self.data['feed_history'] = None
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 1 other location - About 55 mins to fix
                                    beem/blockchaininstance.py on lines 323..326

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 37.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if self.steemconnect is not None and not isinstance(self.steemconnect, (HiveSigner)):
                                                raise ValueError("steemconnect musst be SteemConnect object")
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 1 other location - About 45 mins to fix
                                    beem/blockchaininstance.py on lines 208..209

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 35.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if self.hivesigner is not None and not isinstance(self.hivesigner, (HiveSigner)):
                                                raise ValueError("hivesigner musst be HiveSigner object")        
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 1 other location - About 45 mins to fix
                                    beem/blockchaininstance.py on lines 206..207

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 35.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not account and self.config["default_account"]:
                                                account = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1055..1056
                                    beem/blockchaininstance.py on lines 1153..1154
                                    beem/blockchaininstance.py on lines 1350..1351
                                    beem/blockchaininstance.py on lines 1730..1731
                                    beem/blockchaininstance.py on lines 1906..1907
                                    beem/blockchaininstance.py on lines 2082..2083

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not author and self.config["default_account"]:
                                                author = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1055..1056
                                    beem/blockchaininstance.py on lines 1153..1154
                                    beem/blockchaininstance.py on lines 1350..1351
                                    beem/blockchaininstance.py on lines 1696..1697
                                    beem/blockchaininstance.py on lines 1730..1731
                                    beem/blockchaininstance.py on lines 2082..2083

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not account and self.config["default_account"]:
                                                account = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1055..1056
                                    beem/blockchaininstance.py on lines 1153..1154
                                    beem/blockchaininstance.py on lines 1350..1351
                                    beem/blockchaininstance.py on lines 1696..1697
                                    beem/blockchaininstance.py on lines 1730..1731
                                    beem/blockchaininstance.py on lines 1906..1907

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not creator and self.config["default_account"]:
                                                creator = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1153..1154
                                    beem/blockchaininstance.py on lines 1350..1351
                                    beem/blockchaininstance.py on lines 1696..1697
                                    beem/blockchaininstance.py on lines 1730..1731
                                    beem/blockchaininstance.py on lines 1906..1907
                                    beem/blockchaininstance.py on lines 2082..2083

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not creator and self.config["default_account"]:
                                                creator = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1055..1056
                                    beem/blockchaininstance.py on lines 1153..1154
                                    beem/blockchaininstance.py on lines 1696..1697
                                    beem/blockchaininstance.py on lines 1730..1731
                                    beem/blockchaininstance.py on lines 1906..1907
                                    beem/blockchaininstance.py on lines 2082..2083

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not creator and self.config["default_account"]:
                                                creator = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1055..1056
                                    beem/blockchaininstance.py on lines 1350..1351
                                    beem/blockchaininstance.py on lines 1696..1697
                                    beem/blockchaininstance.py on lines 1730..1731
                                    beem/blockchaininstance.py on lines 1906..1907
                                    beem/blockchaininstance.py on lines 2082..2083

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 7 locations. Consider refactoring.
                                    Open

                                            if not account and self.config["default_account"]:
                                                account = self.config["default_account"]
                                    Severity: Major
                                    Found in beem/blockchaininstance.py and 6 other locations - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 1055..1056
                                    beem/blockchaininstance.py on lines 1153..1154
                                    beem/blockchaininstance.py on lines 1350..1351
                                    beem/blockchaininstance.py on lines 1696..1697
                                    beem/blockchaininstance.py on lines 1906..1907
                                    beem/blockchaininstance.py on lines 2082..2083

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if not rpcpassword and "rpcpassword" in self.config:
                                                rpcpassword = self.config["rpcpassword"]
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 1 other location - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 232..233

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if not rpcuser and "rpcuser" in self.config:
                                                rpcuser = self.config["rpcuser"]
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 1 other location - About 40 mins to fix
                                    beem/blockchaininstance.py on lines 235..236

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 34.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                            if additional_active_accounts is None:
                                                active_accounts_authority = account['active']['account_auths']
                                            else:
                                                active_accounts_authority = []
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 2 other locations - About 35 mins to fix
                                    beem/blockchaininstance.py on lines 1586..1589
                                    beem/blockchaininstance.py on lines 1594..1597

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 33.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                            if additional_posting_accounts is None:
                                                posting_accounts_authority = account['posting']['account_auths']
                                            else:
                                                posting_accounts_authority = []
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 2 other locations - About 35 mins to fix
                                    beem/blockchaininstance.py on lines 1586..1589
                                    beem/blockchaininstance.py on lines 1590..1593

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 33.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                            if additional_owner_accounts is None:
                                                owner_accounts_authority = account['owner']['account_auths']
                                            else:
                                                owner_accounts_authority = []
                                    Severity: Minor
                                    Found in beem/blockchaininstance.py and 2 other locations - About 35 mins to fix
                                    beem/blockchaininstance.py on lines 1590..1593
                                    beem/blockchaininstance.py on lines 1594..1597

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 33.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    There are no issues that match your filters.

                                    Category
                                    Status