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
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
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
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
- Read upRead up
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
- Read upRead up
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:
- Read upRead up
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.
- Read upRead up
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
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
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
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:
- Read upRead up
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
- Read upRead up
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
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
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":
- Read upRead up
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
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
- Read upRead up
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:
---
- Read upRead up
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
- Read upRead up
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