freqtrade/data/history/datahandlers/idatahandler.py
File idatahandler.py
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
Abstract datahandler interface.
It's subclasses handle and storing data from disk.
"""
IDataHandler
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class IDataHandler(ABC):
_OHLCV_REGEX = r'^([a-zA-Z_\d-]+)\-(\d+[a-zA-Z]{1,2})\-?([a-zA-Z_]*)?(?=\.)'
def __init__(self, datadir: Path) -> None:
Function _check_empty_df
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def _check_empty_df(
self, pairdf: DataFrame, pair: str, timeframe: str, candle_type: CandleType,
warn_no_data: bool, warn_price: bool = False) -> bool:
"""
Warn on empty dataframe
- 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 ohlcv_load
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ohlcv_load(self, pair, timeframe: str,
Function ohlcv_load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def ohlcv_load(self, pair, timeframe: str,
candle_type: CandleType, *,
timerange: Optional[TimeRange] = None,
fill_missing: bool = True,
drop_incomplete: bool = False,
- 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_empty_df
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _check_empty_df(
Function _validate_pairdata
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _validate_pairdata(self, pair, pairdata: DataFrame, timeframe: str,
Function _pair_data_filename
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _pair_data_filename(
Function rename_futures_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def rename_futures_data(