freqtrade/freqtrade

View on GitHub

Showing 501 of 503 total issues

Function process_entry_exit_reasons has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def process_entry_exit_reasons(config: Config):
    try:
        analysis_groups = config.get("analysis_groups", [])
        enter_reason_list = config.get("enter_reason_list", ["all"])
        exit_reason_list = config.get("exit_reason_list", ["all"])
Severity: Minor
Found in freqtrade/data/entryexitanalysis.py - About 55 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 additional_exchange_init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def additional_exchange_init(self) -> None:
        """
        Additional exchange initialization logic.
        .api will be available at this point.
        Must be overridden in child methods if required.
Severity: Minor
Found in freqtrade/exchange/bybit.py - About 55 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 get_balances has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_balances(self) -> dict:
        if self._config["dry_run"]:
            return {}

        try:
Severity: Minor
Found in freqtrade/exchange/kraken.py - About 55 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 copy_sample_files has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def copy_sample_files(directory: Path, overwrite: bool = False) -> None:
    """
    Copy files from templates to User data directory.
    :param directory: Directory to copy data to
    :param overwrite: Overwrite existing sample files
Severity: Minor
Found in freqtrade/configuration/directory_operations.py - About 55 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 hyperopt_loss_function has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def hyperopt_loss_function(
Severity: Major
Found in freqtrade/templates/sample_hyperopt_loss.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(
    Severity: Major
    Found in freqtrade/freqai/data_kitchen.py - About 50 mins to fix

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

      def plot_area(
      Severity: Major
      Found in freqtrade/plot/plotting.py - About 50 mins to fix

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

        def generate_candlestick_graph(
        Severity: Major
        Found in freqtrade/plot/plotting.py - About 50 mins to fix

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

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

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

                def custom_sell(
            Severity: Major
            Found in freqtrade/strategy/interface.py - About 50 mins to fix

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

                  def __init__(
              Severity: Major
              Found in freqtrade/strategy/parameters.py - About 50 mins to fix

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

                def pair_history(
                Severity: Major
                Found in freqtrade/rpc/api_server/api_v1.py - About 50 mins to fix

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

                      def custom_exit(
                  Severity: Major
                  Found in freqtrade/strategy/interface.py - About 50 mins to fix

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

                    def dt_utc(
                    Severity: Major
                    Found in freqtrade/util/datetime_helpers.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(
                        Severity: Major
                        Found in freqtrade/freqai/torch/PyTorchTransformerModel.py - About 50 mins to fix

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

                          def generate_strategy_stats(
                          Severity: Major
                          Found in freqtrade/optimize/optimize_reports/optimize_reports.py - About 50 mins to fix

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

                            def make_env(
                            Severity: Major
                            Found in freqtrade/freqai/RL/BaseReinforcementLearningModel.py - About 50 mins to fix

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

                                  def _detect_next_stop_or_sell_point(
                              Severity: Major
                              Found in freqtrade/edge/edge_positioning.py - About 50 mins to fix

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

                                def _download_trades_history(
                                Severity: Major
                                Found in freqtrade/data/history/history_utils.py - About 50 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language