freqtrade/data/history/history_utils.py
File history_utils.py
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
import operator
from datetime import datetime, timedelta
from pathlib import Path
from typing import Dict, List, Optional, Tuple
Function _load_cached_data_for_updating
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def _load_cached_data_for_updating(
pair: str,
timeframe: str,
timerange: Optional[TimeRange],
data_handler: IDataHandler,
- 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 _download_pair_history
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _download_pair_history(pair: str, *,
Function load_data
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def load_data(datadir: Path,
Function load_pair_history
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def load_pair_history(pair: str,
Function refresh_backtest_ohlcv_data
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def refresh_backtest_ohlcv_data(exchange: Exchange, pairs: List[str], timeframes: List[str],
Function load_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def load_data(datadir: Path,
timeframe: str,
pairs: List[str], *,
timerange: Optional[TimeRange] = None,
fill_up_missing: bool = True,
- 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 refresh_backtest_trades_data
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def refresh_backtest_trades_data(exchange: Exchange, pairs: List[str], datadir: Path,
Function refresh_data
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def refresh_data(*, datadir: Path,
Function _download_trades_history
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _download_trades_history(exchange: Exchange,
Function _load_cached_data_for_updating
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _load_cached_data_for_updating(
Function validate_backtest_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def validate_backtest_data(data: DataFrame, pair: str, min_date: datetime,