holgern/beem

View on GitHub

Showing 683 of 2,332 total issues

File cli.py has 4836 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
import os
import ast
import json
import sys
Severity: Major
Found in beem/cli.py - About 2 wks to fix

    File account.py has 3323 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    import pytz
    import json
    from datetime import datetime, timedelta, date, time
    import math
    Severity: Major
    Found in beem/account.py - About 1 wk to fix

      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

        Function blocks has a Cognitive Complexity of 171 (exceeds 5 allowed). Consider refactoring.
        Open

            def blocks(self, start=None, stop=None, max_batch_size=None, threading=False, thread_num=8, only_ops=False, only_virtual_ops=False):
                """ Yields blocks starting from ``start``.
        
                    :param int start: Starting block
                    :param int stop: Stop at this block
        Severity: Minor
        Found in beem/blockchain.py - About 3 days 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 info has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
        Open

        def info(objects):
            """ Show basic blockchain info
        
                General information about the blockchain, a block, an account,
                a post/comment and a public key
        Severity: Minor
        Found in beem/cli.py - About 2 days 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 pending has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
        Open

        def pending(accounts, only_sum, post, comment, curation, length, author, permlink, title, days, _from):
            """ Lists pending rewards
            """
            stm = shared_blockchain_instance()
            if stm.rpc is not None:
        Severity: Minor
        Found in beem/cli.py - About 2 days 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 curation has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
        Open

        def curation(authorperm, account, limit, min_vote, max_vote, min_performance, max_performance, payout, export, short, length, permlink, title, days):
            """ Lists curation rewards of all votes for authorperm
        
                When authorperm is empty or "all", the curation rewards
                for all account votes are shown.
        Severity: Minor
        Found in beem/cli.py - About 2 days to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File operations.py has 947 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        from beemgraphenebase.py23 import bytes_types, integer_types, string_types, text_type
        from collections import OrderedDict
        import json
        from binascii import hexlify, unhexlify
        Severity: Major
        Found in beembase/operations.py - About 2 days to fix

          Account has 120 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Account(BlockchainObject):
              """ This class allows to easily access Account data
          
                  :param str account: Name of the account
                  :param Steem/Hive blockchain_instance: Hive or Steem
          Severity: Major
          Found in beem/account.py - About 2 days to fix

            File discussions.py has 886 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            from .instance import shared_blockchain_instance
            from .account import Account
            from .comment import Comment
            from .utils import resolve_authorperm
            Severity: Major
            Found in beem/discussions.py - About 2 days to fix

              Function rewards has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
              Open

              def rewards(accounts, only_sum, post, comment, curation, length, author, permlink, title, days):
                  """ Lists received rewards
                  """
                  stm = shared_blockchain_instance()
                  if stm.rpc is not None:
              Severity: Minor
              Found in beem/cli.py - About 2 days 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 history has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
              Open

                  def history(
                      self, start=None, stop=None, use_block_num=True,
                      only_ops=[], exclude_ops=[], batch_size=1000, raw_output=False
                  ):
                      """ Returns a generator for individual account transactions. The
              Severity: Minor
              Found in beem/account.py - About 2 days to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              File comment.py has 868 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              import json
              import re
              import logging
              import pytz
              Severity: Major
              Found in beem/comment.py - About 2 days to fix

                File blockchain.py has 866 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                import sys
                import time
                import hashlib
                import json
                Severity: Major
                Found in beem/blockchain.py - About 2 days to fix

                  Function parse_op has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def parse_op(self, op, only_ops=[], enable_rewards=False, enable_out_votes=False, enable_in_votes=False):
                          """ Parse account history operation"""
                          ts = parse_time(op['timestamp'])
                  
                          if op['type'] == "account_create":
                  Severity: Minor
                  Found in beem/snapshot.py - About 2 days to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  File market.py has 831 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  import random
                  import pytz
                  import logging
                  from datetime import datetime, timedelta
                  Severity: Major
                  Found in beem/market.py - About 1 day to fix

                    Function history_reverse has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def history_reverse(
                            self, start=None, stop=None, use_block_num=True,
                            only_ops=[], exclude_ops=[], batch_size=1000, raw_output=False
                        ):
                            """ Returns a generator for individual account transactions. The
                    Severity: Minor
                    Found in beem/account.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 87 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def post(markdown_file, account, title, permlink, tags, reply_identifier, community, canonical_url, beneficiaries, percent_steem_dollars, percent_hbd, max_accepted_payout, no_parse_body, no_patch_on_edit, export):
                        """broadcasts a post/comment. All image links which links to a file will be uploaded.
                        The yaml header can contain:
                    
                        ---
                    Severity: Minor
                    Found in beem/cli.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 get_discussions has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_discussions(self, discussion_type, discussion_query, limit=1000, raw_data=False):
                            """ Get Discussions
                    
                                :param str discussion_type: Defines the used discussion query
                                :param Query discussion_query: Defines the parameter for
                    Severity: Minor
                    Found in beem/discussions.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

                    File account.py has 673 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    import hashlib
                    import sys
                    import re
                    import os
                    Severity: Major
                    Found in beemgraphenebase/account.py - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language