freqtrade/freqai/data_kitchen.py
File data_kitchen.py
has 827 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
import inspect
import logging
import random
import shutil
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(
self,
config: Config,
live: bool = False,
pair: str = "",
Function use_strategy_to_populate_indicators
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def use_strategy_to_populate_indicators( # noqa: C901
Function populate_features
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def populate_features(self, dataframe: DataFrame, pair: str, strategy: IStrategy,
Function get_pair_data_for_features
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_pair_data_for_features(self,
Function build_data_dictionary
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_data_dictionary(
Function make_train_test_datasets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def make_train_test_datasets(
self, filtered_dataframe: DataFrame, labels: DataFrame
) -> Dict[Any, Any]:
"""
Given the dataframe for the full history for training, split the data into
- 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 merge_features
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def merge_features(self, df_main: DataFrame, df_to_merge: DataFrame,