Showing 514 of 516 total issues
Function get_liquidation_price
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_liquidation_price(
Function __init__
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, config: Config) -> None:
self.config = config
self.assert_config(self.config)
self.freqai_info: Dict[str, Any] = config["freqai"]
self.data_split_parameters: Dict[str, Any] = config.get("freqai", {}).get(
Function migrate_trades_and_orders_table
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def migrate_trades_and_orders_table(
decl_base,
inspector,
engine,
trade_back_name: str,
Function __init__
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, config: Config, exchange: Optional[Exchange] = None) -> None:
LoggingMixin.show_output = False
self.config = config
self.results: BacktestResultType = get_BacktestResultType_default()
self.trade_id_counter: int = 0
Function _send_msg
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _send_msg(self, payload: dict) -> None:
"""do the actual call to the webhook"""
success = False
attempts = 0
- 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 check_order_replace
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def check_order_replace(
self, trade: LocalTrade, order: Order, current_time, row: Tuple
) -> bool:
"""
Check if current analyzed entry order has to be replaced and do so.
- 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 a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, config: Config, exchange: Optional[Exchange] = None) -> None:
LoggingMixin.show_output = False
self.config = config
self.results: BacktestResultType = get_BacktestResultType_default()
self.trade_id_counter: int = 0
- 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 dry_run_liquidation_price
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def dry_run_liquidation_price(
Function dry_run_liquidation_price
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def dry_run_liquidation_price(
Function __init__
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, config: Config) -> None:
self.buy_space: List[Dimension] = []
self.sell_space: List[Dimension] = []
self.protection_space: List[Dimension] = []
self.roi_space: List[Dimension] = []
Consider simplifying this complex logical expression. Open
if trade_dur == 0 and (
(
is_short
# Red candle (for longs)
and row[OPEN_IDX] < row[CLOSE_IDX] # Red candle
Function _rpc_trade_statistics
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _rpc_trade_statistics(
self, stake_currency: str, fiat_display_currency: str, start_date: Optional[datetime] = None
) -> Dict[str, Any]:
"""Returns cumulative profit statistics"""
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function dry_run_liquidation_price
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def dry_run_liquidation_price(
Function expand_pairlist
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def expand_pairlist(
wildcardpl: List[str], available_pairs: List[str], keep_invalid: bool = False
) -> List[str]:
"""
Expand pairlist potentially containing wildcards based on available markets.
- 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 filter_pairlist
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]:
"""
Filters and sorts pairlist and returns the whitelist again.
Called on each bot iteration - please use internal caching if necessary
:param pairlist: pairlist to filter or sort
- 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, config: Config) -> None:
self.config = config
# Dict to determine if analysis is necessary
self._last_candle_seen_per_pair: Dict[str, datetime] = {}
super().__init__(config)
- 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 strategy_safe_wrapper
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def strategy_safe_wrapper(f: F, message: str = "", default_retval=None, supress_error=False) -> F:
"""
Wrapper around user-provided methods and functions.
Caches all exceptions and returns either the default_retval (if it's not None) or raises
a StrategyError exception, which then needs to be handled by the calling method.
- 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 _rpc_stats
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _rpc_stats(self) -> Dict[str, Any]:
"""
Generate generic stats for trades in database
"""
- 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 send_msg
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def send_msg(self, msg) -> None:
if fields := self._config["discord"].get(msg["type"].value):
logger.info(f"Sending discord message: {msg}")
msg["strategy"] = self.strategy
- 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"