freqtrade/freqtrade

View on GitHub
freqtrade/freqai/data_kitchen.py

Summary

Maintainability
D
2 days
Test Coverage

File data_kitchen.py has 827 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import copy
import inspect
import logging
import random
import shutil
Severity: Major
Found in freqtrade/freqai/data_kitchen.py - About 1 day to fix

    Function __init__ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            config: Config,
            live: bool = False,
            pair: str = "",
    Severity: Minor
    Found in freqtrade/freqai/data_kitchen.py - About 1 hr to fix

      Function use_strategy_to_populate_indicators has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def use_strategy_to_populate_indicators(  # noqa: C901
      Severity: Major
      Found in freqtrade/freqai/data_kitchen.py - About 1 hr to fix

        Function populate_features has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def populate_features(self, dataframe: DataFrame, pair: str, strategy: IStrategy,
        Severity: Major
        Found in freqtrade/freqai/data_kitchen.py - About 50 mins to fix

          Function get_pair_data_for_features has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def get_pair_data_for_features(self,
          Severity: Major
          Found in freqtrade/freqai/data_kitchen.py - About 50 mins to fix

            Function build_data_dictionary has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def build_data_dictionary(
            Severity: Major
            Found in freqtrade/freqai/data_kitchen.py - About 50 mins to fix

              Function make_train_test_datasets has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              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
              Severity: Minor
              Found in freqtrade/freqai/data_kitchen.py - About 45 mins to fix

              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

                  def merge_features(self, df_main: DataFrame, df_to_merge: DataFrame,
              Severity: Minor
              Found in freqtrade/freqai/data_kitchen.py - About 45 mins to fix

                There are no issues that match your filters.

                Category
                Status