Showing 16 of 18 total issues
Function _color_table
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _color_table(table, floats, eps=1e-3):
"""
:param table: [] of []
Matrix
:param floats: [] of int
- 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 handle_rate_limits
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def handle_rate_limits(func, time_wait=60, max_attempts=2):
"""
:param func: callback function
function to wrap
:param time_wait: int
- 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_prices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_prices(self, coins, **kwargs):
if "dates" in kwargs:
dates = kwargs["dates"]
else: # args since, until and hours provided
dates = generate_dates(
- 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 parse_timedelta
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_timedelta(raw):
"""
:param raw: str
Time interval written in short format
:return: timedelta
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, raw_dict, coin_in, coin_out, date,
Function download_prices
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def download_prices(coins, since, until, where_to, verbose, currency="USD",
Function normalize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def normalize(val, min_val, max_val, min_range=-1.0, max_range=1.0):
Function print_balance_info
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def print_balance_info(total_value, delta, percentage, last_time, color=False):
Function color_number
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def color_number(number, low_color=Fore.RED,
Function build_parser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_parser(input_file):
"""
:param input_file: str
File to parse
:return: CryptoExchange
- 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
Avoid too many return
statements within this function. Open
return timedelta(days=7 * time_token)
Function build_wallets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_wallets(self):
"""
:return: {} of str -> Wallet
Build a wallet for each currency traded and put trading history
there
- 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_values_on
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_values_on(self, date_time):
"""
:param date_time: datetime
Date to get values of
:return: {}
- 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 has
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def has(self, item):
"""
:param item: str
Item to look for
:return: bool
- 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_amount_buy_sell
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_amount_buy_sell(self, coin):
"""
:param coin: Coin
Coin to get
:return: float
- 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 fetch_prices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fetch_prices(self, coins, date_time, currency):
"""
:param coins: [] of str
List of coins
:param date_time: datetime
- 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"