freqtrade/freqtrade

View on GitHub

Showing 507 of 507 total issues

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

def ask_user_config() -> Dict[str, Any]:
    """
    Ask user a few questions to build the configuration.
    Interactive questions built using https://github.com/tmbo/questionary
    :returns: Dict with keys to put into template
Severity: Minor
Found in freqtrade/commands/build_config_commands.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 ohlcv_load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def ohlcv_load(
        self,
        pair,
        timeframe: str,
        candle_type: CandleType,
Severity: Minor
Found in freqtrade/data/history/datahandlers/idatahandler.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 _ohlcv_load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _ohlcv_load(
        self, pair: str, timeframe: str, timerange: Optional[TimeRange], candle_type: CandleType
    ) -> pd.DataFrame:
        """
        Internal method used to load data for one pair from disk.
Severity: Minor
Found in freqtrade/data/history/datahandlers/hdf5datahandler.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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, config: Config) -> None:
        """
        Init all variables and objects the bot needs to work
        :param config: configuration dict, you can use Configuration.get_config()
        to get the config dict.
Severity: Minor
Found in freqtrade/freqtradebot.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 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 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 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 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 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 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 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 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 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 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 __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 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 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 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
                          Severity
                          Category
                          Status
                          Source
                          Language